예제 #1
0
def main():
    settings.load_settings()
    date = datetime.datetime.now()
    str_date = str(date.year) + "-" + str(date.month)
    make_folders("saved/")
    make_folders("saved/localcache/")
    make_folders("saved/sqlite/")
    make_folders("saved/players/cache/")
    make_folders("saved/players/json/" + str_date + "/")
    make_folders("saved/players/cache/" + str_date + "/")
    make_folders("saved/teams/")
    make_folders("saved/teams/history/json/" + str_date + "/")
    make_folders("saved/teams/history/cache/")
    make_folders("saved/teams/specific/cache/")
    make_folders("saved/teams/specific/json/" + str_date + "/")

    bigWord()

    parser = argparse.ArgumentParser(
        description=
        'Find out the information of anything in the Basketball world')
    parser.add_argument(
        'search',
        nargs='*',
        help=
        "Enter the value that you wish to search. Without any flags it will search all of the possible endpoints"
    )
    parser.add_argument('-p', nargs='*', help='Player')
    parser.add_argument('-t', nargs='*', help='Team')
    parser.add_argument('-c', action='store_true', help='Compare'),
    parser.add_argument(
        '-p2',
        nargs='*',
        help=
        'Second Player (Only use with the -c flag).  Example: -p Donovan Mitchell -p2 Kyrie Irving -c'
    )

    args = parser.parse_args()
    name_inp = ' '.join(args.search)

    if name_inp:
        search_through_both(name_inp)
    elif args.p and args.p2:
        do_compare(args.p, args.p2)
    elif args.p:
        search_for_player(' '.join(args.p))
    elif args.t:
        search_for_team(' '.join(args.t))
    elif args.c:
        do_compare(None, None)
    else:
        mainmenu()
예제 #2
0
def initialize_app():
    load_settings()
    appctxt = ApplicationContext()
    window = MainWindow()

    QtGui.QFontDatabase.addApplicationFont(":/fontawesome.ttf")

    # Load stylesheet
    font_family = "Roboto, Segoe UI, Arial"
    font_size = "12pt"
    if SETTINGS["editor"]["font-family"]:
        font_family = SETTINGS["editor"]["font-family"]
    if SETTINGS["editor"]["font-size"]:
        font_size = SETTINGS["editor"]["font-size"] + "pt"

    stylesheet = ("""
* {
    font-family: """ + font_family + """;
    font-size: """ + font_size + """;
}
""")

    old_dir = os.getcwd()
    os.chdir(os.path.dirname(os.path.abspath(__file__)))
    with open("../qss/base.qss", "r") as fh:
        stylesheet += fh.read()

    with open("../qss/" + SETTINGS["editor"]["theme"] + ".qss", "r") as fh:
        stylesheet += fh.read()
    os.chdir(old_dir)

    window.setStyleSheet(stylesheet)
    window.resize(1200, 800)
    window.show()
    window.set_info_message(
        "Hello welcome to RPA Tomorrow! Start by creating your " +
        "first automation task by writing something at the top of the window.")
    return appctxt, window
import sys

sys.path.append(".")
sys.path.append("..")

from lib import Error  # noqa: E402
from lib.selector.selector import ModuleSelector  # noqa: E402
from lib.settings import load_settings  # noqa: E402

load_settings()
n = ModuleSelector()

# Enable the CalDav server before running the following
try:
    text = "Reschedule meeting with John to 21:00"
    response = n.run(text)

    print(response)
except Error as err:
    print(err, file=sys.stdout)