Просмотр исходного кода

修改 node node_modules 安装位置

萤火也是火 3 лет назад
Родитель
Сommit
ce28b3fc0d
4 измененных файлов с 51 добавлено и 19 удалено
  1. 19 15
      ybw/config/load.py
  2. 13 0
      ybw/package-lock.json
  3. 15 0
      ybw/package.json
  4. 4 4
      zbytb/config/conf.yaml

+ 19 - 15
ybw/config/load.py

@@ -1,28 +1,35 @@
-import sys
 from pathlib import Path
 
 import yaml
 
 __all__ = [
-    'mongo_conf', 'redis_conf', 'oss_conf', 'es_conf',
+    'mongo_conf',
+    'redis_conf',
+    'oss_conf',
+    'es_conf',
     'constants',
-    'headers', 'jy_proxy', 'node_module', 'crawler_url',
-    'region', 'analyze_url', 'node_module_path'
+    'headers',
+    'jy_proxy',
+    'crawler_url',
+    'region',
+    'analyze_url',
+    'node_module_path'
 ]
 
-base_path = Path(__file__).parent
-yaml_conf = (base_path / 'conf.yaml').resolve()
-yaml_constants = (base_path / 'constants.yaml').resolve()
-yaml_areas = (base_path / 'areas.yaml').resolve()
+_base_path = Path(__file__).parent
+_yaml_conf = (_base_path / 'conf.yaml').resolve()
+_yaml_constants = (_base_path / 'constants.yaml').resolve()
+_yaml_areas = (_base_path / 'areas.yaml').resolve()
+_node_modules = (_base_path.parent / 'node_modules').resolve()
 
-with open(yaml_conf, encoding="utf-8") as f:
+with open(_yaml_conf, encoding="utf-8") as f:
     conf = yaml.safe_load(f)
     mongo_conf = conf['mongo']
     redis_conf = conf['redis']
     es_conf: dict = conf['es']
     oss_conf: dict = conf['ali_oss']
 
-with open(yaml_constants, encoding="utf-8") as fp:
+with open(_yaml_constants, encoding="utf-8") as fp:
     constants = yaml.safe_load(fp)
     headers: dict = constants['headers']
     jy_proxy: dict = constants['proxy']
@@ -30,12 +37,9 @@ with open(yaml_constants, encoding="utf-8") as fp:
     crawler_url: dict = constants['crawler_url']
     analyze_url = f'http://{es_conf["host"]}:{es_conf["port"]}/{es_conf["db"]}/_analyze'
 
-with open(yaml_areas, encoding="utf-8") as fr:
+with open(_yaml_areas, encoding="utf-8") as fr:
     areas = yaml.safe_load(fr)
     region: dict = areas['area']
 
 
-if sys.platform == 'linux':
-    node_module_path = node_module['linux']
-else:
-    node_module_path = node_module['windows']
+node_module_path = _node_modules

+ 13 - 0
ybw/package-lock.json

@@ -0,0 +1,13 @@
+{
+  "name": "ybw",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "crypto-js": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz",
+      "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
+    }
+  }
+}

+ 15 - 0
ybw/package.json

@@ -0,0 +1,15 @@
+{
+  "name": "ybw",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "crypto-js": "^4.1.1"
+  }
+}

+ 4 - 4
zbytb/config/conf.yaml

@@ -1,9 +1,9 @@
 # mongo
 mongo:
-  host: 172.17.4.87
-  port: !!int 27080
-#  host: 127.0.0.1
-#  port: !!int 27017
+#  host: 172.17.4.87
+#  port: !!int 27080
+  host: 127.0.0.1
+  port: !!int 27017
 
 
 # redis