代码拉取完成,页面将自动刷新
同步操作将从 苦叶子/AutoLine 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: [email protected]
"""
import os
import sys
import codecs
import requests
from app import create_app, db
from app.utils.trigger import Trigger
from app.models import User, Role
from flask_script import Manager, Shell
from flask_migrate import Migrate, MigrateCommand
def check_python_version():
if sys.version_info < (3, 4):
print("请安装Python3.4及以上版本")
exit(0)
def check_version():
f = codecs.open('version.txt', 'r')
version = f.readline()
s = requests.Session()
r_version = s.get("https://gitee.com/lym51/AutoLine/raw/master/version.txt").text
if version != r_version:
print("*" * 25)
print("本地版本:v%s" % version)
print("github版本: v%s" % r_version)
print("AutoLine开源平台不再维护!!!!!!!!")
print("AutoLine开源平台不再维护!!!!!!!!")
print("AutoLine开源平台不再维护!!!!!!!!")
print("AutoLine开源平台不再维护!!!!!!!!")
print("AutoLine开源平台不再维护!!!!!!!!")
print("请使用架构和设计全面重构的AutoLink!!!!!!!!!!")
print("请使用架构和设计全面重构的AutoLink!!!!!!!!!!")
print("请使用架构和设计全面重构的AutoLink!!!!!!!!!!")
print("请使用架构和设计全面重构的AutoLink!!!!!!!!!!")
print("请使用架构和设计全面重构的AutoLink!!!!!!!!!!")
print("https://github.com/small99/AutoLink")
import webbrowser
webbrowser.open("https://github.com/small99/AutoLink")
print("*" * 25)
exit(0)
f.close()
def start_trigger():
app.config["TRIGGER"] = Trigger(app)
app.config["TRIGGER"].setup()
app.config["TRIGGER"].load_job_list()
app.config["TRIGGER"].start()
def output_logo():
logo = """
--------------------------------------------
_ _
/\ _ | | (_)
/ \ _ _| |_ ___ | | _ ____ ____
/ /\ \| | | | _)/ _ \| | | | _ \ / _ )
| |__| | |_| | |_| |_| | |_____| | | | ( (/ /
|______|\____|\___)___/|_______)_|_| |_|\____)
--------------------------------------------
https://github.com/small99/AutoLine
"""
print(logo)
os.environ["PATH"] = os.environ["PATH"] + ";" + os.getcwd() + "/bin"
app = create_app(os.environ.get('AUTOBEAT_CONFIG') or 'default')
#trigger = Trigger(app)
#trigger.setup()
#trigger.load_job_list()
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role)
manager.add_command('shell', Shell(make_context=make_shell_context))
manager.add_command('db', MigrateCommand)
@manager.command
def deploy():
from flask_migrate import upgrade
from app.models import Role, User
upgrade()
Role.insert_roles()
User.insert_admin()
User.insert_auto()
@manager.command
def keyword():
import subprocess
libs = ('BuiltIn', 'Collections', 'DateTime',
'Dialogs', 'OperatingSystem', 'Process',
'Screenshot', 'String', 'Telnet', 'XML',
'RequestsLibrary', 'AppiumLibrary', 'SeleniumLibrary')
print("生成关键字...")
for lib in libs:
args = 'python -m robot.libdoc %s doc/%s.xml' % (lib, lib)
subprocess.call(args, shell=True)
if __name__ == '__main__':
check_python_version()
check_version()
if "runserver" in sys.argv:
start_trigger()
output_logo()
manager.run()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。