Exemplo n.º 1
0
 def scan(self, conf = 'scaner/data_source'):
     '''
     scan files
     save files
     mv files
     '''
     c = DaConfig()
     config = c.get_conf(conf)
     s = Scaner([], None, self.SUFFIX_LIST)
     for (k, v) in config.items():
         db = v['db']
         file_dir = v['dir']
         out_dir = v['out_dir']
         if not os.path.isdir(file_dir): continue
         s.set_scan_dirs(file_dir)
         files = s.scan().files
         len(files) == 0 or self.import_data(db, files, file_dir, out_dir)
         s.clean_up()
     return self
Exemplo n.º 2
0
 def get_conf(conf_name):
     c = DaConfig()
     conf = c.get_db_conf(conf_name)
     return conf