コード例 #1
0
ファイル: main.py プロジェクト: adamkulpa/snake
def main():
    app = App()
    app.on_execute()
コード例 #2
0
import os
from Application import App as app, manager

if __name__ == '__main__':

    app.run(port=app.config['PORT'], debug=app.config['DEBUG'])
コード例 #3
0
from Application import Application as App

if __name__ == '__main__':
    App().run()

コード例 #4
0
from tkinter import *
from tkinter import filedialog, messagebox
from Application import App
import os

if __name__ == "__main__":
    # create the application
    root = Tk()
    root.title("qtMoJo")
    root.minsize(400, 300)
    # show an "Open" dialog box and return the path to the selected file
    playlist_path = "Jukebox Material"
    playlist_path = filedialog.askdirectory()
    if not isinstance(playlist_path, tuple):  # Avoid cancelled out case
        if os.path.exists(playlist_path):
            app = App(source=playlist_path, master=root)
            app.mainloop()
        else:
            messagebox.showerror(
                "Given Directory Invalid",
                "The given path for playlist source directory is not a valid path."
            )
    else:
        messagebox.showerror(
            "No Selected Directory Path",
            "Please select a source directory for playlists to go to.")
コード例 #5
0
ファイル: test_compared.py プロジェクト: lh-ycx/Gayta-monkey
    checked_apks_num = len(checked_apks)
    print('total apks num:', apks_num)
    print('finished:', checked_apks_num)
    now = 1

    for apk in apks:
        if apk[-3:] != 'apk':
            continue

        if apk in checked_apks:
            continue

        print('===========================testing No.', now,
              '===========================')
        now += 1
        subject = App(apk, serial, suit)
        try:
            test_coverage(subject, suit)
        except timeout_decorator.timeout_decorator.TimeoutError as e:
            if not is_open_source:
                fout = open(
                    subject.dir + '/' + subject.package + '_coverage.txt',
                    'w+')
                fout.write(subject.package + ' ' + str(subject.activity_tot) +
                           ' ' + str(subject.method_tot) + '\n')
                fout.close()
            print('timeout')

        os.system('adb -s ' + subject.serial + ' uninstall ' + subject.package)
        f = open(apkdir + '/finished_' + suit + '.txt', 'a+')
        f.write(subject.package + '\n')
コード例 #6
0
                if count == 12:
                    if not is_open_source:
                        fk = open(
                            subject.dir + '/' + subject.package + '_' +
                            subject.suit + '_time_coverage.txt', 'a+')
                        record_time = datetime.datetime.now().strftime(
                            '%m/%d-%H:%M:%S')
                        fk.write(record_time + ' ' +
                                 str(subject.activity_tot) + '\n')
                        fk.close()
                    if not current_instrument.is_alive():
                        print('instrument stop')
                        raise timeout_decorator.timeout_decorator.TimeoutError(
                            'timeout')
                    count = 0
        except timeout_decorator.timeout_decorator.TimeoutError as e:
            current_instrument.stop()
            raise timeout_decorator.timeout_decorator.TimeoutError('timeout')


if __name__ == '__main__':
    subject = App('com.evancharlton.mileage.apk', 'ZX1G223KRJ', 'monkey')
    os.system('adb install ' + apk_dir + '/com.evancharlton.mileage.apk')
    #Check_app.check_app_running('akai.floatView.op.luffy.apk', 'monkey')
    #Check_app.check_app_running(subject, 'droidbot')
    #Check_app.check_app_running(subject, 'stoat')
    #Check_app.check_app_running(subject, 'sapienz')
    #App.getLaunchActivity('akai.floatView.op.luffy.apk')
    Check_app.calculate_coverage(subject, 'monkey')
    pass
コード例 #7
0
from Application import App

if __name__ == '__main__':
    # Start the app
    App().create_app()
コード例 #8
0
            if (content):
                finished = json.loads(content)
                f.close()
                finished = finished['FINISHED']

        # run
        for task in tasks:
            if task in finished:
                logger.info("[spider mode] skip finished task:(PACKAGE:" +
                            task['PACKAGE'] + ",TARGET_ACTIVITY:" +
                            task['TARGET_ACTIVITY'] + ')')
                continue
            logger.info("[spider mode] start task:(PACKAGE:" +
                        task['PACKAGE'] + ",TARGET_ACTIVITY:" +
                        task['TARGET_ACTIVITY'] + ')')
            subject = App(task['PACKAGE'] + '.apk', serial, suit)
            crawl(subject, task['TARGET_ACTIVITY'])

    else:
        if with_server:
            while (True):
                # download apks
                transport_util.download_app()

                # build task
                output = os.popen('ls ' + apk_dir + ' -Sr').readlines()
                tasks = [i.strip() for i in output]
                if not tasks:
                    error_msg('can not find apk files in dir: ' + apk_dir)

                # build finished
コード例 #9
0
ファイル: main.py プロジェクト: zltningx/music-player
# -*- coding: utf-8 -*-

import asyncio
import sys
from PyQt5.QtWidgets import QApplication
from quamash import QEventLoop
from Application import App
from plugins.local_oo.OO import OO


if __name__ == '__main__':

    q_app = QApplication(sys.argv)
    q_app.setQuitOnLastWindowClosed(True)
    q_app.setApplicationName('神奇的播放器啊')

    app_event_loop = QEventLoop(q_app)
    asyncio.set_event_loop(app_event_loop)
    app = App()
    app.show()
    oo = OO(app)

    app_event_loop.run_forever()
    sys.exit(0)
コード例 #10
0
except ImportError:
    import tkinter.ttk as ttk
    py3 = 1


def set_Tk_var():
    # These are Tk variables used passed to Tkinter and must be
    # defined before the widgets using them are created.
    global che51
    che51 = StringVar()


def init(top, gui, *args, **kwargs):
    global w, top_level, root
    w = gui
    top_level = top
    root = top


def destroy_window():
    # Function which closes the window.
    global top_level
    top_level.destroy()
    top_level = None


if __name__ == '__main__':
    from Application import App

    App.gui()
コード例 #11
0
__author__ = '804'

from Application import App
import sys

if __name__ == "__main__":
    app = App(sys.argv)
    sys.exit(app.exec_())