Skip to content

Commit 70a6caa

Browse files
committed
v1.0.1 : Fix GUI version
1 parent 765062a commit 70a6caa

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

core.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
SCRIPT_NAME = 'CW Wizard'
1313

14-
VERSION = '1.0.0'
14+
VERSION = '1.0.1'
1515

1616
EXIT_ERROR_MSG = 'The Wizard encountered issue(s) please check previous logs.\n'
1717
EXIT_SUCCESS_MSG = 'The Wizard has finish is work, have a great day!\n'
@@ -90,6 +90,9 @@ def append(self, result):
9090
self.status = 'warning'
9191
self.messages = [*self.messages, *result.messages]
9292

93+
def setResult(self, element):
94+
self.result = element
95+
9396
def addResult(self, element):
9497
if not self.result:
9598
self.result = element
@@ -596,7 +599,7 @@ def build_result_page(wantlists_info, max_sellers, sellers, relevant_sellers):
596599

597600
return funct_result
598601

599-
def cardmarket_wantlist_wizard(credentials, wantlist_urls, continue_on_warning, max_sellers, articles_comment):
602+
def cardmarket_wantlist_wizard(credentials, wantlist_urls, continue_on_warning, max_sellers, articles_comment=False):
600603
funct_result = FunctResult()
601604
LOG.debug('------- Calling the Wizard...\r\n')
602605

@@ -647,7 +650,10 @@ def cardmarket_wantlist_wizard(credentials, wantlist_urls, continue_on_warning,
647650
build_result = build_result_page(wantlists_info, max_sellers, sellers, relevant_sellers)
648651
build_result.logMessages()
649652

650-
funct_result.append(populate_result)
653+
funct_result.append(build_result)
654+
result_path = build_result.getResult()
655+
if result_path != None:
656+
funct_result.setResult(result_path)
651657

652658
# Step 5: Logout from Cardmarket, simply a safety mesure.
653659
logout_result = cardmarket_log_out(session)

cw-wizard-gui.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from functools import partial
99

1010
from core import SCRIPT_NAME, VERSION, MAXIMUM_SELLERS
11-
from core import FunctResult
12-
from core import init_logger
1311
from core import create_credentials_file
1412
from core import get_credentials_from_file
1513
from core import check_credentials_validity
@@ -77,7 +75,7 @@ def create_label(parent, text, font_style, bg_color):
7775
return label
7876

7977
def create_button(parent, text, bg_color):
80-
button = tkinter.Button(parent, font=GUI_FONT_STYLES['button'], background=bg_color, highlightbackground=bg_color)
78+
button = tkinter.Button(parent, font=GUI_FONT_STYLES['button']['font'], background=GUI_FONT_STYLES['button']['background-color'], highlightbackground=bg_color, foreground=GUI_FONT_STYLES['button']['font-color'], disabledforeground=GUI_FONT_STYLES['button']['disabled-font-color'])
8179
if isinstance(text, tkinter.StringVar):
8280
button.configure(textvariable=text)
8381
else:
@@ -127,7 +125,7 @@ def _populate_font_styles():
127125
GUI_FONT_STYLES['title'] = { 'font': (font_name, 22, tkinter.font.BOLD), 'font-color': '#FFFFFF' }
128126
GUI_FONT_STYLES['description'] = { 'font': (font_name, 12), 'font-color': '#aaaaaa' }
129127
GUI_FONT_STYLES['content'] = { 'font': (font_name, 12), 'font-color': '#FFFFFF' }
130-
GUI_FONT_STYLES['button'] = { 'font': (font_name, 12), 'font-color': '#aaaaaa' }
128+
GUI_FONT_STYLES['button'] = { 'font': (font_name, 12), 'font-color': '#24201d', 'disabled-font-color': '#4a4542', 'background-color': '#feffff' }
131129

132130
def close_window(window):
133131
window.root.destroy()
@@ -275,11 +273,13 @@ def create_default_widgets(window):
275273
window.button_next = create_button(frame_buttons, window.button_next_text, window.main_bg_color)
276274
window.button_next.grid(column=1, row=0, sticky=tkinter.NE)
277275

278-
def set_window_description(window, message, is_error=False):
276+
def set_window_description(window, message, is_error=False, is_warn=False):
279277
if is_error:
280278
window.description_label.configure(foreground='red')
279+
elif is_warn:
280+
window.description_label.configure(foreground='yellow')
281281
else:
282-
window.description_label.configure(foreground= GUI_FONT_STYLES['description']['font-color'])
282+
window.description_label.configure(foreground=GUI_FONT_STYLES['description']['font-color'])
283283

284284
window.description.set(message)
285285

@@ -432,7 +432,7 @@ def window_wait_screen(window):
432432
content_label.configure(wraplength=472)
433433

434434
# Step 3: Set texts according to the current step
435-
set_window_description(window, 'Please wait until the process as finish.')
435+
set_window_description(window, 'Please wait for the process to finish.')
436436
if window.step == 'request_credentials':
437437
window.title.set('Checking credentials...')
438438
content_msg.set('The program check if we can estasblish a connection to Cardmarket using your credentials, this can takes up to 1 minute.')

0 commit comments

Comments
 (0)