示例#1
0
    class Resource(object):
        def __init__(self, smvApp, fqn):
            self.dsr = DataSetRepo(smvApp)
            self.fqn = fqn

        def __enter__(self):
            return self.dsr.loadDataSet(self.fqn)

        def __exit__(self, type, value, traceback):
            pass
示例#2
0
    class Resource(object):
        def __init__(self, smvApp, fqn):
            self.dsr = DataSetRepo(smvApp)
            self.fqn = fqn

        def __enter__(self):
            return self.dsr.loadDataSet(self.fqn)

        def __exit__(self, type, value, traceback):
            pass
示例#3
0
    class Resource(object):
        def __init__(self, smvApp, path, fqn):
            self.dsr = DataSetRepo(smvApp)
            self.path = path
            self.fqn = fqn

        def __enter__(self):
            sys.path.insert(1, self.path)
            return self.dsr.loadDataSet(self.fqn)

        def __exit__(self, type, value, traceback):
            sys.path.remove(self.path)
示例#4
0
    class Resource(object):
        def __init__(self, smvApp, path, fqn):
            self.dsr = DataSetRepo(smvApp)
            self.path = path
            self.fqn = fqn

        def __enter__(self):
            sys.path.insert(1,self.path)
            return self.dsr.loadDataSet(self.fqn)

        def __exit__(self, type, value, traceback):
            sys.path.remove(self.path)
示例#5
0
    class Resource(object):
        def __init__(self, smvApp, target_path, fqn):
            self.smvApp = smvApp
            self.dsr = DataSetRepo(smvApp)
            self.orig_path = os.getcwd()
            self.target_path = target_path
            self.fqn = fqn

        def __enter__(self):
            self.smvApp.setAppDir(self.target_path)
            return self.dsr.loadDataSet(self.fqn)

        def __exit__(self, type, value, traceback):
            self.smvApp.setAppDir(self.orig_path)
示例#6
0
文件: smvapp.py 项目: bakhalea/SMV
 def refresh_provider_cache(self):
     """Re-discover providers and set provider_cache"""
     self.provider_cache = DataSetRepo(self)._all_providers()
示例#7
0
 def __init__(self, smvApp, path, fqn):
     self.dsr = DataSetRepo(smvApp)
     self.path = path
     self.fqn = fqn
示例#8
0
 def __init__(self, smvApp, fqn):
     self.dsr = DataSetRepo(smvApp)
     self.fqn = fqn
示例#9
0
 def __init__(self, smvApp, path, fqn):
     self.dsr = DataSetRepo(smvApp)
     self.path = path
     self.fqn = fqn
示例#10
0
    def build_new_repo(self): return DataSetRepo(self.smvApp)

    def test_discover_new_module_in_file(self):
示例#11
0
 def build_new_repo(self):
     return DataSetRepo(self.smvApp)
示例#12
0
 def __enter__(self):
     self.smvApp.setAppDir(self.target_path)
     dsr = DataSetRepo(self.smvApp)
     return dsr.loadDataSet(self.fqn)
示例#13
0
 def __init__(self, smvApp, fqn):
     self.dsr = DataSetRepo(smvApp)
     self.fqn = fqn
示例#14
0
 def __init__(self, smvApp, target_path, fqn):
     self.smvApp = smvApp
     self.dsr = DataSetRepo(smvApp)
     self.orig_path = os.getcwd()
     self.target_path = target_path
     self.fqn = fqn