Exemple #1
0
 def __init__(self):
     '''初始化
     Args:
         _source_conf 源目标连接配置
         _target_conf
         _key 配置密钥
         _aes 解密对象
     '''
     source_conf_path = file_utils.get_full_filename('config','source_conf.jl')
     target_conf_path = file_utils.get_full_filename('config','target_conf.jl')
     self._source_conf = self._get_conf_from_file(source_conf_path)
     self._target_conf = self._get_conf_from_file(target_conf_path)
     self._key = 'Zanthoxylum'
     self._aes = ZanthAES()
Exemple #2
0
 def __init__(self):
     '''初始化
     Args:
         _source_conf 目标连接配置
     '''
     conn_conf_path = file_utils.get_full_filename('config',
                                                   'postgres_conf.jl')
     self._conn_conf = self._get_conf_from_file(conn_conf_path)
Exemple #3
0
def get_conf():
    '''读取源服务连接配置
    Returns: username, userid, ip, port
    '''
    conf_path = file_utils.get_full_filename('config', 'websocket_conf.jl')
    conf_json = _get_conf_from_file(conf_path)
    source_list = list(conf_json.values())
    return source_list[0], source_list[1], source_list[2], source_list[3]
Exemple #4
0
def main():
    url = "https://plasma.stpass.com"
    file_list = file_utils.get_filename_in_dir('assert')
    print(file_list)
    for file_name in file_list:
        if file_utils.check_file_type(file_name, __acess_file_type()):
            file_fullname = file_utils.get_full_filename('assert', file_name)
            is_ok, path = upload_file(url, file_name, file_fullname)
            log_content = "[" + file_name + "] [" + path + "] [" + str(
                is_ok) + "]"
            file_utils.save_log('logs', log_content)
Exemple #5
0
 def __init__(self):
     self.config = ConnConfig()
     source_pwd = self.config.get_source_pwd()
     target_pwd = self.config.get_target_pwd()
     prefix = self.__get_prefix()
     suffix = self.__get_suffix()
     self.file_name = prefix + time.strftime("%Y%m%d", time.localtime()) + suffix
     self.source = source_pwd + self.file_name
     self.local = file_utils.get_full_filename('assert',self.file_name)
     self.target = target_pwd + self.file_name
     self.target_trans = None