Sfi can be created without options at all
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 18 Dec 2010 15:25:42 +0000 (16:25 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 18 Dec 2010 15:25:42 +0000 (16:25 +0100)
sfa/client/sfi.py

index e9ef1cf..a70590b 100755 (executable)
@@ -123,7 +123,13 @@ class Sfi:
     
     required_options=['verbose',  'debug',  'registry',  'sm',  'auth',  'user']
 
+    # dummy to meet Sfi's expectations for its 'options' field
+    # i.e. s/t we can do setattr on
+    class DummyOptions:
+        pass
+
     def __init__ (self,options=None):
+        if options is None: options=Sfi.DummyOptions()
         for opt in Sfi.required_options:
             if not hasattr(options,opt): setattr(options,opt,None)
         if not hasattr(options,'sfi_dir'): options.sfi_dir=os.path.expanduser("~/.sfi/")