TotallyNotChase / glitch-this

:camera: Glitchify images and GIF - with highly customizable options!
MIT License
1.76k stars 63 forks source link

glitch_this.py uses global variables and has no main() function #6

Closed KopfKrieg closed 4 years ago

KopfKrieg commented 4 years ago

Just wanted to let you know that your glitch_this.py in your root folder doesn't have a main()-function and uses global variables. Personally I'd rewrite this using a main() function and move everything from global to local variables (which is, I have to admit, not that easy here. Creating a class might be a solution here).

And thank you for that project! It's really cool :)

TotallyNotChase commented 4 years ago

That is a bit intentional yes, I think it's fine without a main function and global vars since it's a script.

The whole reason I made the variables global in the script is for the ease of use. I do care about enclosing them however, which is why they are enclosed in the library :)

retr0h commented 4 years ago

Out of curiosity, why isn't this package shipping with an executable? Pip installing this package then having to python ./3.7.6/lib/python3.7/site-packages/glitch_this/glitch_this.py is somewhat convoluted.

tomplex commented 4 years ago

@TotallyNotChase why doesn't the script use the library? The code is basically copied and pasted when it could just use the class in the library, thereby avoiding the items raised in this issue.

TotallyNotChase commented 4 years ago

I originally did not add the library since the script was supposed to be standalone, as I didn't have the library on pypi. But now I do and I might consider adding the library in the requirements.

TotallyNotChase commented 4 years ago

@tomplex @retr0h @KopfKrieg All caught up! the commandline script now comes with the library and is all cleaned up :)