Esempio n. 1
0
def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    backend.set_Tk_var()
    top = Toplevel1 (root)
    backend.init(root, top)
    root.mainloop()
Esempio n. 2
0
def create_Toplevel1(root, *args, **kwargs):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = tk.Toplevel (root)
    backend.set_Tk_var()
    top = Toplevel1 (w)
    backend.init(w, top, *args, **kwargs)
    return (w, top)
Esempio n. 3
0
def update(url=None, realurl=None):
    if realurl:
        backend.getNewXls(realurl)
        backend.init()
        return
    if not url:
        url = simpledialog.askstring('下载考试通知文件', '请输入考试安排通知网址')
    if backend.getNewXls(url):
        showinfo('下载成功', 'XLS考试通知文件下载成功!')
        backend.init()
    else:
        showerror('下载失败', '未能成功下载XLS文件')
Esempio n. 4
0
def init(filename, format):
    if filename:
        try:
            load(filename, format)
        except LoadError as e:
            print 'error: ', e.value
            print 'use "-f FORMAT" to provide equilibrium format'
            sys.exit(2)

        equi2d_interface.write_config_file(filename)

    else:
        backend.init("", "./")

    ierr = equi2d_interface.init()
Esempio n. 5
0
    showerror('检测文件更新失败', '设备未联网' + ('且无可用考试安排文件,程序自动退出。' if flag else ''))
    if flag:
        exit('No Network')
elif res:
    if res[-1]:
        if flag:
            ask = True
        else:
            ask = askyesno('发现新的考试安排',
                           '发现新的考试安排:\n    ' + res[1] + '\n\n是否更新考试安排文件?')
        if ask:
            if flag:
                update(realurl=res[0])
            else:
                update(url=res[0])
        else:
            backend.init()
    else:
        update('', res[0])
        showinfo('自动更新', '发现考试安排变更,已自动更新。')
else:
    backend.init()
res = backend.new_version()
if res:
    ask = askyesno('发现新版本', '更新内容:\n    %s\n是否更新' % res[1])
    if ask:
        backend.update_version()
        exit('Update succeed! Restart exam to use it!')

win.mainloop()
Esempio n. 6
0
def main():
    backend.init()
    print "Server Running..."
    tornado.options.parse_command_line()
    TornadoApplication().listen(options.port, xheaders=True)
    tornado.ioloop.IOLoop.current().start()
Esempio n. 7
0
def load_urls():
    flaskhelper.register(backend.init())
from flask import Flask, request, render_template, jsonify
import backend
import threading

app = Flask(__name__)


#renders the main webpage for your browser
@app.route('/')
def index():
    return render_template('main.html')


#gets the post request and starts the link requesting with the received data
@app.route('/req', methods=["POST"])
def responseFunc():
    req_data = request.get_json()
    backend.requestLinks(req_data)
    return "data received!"


#starts the webpage and loads the webpage in the automated browser
if __name__ == "__main__":
    threading.Timer(1, lambda: backend.init()).start()
    app.run(debug=False, port="8080")
Esempio n. 9
0
def load_urls():
    flaskhelper.register(karpbackend.init())
    flaskhelper.register(skbl.skblbackend.init())
    flaskhelper.register(sbbackend.init())
Esempio n. 10
0
            metavar="FLAGS")
    parser.add_option("-q", "--quiet", action="store_true", dest="quiet",
            default=False, help=_("Suppress output messages, except errors"))
    parser.add_option("-s", "--keepsshhost", action="store_true", dest="ssh",
            default=False, help=_("Retain ssh_host keys (generally not a good idea)"))
    group = OptionGroup(parser, _("Passing installation partitions"),
            _("   mount-point:device:format:uuid/label ..."
            " More than one such descriptor can be passed, using ',' as"
            " separator.   The first entry should be for root"
            " (mount-point is '/'), swap partitions have mount-point 'swap'."
            "   format should be 'ext4' or 'jfs', for example. If it is"
            " empty, no formatting will be performed. Also swap"
            " partitions should have this field empty.   The final entry"
            " may be empty (implying the system default will be used),"
            " otherwise:   "
            "   -: using straight device names (/dev/sdXN),"
            "   LABEL=xxxxx: using partition labels,"
            "   UUID=xxxxx: using UUIDs"))
    group.add_option("-l", "--partitions", action="store", type="string",
            default="", dest="parts", help=_("Pass partition list"),
            metavar="PARTLIST")
    parser.add_option_group(group)
    (options, args) = parser.parse_args()

    backend.init(console.Console(options.quiet))

    installer = Installer()

    sys_quit(installer.run(options.parts, options.mb,
            options.progress, options.ssh, dbg_flags = options.dbg))