Exemplo n.º 1
0
def run(browser: FireBrowser):
    """Given a FireBrowser object will then check to see if there are notifications
    then will go through the list and respond appropriately to them.

    Args:
        browser: FireBrowser Object"""
    midline("STATUS UPDATING")
    if browser.find_tab("Portal") is not -1:
        browser.switch_tab("Portal")
    elif not browser.tab_names:
        login.run(browser)
    else:
        login.run(browser)
    file = FileHandle("status")
    data = file.read_to_data()
    browser.remind_me_later()
    if browser.check_selector(data['notify_check']):
        write("Looking at Notifications...")
        while delete_notifications(browser, data):
            browser.click(data['notify_dropdown_click'])
        while __find_updateable_notification(browser, data):
            """Check to see if asurion or if appointment."""
            browser.click(data['lead_textarea'])
            headings = browser.get_elements_text(data['lead_type_heading'])
            if contain_list("Appointment", headings):
                browser.click(data['status_select'])
                browser.click(data['status_select_awaiting'])
                browser.send_text(data['appointment_text'], 'lead_textarea')
            elif contain_list("Asurion", headings):
                browser.send_text(data['asurion_text'], 'lead_textarea')
Exemplo n.º 2
0
def main():
    mongo_setup.global_init()
    print('Hello, welcome to the engineering shop sign in system alpha. \n')
    svc.print_day()
    # attempt to run the login code
    try:
        while True:
            case = find_user_intent()
            if case == 'admin':
                admin.run()

            elif case == 'log':
                login.run()

            else:
                print(
                    "-------------------- NOT IMPLEMENTED ----------------------"
                )
            rule = input("\n Exit? [y/n]\n")
            if rule == 'y':
                break

    # exit if user presses CrtL+C, or something goes wrong
    except (KeyboardInterrupt, SystemError, SystemExit):
        print("\n----------------Goodbye-----------------\n")
        return 0
Exemplo n.º 3
0
def user_information():
    global user_name, user_password, user_email, user_email_password, user_contacts, user_message
    login.run()
    user_name = login.to_return[0]
    user_password = login.to_return[1]
    user_email = login.to_return[2]
    user_email_password = login.to_return[3]
    user_contacts = login.to_return[4]
    user_message = login.to_return[5]
Exemplo n.º 4
0
def make_menu(root, account):
    root_menu = Menu(root)
    root.config(menu=root_menu)

    file_menu = Menu(root_menu, tearoff=False)
    # file_menu.add_command(label='Открыть...', command=do_nothing)
    open_menu = Menu(file_menu, tearoff=False)
    open_menu.add_command(
        label='Таблицы...',
        command=(lambda: db_viewer.run(TABLES, root, account)))
    open_menu.add_command(
        label='Представления...',
        command=(lambda: db_viewer.run(VIEWS, root, account)))
    file_menu.add_cascade(label='Открыть', menu=open_menu)
    file_menu.add_separator()
    file_menu.add_command(label='Настройки...', command=do_nothing)
    file_menu.add_separator()
    file_menu.add_command(label='Выход из аккаунта',
                          command=(lambda: login.run(root)))
    file_menu.add_command(label='Выход', command=root.quit)
    root_menu.add_cascade(label='Файл', menu=file_menu)

    report_menu = Menu(root_menu, tearoff=False)
    # report_names = db_helper.get_report_names()
    # print('REPORT NAMES :', report_names)
    # print('get_number_of_kilometers_traveled :', db_helper.get_number_of_kilometers_traveled(2))
    # print('get_driver_path_lengths :', db_helper.get_driver_path_lengths())
    # print('get_profit_on_period :', db_helper.get_profit_on_period((12, 1, 2015), (12, 4, 2015)))
    # print('count_costs_on_company_development :',
    #       db_helper.count_costs_on_company_development((12, 3, 2015), (13, 3, 2015)))
    # print('year_profit_statistics :', db_helper.year_profit_statistics())
    report_menu.add_command(label='Сгенерировать...',
                            command=(lambda: reports.run(root, account)))
    root_menu.add_cascade(label='Отчет', menu=report_menu)

    tools_menu = Menu(root_menu, tearoff=False)
    tools_menu.add_command(label='Поиск по соединению таблиц...',
                           command=(lambda: search.run(root, account)))
    if account.is_admin():
        tools_menu.add_command(
            label='SQL запрос к базе данных...',
            command=(lambda: raw_query.make_raw_query(root)))
    tools_menu.add_separator()
    tools_menu.add_command(label='Статистика', command=(lambda: do_nothing()))
    root_menu.add_cascade(label='Инструменты', menu=tools_menu)

    help_menu = Menu(root_menu, tearoff=False)
    help_menu.add_command(label='Просмотреть справку')
    help_menu.add_separator()
    help_menu.add_command(label='О программе')
    root_menu.add_cascade(label='Справка', menu=help_menu)
Exemplo n.º 5
0
import pyprint
import login
from parts import Parts
from time import sleep
from browser import FireBrowser
from file_handler import FileHandle
from item_list_creator import get_to_items

