I haven't tested this but I have a question. Why three files? You could put everything inside archupdate and put the corresponding shebang on top like #! /usr/bin/env python3.
You should maybe look into setuptools and create a Makefile with a install and uninstall subcommand. This may be over the top but it makes installing and uninstalling way easier.
And, by the sake of god, please don't use camelCase. This may be personal preference but it is so hard to read. PEP8.
You're correct that snake case is proper Python style (and its what I use when I write python), but I personally find camel case far easier to read, particularly when the name is made up of more than 2 words. To each his own I guess
PEP8 notwithstanding, don't browbeat somebody about consistent labeling that differs from your preference. Some find underscore-laden names easier to read than mixed case. At least one other (me) finds that the extra length harms readability more than it helps by increasing the frequency of line breaks or extra-long lines in single statements.
As PEP8 indicates, the guide is about infra-project consistency and legibility. With some debate over optimal legibility, recognize that others have different tastes and move on.
The only reason to promote strict adherence to any style guide is when software is being considered for inclusion in a standard library and ought to be consistent with other parts of the library. Because most Python software will never be included in the standard library (nor should it, especially for tasks like "fetch a list of Arch Linux news"), critiques of which style is applied are most often gratuitous.
Everyone has its own preference but I think one should at least somewhat follow pythons style guide if the code is made public. I won't judge someone just because he doesn't follow PEP8. I just don't like camelCase :D
It was just a suggestion. I use a Makefile to simplify some commands. Most of the time I have at lest make clean to delete build files and make init to create a virtual environment and install all requirements.
I believe it will fail if username is different from the home folder name. That's why I usually just store files in the same dir as a script.
If you still want to use user folder, some people don't like a folder created by every software appearing in $HOME (even hidden). Unix-way would be storing temp files in .cache/software-name
30 comments
I haven't tested this but I have a question. Why three files? You could put everything inside
archupdateand put the corresponding shebang on top like#! /usr/bin/env python3.You should maybe look into setuptools and create a Makefile with a install and uninstall subcommand. This may be over the top but it makes installing and uninstalling way easier.
And, by the sake of god, please don't use camelCase. This may be personal preference but it is so hard to read. PEP8.
You're correct that snake case is proper Python style (and its what I use when I write python), but I personally find camel case far easier to read, particularly when the name is made up of more than 2 words. To each his own I guess
Snake case is way (and I mean wayyy) more grep-able than camel case though. One of the reasons why I prefer it.
PEP8 notwithstanding, don't browbeat somebody about consistent labeling that differs from your preference. Some find underscore-laden names easier to read than mixed case. At least one other (me) finds that the extra length harms readability more than it helps by increasing the frequency of line breaks or extra-long lines in single statements.
As PEP8 indicates, the guide is about infra-project consistency and legibility. With some debate over optimal legibility, recognize that others have different tastes and move on.
The only reason to promote strict adherence to any style guide is when software is being considered for inclusion in a standard library and ought to be consistent with other parts of the library. Because most Python software will never be included in the standard library (nor should it, especially for tasks like "fetch a list of Arch Linux news"), critiques of which style is applied are most often gratuitous.
Everyone has its own preference but I think one should at least somewhat follow pythons style guide if the code is made public. I won't judge someone just because he doesn't follow PEP8. I just don't like camelCase :D
Yeah, one should follow the recommendations. I use both python and java for different things and of course I use camelCase in java.
Thanks for the recommendations.
I used camel case just because it comes naturally to me, but I might do an update to make it more standard.
I'm gonna look into how to make it installable at some point, so thank you for for those recs too
I separated the files out just cos for me it was easier to read/update - i like separation for separate things
Keep cameling!
Whatever people say, camelCasing is the best. GO HOME SNAKE! /camelGang
๐ snek go psss
A makefile?! Why not just a standard pypi package?
It was just a suggestion. I use a Makefile to simplify some commands. Most of the time I have at lest
make cleanto delete build files andmake initto create a virtual environment and install all requirements.That's really interesting, I didn't know that about python. I don't find camel case hard to read, but I will certainly keep this in mind!
I've now updated it to use snake case rather than camel case :)
This is pretty good but I also think this might be covered via pacmatic?
Also this https://github.com/bulletmark/arch-upgrade
Also this https://aur.archlinux.org/packages/informant/
Everybody's doing it, maybe it should be a codegolf challenge?
yay -PwSome concerns:
I believe it will fail if username is different from the home folder name. That's why I usually just store files in the same dir as a script.
If you still want to use user folder, some people don't like a folder created by every software appearing in $HOME (even hidden). Unix-way would be storing temp files in
.cache/software-nameFirst suggestion is actually a good suggestion I hadn't thought of, I'll look into it.
Thanks for bringing .cache to my attention, that's a great idea thank you
Why it always has to be a python.. :-(
Cos it's super quick to write, that's the only reason hehe
related: https://www.reddit.com/r/archlinux/comments/g6lxct/getting_the_latest_arch_linux_news_entry/fobhzrt/
You and everyone else. Nice job though :)