20 Commits (master)

Author SHA1 Message Date
Darksider3 8008fa36b9 General overhaul, better messages, ordered imports etc 5 years ago
Darksider3 8d4d2038d3 Typing support and sqlite3.Row!
Typing will be handy in further development, as well will i settle down
to sqlite3.Row. Fetchall() returns now a list(grr) with
dict-imitating/sumating objects, which you can call keys() on and will
return them, what we now already use for Backups, which comes handy.

Also Typing gives the ability to let the code even more documentate
itself. It's planned to use all over the place but i've to read myself
into it yet more to get started on that one.
It's a step in the right direction!
5 years ago
Darksider3 0eeafa626e Documentation work all over the place
Renamed also some paramters
5 years ago
Darksider3 65c7bb6b3f Move argparser into mains function body 5 years ago
Darksider3 a17d0ed30f ListUsers: UAP and APP => Unapproved and Approved replaced 5 years ago
Darksider3 389b614de9 Revert "ListUsers: UAP and APP renamed, function updates /home/users.txt"
This reverts commit 84cc83db3c.
5 years ago
Darksider3 84cc83db3c ListUsers: UAP and APP renamed, function updates /home/users.txt
On every register() call the System rewrites the /home/users.txt to
reflect currently active users. Will fall apart when something
unexpected happened, but that's @helix responsibility.
5 years ago
Darksider3 24eee6e84e Shebang/env for script execution 5 years ago
Darksider3 710ceacd7c Breaking up the code smell regarding the CFG.py!
It began smelling already but having some duplicate code across the
interfaces is still better than having all of it all over the place.

It enables to write specific flags which are nice to have. For example,
Import.py requires the --Import flag because it WANTS the user to read
the whole Help before it acts actually as an importer. When the user
supplies something they should know what's currently happening.

Also removes the hardcoded dependency on lib.CFG-Calls from most calls
which was already embarassingly present. Introduced some db and
cfg-variables which doesnt clutter anything but suck much less.

In future we provide a set of default arguments and a bare minimum -
config_ui as the bare minimum, default as the full blown storm.

This is rather big because it also patches several other smells
including a bug where a user from the db wouldnt be reported as existent
5 years ago
Darksider3 934b6bf75a Factor out 'as CFG' 5 years ago
Darksider3 b0856b558e Move import related stuff to the Import.py script.
and delete occurences in Import It is much tidier to look at and
doesn't clutter the Script. Is even a whole seperate task
so it does make no sense to call it in Backup when i think about it.
5 years ago
Darksider3 283143104d Actually we allow currently strange things, this fixes it on the usernames 5 years ago
Darksider3 0c1f7ea252 Validate even imported files and users
Created a new file for the validation functions, should be soon(TM) used too
in the userapplication-script but dont hurry
5 years ago
Darksider3 4760e35fda it's freakin stupid to import IDs. Nothing depends on them. Ignore them. 5 years ago
Darksider3 c1488f6164 Return True on success 5 years ago
Darksider3 2202af7826 Introduce imports, which comes with a new flag(--Import)
--Import depends on --file being present pointing to a valid CSV-file
that contains unique users with id's. When a user already exists
with his id, the script will fail.
It is also Backup.py-only which is reflected in the help message
5 years ago
Darksider3 43c7636920 Make PEP8 finally happy 5 years ago
Darksider3 a6d63fee42 PEP8: One Import per line... -.-
Add TODO statements and foremost return False on error. Missed that
5 years ago
Darksider3 2afb4c79a2 Implements a backup to csv. Uses StringIO because it has an own writer()
method, which is pretty nice to have when csv.writer() want's that on its
passed variable.

Also respects every flag yet introduced(-c, -f, -a, -u) and reuses the code
already written in ListUsers.py. It could be very nice to bring that code
into lib/ because it is probably needed way more often
5 years ago
Darksider3 4134e3cc2e introduces -f/--file, which outputs or takes from a file(conditional to the current program) 5 years ago