joshuawprice / user-scripts Goto Github PK
View Code? Open in Web Editor NEWA collection of useful scripts I've created over time.
License: MIT License
A collection of useful scripts I've created over time.
License: MIT License
Add support for reading environment variables for uploaders with optional arguments. This will let users add api keys to environment variable for more options for them.
I think for implementing this having the environment variable be dynamically based on the name of the uploader makes sense, with a pre/postfix that's intentionally unlikely to conflict but is guessable.
When files passed as arguments are prefixed with "./" it also adds that to the final link for the asgard uploader, making the output url incorrect. Affects both the bash and python script.
Uploaders in the file should automatically be added to the parser. This will make it so adding future uploaders only requires adding a new class that inherits from the uploader base class.
My first thoughts on how to do this make me think I should check the current file/"module" and add all of the classes that are a subclass of uploader. This will also require the classes to store more information, such as the action, help, nargs, metavar and more.
If absolute and relative paths are used for the same file in the arguments, then the current deduplication code doesn't work and the file gets uploaded twice.
Add support for notifications to be sent upon command completion. Intended to be used in scripts once the item has finished uploading. The parser argument has already been added and now just needs implementing.
At the moment the parser leaves a lot to be desired with regards to consuming arguments, a few examples of which are:
./
.), and stop consuming on --
like it does already.As for implementing this I believe some of the nargs parameters will need to be removed from the add_arguments calls and the current actions to be modified. This idea came from this note in the argparse documentation:
If the nargs keyword argument is not provided, the number of arguments consumed is determined by the action. Generally this means a single command-line argument will be consumed and a single item (not a list) will be produced.
The above way is much better than the original way I thought, but I shall paste some bullet points below of my original notes in case the above fails:
- Use append/extend action on files argument
- Also have to make sure the argument to the uploader is not completely consumed, therefore would have to remove the automatic type conversions for the uploaders
- Then append/create files attr
I also thought of removing the nargs option from the files add_argument call and saving all the files to a separate location if possible.- Maybe - If argument ends in / then assume it is not a file and consume
I also think SingleAppendAction's name should be changed to something like UniqueAppendAction or UploadAction.
And lastly I think I should improve the init method in SingleAppendConstAction by using **kwargs (see argparse documentation action and Action classes
Add the metavar attribute argument to asgard and catgirls uploaders. This is to make the help output more understandable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.