-
Notifications
You must be signed in to change notification settings - Fork 1
* Added log text box to see what has happened #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
** This will show what is logged to the wcexport.log file. * Made the URL text wider * Added options to specify URL and username on commandline so re-running is easier ** ./wcexport.py [URL] [username] * If the user's login session expires, the next request will attempt to log in and resume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds new UI elements including a log text area along with support for widening the URL text box, and introduces command-line arguments for easier re-running.
- Added command-line argument parsing for URL and username in wcexport.py.
- Enhanced the UI in common.py with a scrolling log area, queue-based task processing, and improved export threading and progress updates.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
wcexport.py | Adds argument parsing and initializes the UI with provided command-line arguments. |
common.py | Introduces a logging text area, refines widget layouts with sticky options, and improves multi-threading for export operations. |
Using a mutable default argument (data={}) can lead to unexpected behavior. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the WebChart Export Utility by adding a log text box, improving UI responsiveness, and allowing URL/username specification directly from the command line.
- Added command-line argument parsing in wcexport.py
- Improved the main window layout and logging mechanism via a new log text box in common.py
- Added threading and a task queue to safely update the GUI from background threads during export
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
wcexport.py | Integrates argparse for command-line URL and username input |
common.py | Updates GUI layout with sticky alignment, adds a log area, and improves threading with a queue for task handling during export |
common.py
Outdated
self.queue.put(lambda: update_progress(idx, current, maxprogress)) | ||
try: | ||
if self.fullExport: | ||
getChart(current['pat_id'], current['filename']) | ||
self.queue.put(lambda: self.log(str(current['urls']))) | ||
getExternalUrls(current['filename'], current['urls']) | ||
else: | ||
downloadDocument(current['doc_id'], current['filename']) | ||
except Warning as w: | ||
self.queue.put(lambda: self.log(w)) | ||
if not tkm.askyesno(title='Warning', | ||
message='{0}\n\nDo you want to continue the export?'.format(w)): | ||
msg = 'Export Aborted Due To User Request' | ||
break | ||
except Exception as e: | ||
self.queue.put(lambda: self.log(e)) | ||
self.queue.put(lambda: tkm.showerror(title='Fatal Error', message=e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enqueueing lambda expressions inside a loop without binding the current loop variables may lead to late binding issues when the queued tasks are executed. Consider using default argument values in your lambda (e.g., lambda idx=idx, current=current, maxprogress=maxprogress: update_progress(idx, current, maxprogress)) to capture the intended values.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the WebChart Export Utility by adding a log text box for runtime diagnostics, widening the URL text box, and introducing command-line parameters for easier re-running and improved session handling.
- Added argparse support in wcexport.py for URL and username arguments.
- Enhanced the UI in common.py with a new logging area, sticky grid alignment, and a threaded export process with a UI queue.
- Introduced re-login and export cancellation logic to improve responsiveness.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
wcexport.py | Added command-line argument parsing and applied URL/username presetting in the UI. |
common.py | Updated several UI layouts (wider text fields, sticky grid layout), added a log text box and queue processing, and improved threading and export cancellation logic. |
…o, set self.schedule so the error about that not being defined would stop.
** This will show what is logged to the wcexport.log file.