X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifoldapi%2Fmetadata.py;h=f8e9b34865d4b78b7b471c23d621a24dd49bf55d;hb=92620bf17c60377b7d156a6edf2c6a3077dd2745;hp=e4be9e04e91c601d15fc6fcc8ce8c8f9f38488d1;hpb=8e18c9ff4a961c70f897ca3915959d2fa3f7fb38;p=myslice.git diff --git a/manifoldapi/metadata.py b/manifoldapi/metadata.py index e4be9e04..f8e9b348 100644 --- a/manifoldapi/metadata.py +++ b/manifoldapi/metadata.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import json import os.path @@ -8,6 +6,8 @@ from manifoldapi import ManifoldAPI from django.contrib import messages +from myslice.settings import logger + debug=False #debug=True @@ -36,10 +36,10 @@ class MetaData: # xxx need a way to export error messages to the UI if result['code'] == 1: # warning # messages.warning(request, result['description']) - print(("METADATA WARNING -",request,result['description'])) + logger.warning(("METADATA WARNING - {} {}".format(request,result['description']))) elif result['code'] == 2: # messages.error(request, result['description']) - print(("METADATA ERROR -",request,result['description'])) + logger.error(("METADATA ERROR - {} {}".format(request,result['description']))) # XXX FAIL HERE XXX return @@ -60,5 +60,6 @@ class MetaData: return self.hash_by_object[object]['column'].sort() def get_field_type(self, object, field): - if debug: print("Temp fix for metadata::get_field_type() -> consider moving to manifold.core.metadata soon") + if debug: + logger.debug("Temp fix for metadata::get_field_type() -> consider moving to manifold.core.metadata soon") return field