Ejemplo n.º 1
0
def at_start_open_file_from_settings_if_option_is_selected():
    check_option = st.load_settings(1, st.set_file_name)[3]

    # If Ture open newest file from selected in settings default server row 2
    if check_option:
        # selected_server_id load from settings.csv row = 2 int_value witch represent id server
        # selected_server_id return 2 values
        selected_server_id = st.load_settings(1, st.set_file_name)[2]

        natural_number_server_id = int(selected_server_id)

        file_tuple = sfd.newest_file(
            sfd.get_files_by_id(natural_number_server_id))

        newest_file = file_tuple[1]

        join_path = os.path.join(sfd.make_path(natural_number_server_id),
                                 newest_file[3])
        print(join_path)

        root.filename = (join_path)
        my_json = root.filename

        print('Load selected server from settings ' + newest_file[3])

        root.opened_json_object = raf.AhFile(my_json)
        root.opened_json_object.create_dependency()
Ejemplo n.º 2
0
def open_by_take_from_list_json():
    root.filename = filedialog.askopenfilename(
        initialdir=(os.getcwd() + '\data\Json'),
        title="Select a File",
        filetypes=(("json files", "*.json"), ("all files", "*.*")))
    my_json = root.filename
    print(my_json)
    root.opened_json_object = raf.AhFile(my_json)
    root.opened_json_object.create_dependency()
    print(root.opened_json_object)
    root.id_opened_file = 0
def open_by_take_from_list_json():
    root.filename = filedialog.askopenfilename(
        initialdir="E:/WoWprogram",
        title="Select a File",
        filetypes=(("json files", "*.json"), ("all files", "*.*")))

    global my_json
    my_json = root.filename
    print(my_json)

    root.opened_json_object = raf.AhFile(my_json)
    root.opened_json_object.create_dependency()
def testing():
    opened_json_object = raf.AhFile('test_file.json')
    opened_json_object.create_dependency()
    itemsObjectList = opened_json_object.serch_items('Anchor Weed')
    itemsObjectList.list_items.sort(key=raf.sort_by_price)
    items_object = itemsgui.ItemBox(itemsObjectList.list_items)

    id_item_from_serch = items_object.item_list[0]['item']['id']
    item_name = itemsObjectList.item_name

    avg_price = average_price(itemsObjectList)

    return itemsObjectList, item_name, id_item_from_serch, avg_price
Ejemplo n.º 5
0
def open_json():

    root.filename = filedialog.askopenfilename(
        initialdir="F:/WoWAuctionApi",
        title="Select a File",
        filetypes=(("json files", "*.json"), ("all files", "*.*")))

    global my_json
    my_json = root.filename
    print(my_json)

    root.opened_json_object = raf.AhFile(my_json)

    root.opened_json_object.create_dependency()
Ejemplo n.º 6
0
 def create_object_raf(self, path):
     created_object = raf.AhFile(path)
     return created_object