pyprint.topline("WELCOME")
browser = FireBrowser()
login.run(browser)
part_list = get_to_items(browser)
part_list.save()
browser.close()
"""
re_list = fbrow.get_elements("button.show")
fbrow.click(re_list[1])
fbrow.click(re_list[0])
if fbrow.check_selector(".badge"):
    noti_list = ['New Asurion Claim Added']
    dele_noti_list = ['Submitted', 'Received']
    if fbrow.check_selector(".badge"):
        fbrow.click("li.dropdown:nth-child(3)")
        for el in fbrow.get_elements(".msg"):
            pyprint.write("Text:", el.text)
            if el.text in noti_list:
                fbrow.click(el)
fbrow.click("div.ng-pristine")
fbrow.send_text("We set the part aside and are ready for you to come in at your earliest convenience."
                , "div.ng-pristine")
Exemplo n.º 6
0
def make_toolbar(root, account):
    global toolbar

    toolbar = Frame(root)
    toolbar.pack(side=TOP, fill=X)
    toolbar.config(padx=5, pady=3)
    toolbar.config(bg='#CCF')  # FFA

    clear_main_frame_button = ToolbarButton(toolbar,
                                            text='Очистить main_frame')
    # clear_main_frame_button.pack(side=LEFT, fill=Y)
    clear_main_frame_button.config(
        command=(lambda: clear_main_frame(root, account)))

    open_table_button = ToolbarButton(toolbar, text='Таблицы')
    open_table_button.pack(side=LEFT, fill=Y)
    open_table_button.config(
        command=(lambda: db_viewer.run(TABLES, root, account)))

    open_view_button = ToolbarButton(toolbar, text='Представления')
    open_view_button.pack(side=LEFT, fill=Y)
    open_view_button.config(command=(lambda: db_viewer.run(
        VIEWS,
        root,
        account,
    )))

    if account.is_admin():
        make_row_query_button = ToolbarButton(
            toolbar, text='SQL запрос к базе данных...')
        make_row_query_button.pack(side=LEFT, fill=Y)
        make_row_query_button.config(
            command=(lambda: raw_query.make_raw_query(root)))

    make_report_button = ToolbarButton(toolbar, text='Отчеты')
    make_report_button.pack(side=LEFT, fill=Y)
    make_report_button.config(command=(lambda: reports.run(root, account)))

    make_report_button = ToolbarButton(toolbar,
                                       text='Поиск по соединению таблиц')
    make_report_button.pack(side=LEFT, fill=Y)
    make_report_button.config(command=(lambda: search.run(root, account)))

    logout_button = ToolbarButton(toolbar)
    logout_image_path = '../TransportationsDBInterface/resourses/logout2.png'
    logout_image = PhotoImage(file=logout_image_path)
    logout_button.config(image=logout_image, bg='#CCF', relief=FLAT)
    logout_button.image = logout_image
    logout_button.config(width=50, height=50)
    logout_button.pack(side=RIGHT)
    logout_button.config(command=(lambda: login.run(root)))
    logout_button.config(activebackground='#CCF', bd=0)

    preferencies_button = ToolbarButton(toolbar, text='Настройки')
    blue_referencies_path = '../TransportationsDBInterface/resourses/blue_preferencies2.png'
    blue_referencies_image = PhotoImage(file=blue_referencies_path)
    preferencies_button.config(image=blue_referencies_image,
                               bg='#CCF',
                               relief=FLAT)  # bg='#CCF'
    preferencies_button.image = blue_referencies_image
    preferencies_button.pack(side=RIGHT, fill=Y)
    preferencies_button.config(activebackground='#CCF', bd=0)

    search_button = ToolbarButton(toolbar)
    lens_image_path = '../TransportationsDBInterface/resourses/blue_lens.png'
    lens_image = PhotoImage(file=lens_image_path)
    search_button.config(
        image=lens_image, bg='#CCF',
        relief=FLAT)  # relief ::= FLAT, SUNKEN, RAISED, GROOVE, SOLID, RIDGE
    search_button.image = lens_image
    search_button.config(width=50, height=50)
    search_button.pack(side=RIGHT)
    # search_button.bind('<ButtonPress>', lambda event: search_button.config(bg='#CCF'))
    search_button.config(activebackground='#CCF', bd=0)
Exemplo n.º 7
0
from login import run
# import sys
# sys.path.append(r"E:\WorkNote\note\selenium_")
# from login import run

if __name__ == '__main__':
    run()
Exemplo n.º 8
0
import login

login.run()
Exemplo n.º 9
0
            return False
        else:
            input_error()
        return True
    elif operate == '3':
        return False
    else:
        input_error()
    return True


#####按步骤调取video执行函数
def video(num):
    title = get_video_url(index=int(num))
    get_video_audio_size(title)
    sprint(0, 31, 0,
           '视频总大小:{0}b\n'.format(setting.video_langth + setting.audio_langth))
    dispatch_video(title)
    write_video_audio(title)
    video_deal(title)


if __name__ == '__main__':
    setting.cookie = login.run()
    name = sinput(0, 31, 0, '输入关键词>>>>>:')
    serach_video(name=name)
    while True:
        tag = common_func()
        if not tag: break
        serach_video(page=setting.current_page, name=name)
Exemplo n.º 10
0
root = tix.Tk()

root.state('zoomed')
root.title(ROOT_TITLE)
root.minsize(width=1000, height=500)

# root.protocol('WM_ICONIFY_WINDOW', lambda: None)

# root.maxsize(width=1000, height=1000)
# root.config(bg='#000')

root.resizable(width=True, height=True)

# set_styles()
set_preferencies()
login.run(root)

#b = Button(root, text='BBUBUBT')
#b.pack()
# print(root.cget('b'))
# root.attributes('-alpha', 0.5)
# root.attributes('-transparentcolor', '#FFF')
# root.attributes('-fullscreen', 1)
# root.attributes('-toolwindow',1)
# print(root.attributes())

root.mainloop()

# def notdone():
#    showerror('Not implemented', 'Not yet available')
Exemplo n.º 11
0
def main():
    #dosomething
    Url = login.run()
    getGradePage.run(Url)
    getPlanPage.run(Url)
Exemplo n.º 12
0
def login_page():
  if request.method == 'GET':
    return login.run()
  else:
    return login.check(request.form['account'], request.form['password'])