-
Notifications
You must be signed in to change notification settings - Fork 58
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
Auto fill the selected folder's name in the Name/AppID field #64
Conversation
@@ -71,6 +72,7 @@ def DoRequest(self): | |||
def select_folder(): | |||
global folder_path | |||
folder_path = filedialog.askdirectory() | |||
folder_name = re.sub(r".*(\\|/)?([^\\]+)(\\|/)", "", folder_path) |
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.
Using os.path.basename
would probably be better
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.
True, regex was more intuitive for me tho
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.
Nice regex though haha, I hope it was found only or ChatGPT x)
They're always so hard to make
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.
Nah, i made it together with https://regex101.com
They're alright when u get used to it
@@ -84,8 +86,12 @@ def select_folder(): | |||
selectedFolderLabel.config(text=f"Selected folder:\n{folder_path}") | |||
selectedFolderLabel.pack() | |||
frameGame2.pack() | |||
gameNameEntry.delete(0, last=len(gameNameEntry.get())) |
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.
tk.END
would probably fit better :)
gameNameEntry.delete(0, last=len(gameNameEntry.get())) | ||
gameNameEntry.insert(0, folder_name) |
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.
Duplicate? Doesn't seem required
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.
Yes, you have two cases one of which when the folder already got selected. If the duplicate doesn‘t stay, it wouldn‘t auto-fill in that case
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.
Not true? It's not an if else, just a simple if. The delete & insert functions are called BEFORE the IF, so that wouldn't matter
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.
oh shoot true, yeah than nevermind probably
wouldn't the whole if clause be useless in this case?
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.
The IF close is meant to re-display the whole "Selected crack:" section if you decide to change the selected directory AFTER doing the App search (select a folder, search for the app, then unselect/change folder); at least from what I remember
Thanks for your PR, after some research, I found a better solution than regex for this job I do appreciate the time you took for this. Since I want to change the code a bit and there's a merge conflict, I'll just close this PR and commit the changes. You'll be credited of course :) I hope you don't mind. I know PRs are good for stats & all |
I couldn't care less for stats hahah, i just want to contribute since this tool is really awesome |
Cool :) - thanks ❤️ Currently working on v2.1.0 with an opt-in autoupdater & minor improvements |
Added functionality mentionend in #63
PS: might've messed up commits, not sure