Пример #1
0
 def syncprovders(self):
     providers = self.settings.get("providers", {})
     for name, config in providers.iteritems():
         cmd = config['cmd']
         cmd = os.path.join(self.folder, cmd)
         if config['type'] == 'replication' or config['type'] == 'batch':
             yield replication.BatchFileSync(name, cmd)
Пример #2
0
    def syncprovders(self):
        providers = self.settings.get("providers", {})
        variables = {}
        for name, config in providers.iteritems():
            if name == "variables":
                variables.update(config)
                continue

            cmd = config['cmd']
            cmd = os.path.join(self.folder, cmd)
            if config['type'] == 'replication' or config['type'] == 'batch':
                config['cmd'] = cmd
                config.setdefault('variables', variables)
                config.update(variables)
                yield replication.BatchFileSync(name, **config)
Пример #3
0
def syncprovders():
    from roam.syncing import replication
    path = os.path.dirname(roam.config.loaded_path)
    settings = load(os.path.join(path, 'sync.config'))
    providers = settings.get("providers", {})
    variables = {}
    for name, config in providers.items():
        if name == "variables":
            variables.update(config)
            continue

        cmd = config['cmd']
        cmd = os.path.join(path, cmd)
        if config['type'] == 'replication' or config['type'] == 'batch':
            config['cmd'] = cmd
            config['rootfolder'] = path
            config.setdefault('variables', variables)
            config.update(variables)
            yield replication.BatchFileSync(name, None, **config)