install.py 776 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. from demeter.core import *
  3. Shell.popen('apt-get install python-pyaudio python3-pyaudio sox pulseaudio libsox-fmt-all ffmpeg libatlas-base-dev libsox-fmt-mp3 && pip install pydub pyaudio baidu-aip hmac python-dateutil pyttsx3')
  4. #CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
  5. def manage():
  6. model = Demeter.model('manage_admin')
  7. model.id = 1
  8. info = model.select(type='fetchone')
  9. if not info:
  10. model.role_id = 1
  11. model.username = 'admin'
  12. model.mobile = '15810090845'
  13. model.password = '123456'
  14. model.insert()
  15. model = Demeter.model('manage_role')
  16. model.id = 1
  17. info = model.select(type='fetchone')
  18. if not info:
  19. model.name = u'管理员'
  20. model.insert()
  21. manage()
  22. Demeter.echo('install success!')