nimaid / LPHK

A Novation Launchpad Macro Scripting System.
GNU General Public License v3.0
344 stars 69 forks source link

Added an argument which allows a user to specify which file to load on startup #66

Closed kartikay-bagla closed 3 years ago

kartikay-bagla commented 4 years ago

I used argparse to replace sys.argv for the debug flag -d and added another flag -l --load in which you can specify any file inside the user_layouts folder to load on startup.

This fixes #65.

kartikay-bagla commented 4 years ago

I've added the checks for absolute paths as well a check to see whether the file actually exists or not and display a pop-up if the file is not found.

decheine commented 4 years ago

Wow what timing! I've been doing some personal work on that feature for my own version and have it working in my IDE PyCharm. I implemented a config file to determine default layout and possibly other things in the future.

kartikay-bagla commented 4 years ago

Wow what timing! I've been doing some personal work on that feature for my own version and have it working in my IDE PyCharm. I implemented a config file to determine default layout and possibly other things in the future.

That actually sounds even better than the hack that I made for this. @duncte123 what do you think? Should we go the config route or the command line argument route.

decheine commented 4 years ago

Wow what timing! I've been doing some personal work on that feature for my own version and have it working in my IDE PyCharm. I implemented a config file to determine default layout and possibly other things in the future.

That actually sounds even better than the hack that I made for this. @duncte123 what do you think? Should we go the config route or the command line argument route.

Nice, I'm thinking I might look into other quality of life features and new packages and whatnot, thats what I love about python.

duncte123 commented 4 years ago

I would go the CLI argument route

nimaid commented 4 years ago

Wow what timing! I've been doing some personal work on that feature for my own version and have it working in my IDE PyCharm. I implemented a config file to determine default layout and possibly other things in the future.

That actually sounds even better than the hack that I made for this. @duncte123 what do you think? Should we go the config route or the command line argument route.

I agree with @kartikay-bagla, a config file is the better route and the way I planned to implement it before I started focusing on other projects. The plan was to have a "Settings" menu that would allow you to change various things such as default layout, auto-connect override, force launchpad model, etc. This would save to a JSON formatted LPHK.config file in the root directory, which is easily modified by hand or other programs.

I like the change to argparse for the debug mode, and I'm not opposed to a --load CLI flag. However, I do think a config file is the way to go for a "default layout", and the --load argument can act as an override to that. In the meantime, I will look over this PR soon.

nimaid commented 4 years ago

One change I definitely think would be good is to use --layout instead of --load, as it is more clear. Also, a short flag -l would be nice.

tsurshor commented 4 years ago

any progress on the feature? really want to use it

kartikay-bagla commented 4 years ago

@tsurshor you can find a version with this on my GitHub. Though you'll have to run it with python since I don't know how to compile. @duncte123 hasn't gotten back to me yet after I made the changes.

duncte123 commented 4 years ago

I might be able to look at it this weekend, uni eats all my free time

tsurshor commented 3 years ago

@kartikay-bagla how would u run it with python? which file should i run?

duncte123 commented 3 years ago

this was added in #60