Преглед на файлове

配置文件路径改为绝对路径

liyuyi@c-top.com.cn преди 4 години
родител
ревизия
6da29a264f
променени са 6 файла, в които са добавени 6 реда и са изтрити 8 реда
  1. 0 2
      .idea/ai_target.iml
  2. 1 1
      BayesCombine.py
  3. 1 1
      ai_callback_handler.py
  4. 1 1
      ai_target_combine_handler.py
  5. 1 1
      time_task_create_ad_by_target.py
  6. 2 2
      utils/commonFunc.py

+ 0 - 2
.idea/ai_target.iml

@@ -4,8 +4,6 @@
     <content url="file://$MODULE_DIR$" />
     <orderEntry type="jdk" jdkName="Remote Python 3.8.10 (sftp://root@139.186.165.84:22/data/Miniconda3/envs/ai_target/bin/python)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="ai_ads" />
-    <orderEntry type="module" module-name="get_data_by_threadpool" />
   </component>
   <component name="PyDocumentationSettings">
     <option name="renderExternalDocumentation" value="true" />

+ 1 - 1
BayesCombine.py

@@ -218,7 +218,7 @@ class BayesCombine(object):
 
 if __name__ == '__main__':
     # 1、读取配置文件
-    with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+    with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
         config = yaml.load(f.read(), Loader=yaml.FullLoader)
 
     # 1-1 数据库连接引擎,依据开发环境/生产环境 进行切换

+ 1 - 1
ai_callback_handler.py

@@ -17,7 +17,7 @@ logger.setLevel(logging.DEBUG)
 print('id of ai_callback_logger %s' % id(logger))
 logger.info("ai_callback_server started!")
 
-with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
     config = yaml.load(f.read(), Loader=yaml.FullLoader)
 if os.getenv('LYY_DEV', 'unknown') == 'dev':
     db_info = config['devDB']

+ 1 - 1
ai_target_combine_handler.py

@@ -24,7 +24,7 @@ logger.addHandler(log_handler)
 logger.setLevel(logging.DEBUG)
 print('id of ai_target_combine_logger %s' % id(logger))
 
-with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
     config = yaml.load(f.read(), Loader=yaml.FullLoader)
 
 

+ 1 - 1
time_task_create_ad_by_target.py

@@ -20,7 +20,7 @@ logger.addHandler(log_handler)
 logger.setLevel(logging.DEBUG)
 print('id of time_task_create_ad_by_target_logger %s' % id(logger))
 
-with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
     config = yaml.load(f.read(), Loader=yaml.FullLoader)
 product_db_engine = get_db_engine(config['productDB'])
 project_ids = config['projectId']  # 目前支持优质定向功能的项目列表

+ 2 - 2
utils/commonFunc.py

@@ -45,7 +45,7 @@ def is_contains_region(val1, val2):
                 on t1.city_name = t2.name
                 where t1.city_level in %s
                 """ % (val_tuple,)
-    with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+    with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
         config = yaml.load(f.read(), Loader=yaml.FullLoader)
 
     city_df = pd.read_sql(sql, get_db_engine(config['productDB']))
@@ -178,7 +178,7 @@ def city_code_transform(val):
                 where t1.city_level in %s
                  """ % (tuple(val.split('|')),)
 
-        with open('config/config.yaml', mode='r', encoding='utf-8') as f:
+        with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
             config = yaml.load(f.read(), Loader=yaml.FullLoader)
         city_df = pd.read_sql(sql, get_db_engine(config['productDB']))