Browse Source

add getKeys in switchrule.py

dev
breakwa11 10 years ago
parent
commit
298e8a06c9
  1. 4
      db_transfer.py
  2. 3
      switchrule.py

4
db_transfer.py

@ -76,6 +76,10 @@ class DbTransfer(object):
@staticmethod @staticmethod
def pull_db_all_user(): def pull_db_all_user():
#数据库所有用户信息 #数据库所有用户信息
try:
import switchrule
keys = switchrule.getKeys()
except Exception, e:
keys = ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ] keys = ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ]
conn = cymysql.connect(host=Config.MYSQL_HOST, port=Config.MYSQL_PORT, user=Config.MYSQL_USER, conn = cymysql.connect(host=Config.MYSQL_HOST, port=Config.MYSQL_PORT, user=Config.MYSQL_USER,
passwd=Config.MYSQL_PASS, db=Config.MYSQL_DB, charset='utf8') passwd=Config.MYSQL_PASS, db=Config.MYSQL_DB, charset='utf8')

3
switchrule.py

@ -1,3 +1,6 @@
def getKeys():
return ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ]
def isTurnOn(row): def isTurnOn(row):
return True return True

Loading…
Cancel
Save