dever преди 6 години
родител
ревизия
98fa7e851d
променени са 10 файла, в които са добавени 18 реда и са изтрити 36 реда
  1. 1 0
      function/__init__.py
  2. 1 0
      function/ai/__init__.py
  3. 1 0
      function/asr/__init__.py
  4. 1 0
      function/nlu/__init__.py
  5. 1 0
      function/snowboy/__init__.py
  6. 1 0
      function/tts/__init__.py
  7. 10 35
      run.py
  8. 0 0
      runtime/log/readme.txt
  9. 2 0
      runtime/log/vecan.log
  10. 0 1
      service/__init__.py

+ 1 - 0
function/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 1 - 0
function/ai/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 1 - 0
function/asr/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 1 - 0
function/nlu/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 1 - 0
function/snowboy/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 1 - 0
function/tts/__init__.py

@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-

+ 10 - 35
run.py

@@ -1,40 +1,15 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
-import time
 from demeter.core import *
-from gevent import monkey; monkey.patch_socket()
-import gevent
-timeSleep = 15
 
-def command(file):
-	return 'python '+File.path()+'convert.py -f ' + file
+print('''
+********************************************************
+*          vecan-robot - 神算终端机器人                *
+*          (c) 2019 rabin <rabin@dever.cc>             *
+*     https://github.com/shemic/vecan.git              *
+********************************************************
+            如需退出,可以按 Ctrl-4 组合键。
+''')
 
-# 文档转换
-def convert():
-	r = Demeter.redis()
-	c = Demeter.config['redis']
-	i = 0
-	while 1:
-		file = r.lpop(c['name'])
-		if file:
-			g = command(file)
-			Shell.popen(g, True, True)
-		i = i+1
-		if i >= 10:
-			gevent.sleep(timeSleep)
-			i = 0
 
-# 清理一天前的sign
-def signature():
-	while 1:
-		service = Demeter.service('convert')
-		service.crearSignature()
-		gevent.sleep(3600)
-
-def handle():
-	gevent.joinall([
-		gevent.spawn(convert),
-		gevent.spawn(signature),
-	])
-
-handle()
+logger = Log.get(__name__)
+logger.info('测试测试')

+ 0 - 0
runtime/log/readme.txt


+ 2 - 0
runtime/log/vecan.log

@@ -0,0 +1,2 @@
+2019-07-01 10:55:47,343 - __main__ - INFO - 测试测试
+2019-07-01 10:59:02,569 - __main__ - INFO - 测试测试

+ 0 - 1
service/__init__.py

@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 """
     demeter init