Python: remove unnecessary prefix map printout
authorjani <jani@asema.com>
Wed, 20 Mar 2019 15:09:44 +0000 (17:09 +0200)
committerjani <jani@asema.com>
Wed, 20 Mar 2019 15:09:44 +0000 (17:09 +0200)
Common/Python/SmartAPI/common/NS.py
Common/Python/SmartAPI/factory/NotificationFactory.py

index 5884b70d752a3fc202a3b3e2342269e11c8381fb..e49cacbe10b6241a27377ce0d01a5e950e823de3 100644 (file)
@@ -23,10 +23,9 @@ def generatePrefixMapFromNSFields():
     prefixes['xsd'] = "http://www.w3.org/2001/XMLSchema#"
     prefixes['dc'] = "http://purl.org/dc/terms/"
     prefixes['gr'] = "http://purl.org/goodrelations/v1#"
-    
-    print 'prefix map has been initialized. \n'
 
-class NS(object):      
+
+class NS(object):
     customOntologyPrefix = "http://smart-api.io/ontology/"
     
     # initialize prefixes map only once
@@ -45,7 +44,7 @@ class NS(object):
     XSD = prefixes['xsd']
     DC = prefixes['dc']    
     GR = prefixes['gr']
-              
+    
     @classmethod
     def toAbsoluteUri(cls, uri):
         from SmartAPI.rdf.Variant import Variant
@@ -84,7 +83,7 @@ class NS(object):
     def prefixToUri(cls, prefix):
         '''
         Return uri string that the given prefix represents. If not found, return None.
-        '''                    
+        '''
         prefix = prefix.lower()
         if prefix in prefixes:
             return prefixes[prefix]
@@ -122,4 +121,4 @@ class NS(object):
     @classmethod
     def addPrefixMapping(cls, prefix, uri):
         prefixes[prefix.lower()] = uri
-    
+
index 9e17fdbfb922a19ad6a797a8069f5b387f28783f..ee8484d8fb0055a270db5e8546377bbe3ae43a36 100644 (file)
@@ -12,7 +12,8 @@ class NotificationFactory(object):
        def __init__(self):
                pass
        
-       def create(self, generatedBy):
+       @classmethod
+       def create(cls, generatedBy):
                notification = Notification()
                if (generatedBy is None or (generatedBy is not None and generatedBy == "")):
                        raise InsufficientDataException("Invalid seas:generatedBy URI.");