Opened 13 years ago
Last modified 13 years ago
#298 closed defect (FIXED)
./bin/gmg adduser should take password, email as arguments, and prompt if not provided
Reported by: | Christopher Allan Webber | Owned by: | Manolinux aka Mu |
---|---|---|---|
Priority: | minor | Milestone: | 0.2.0 |
Component: | programming | Keywords: | |
Cc: | Parent Tickets: |
Description
Instead of being sequential arguments, email and password (or at least password) should be --keyword arguments. If not provided, we should prompt the user for them (and obscure the password as being entered). This is a fairly easy and entry level task.
Change History (5)
comment:2 by , 13 years ago
Status: | In Progress → Feedback |
---|
Done. Repo: [https://gitorious.org/\ :sub:`manolinux/mediagoblin/manolinuxs-mediagoblin](https://gitorious.org/`\ manolinux/mediagoblin/manolinuxs-mediagoblin) Branch: 645\_gmg\_adduser\_prompt Notes: - I created a function in ``utils.py`` '``prompt_if_not_set``' (I don't know if it would be the correct location). - I used ``raw_input`` for clear text and ``getpass.getpass`` for passwords. - Maybe, I could make more checks on input (empty username, lengths, and so).
comment:3 by , 13 years ago
Status: | Feedback → Closed |
---|
Merged! Thanks so much :) BTW, I made a few adjustments: `https://gitorious.org/mediagoblin/mediagoblin/commit/bbac7663f4b05430592ac5d39f056029dc11db92 <https://gitorious.org/mediagoblin/mediagoblin/commit/bbac7663f4b05430592ac5d39f056029dc11db92>`_ FYI for in the future: - It would be helpful to make your code compliant to PEP-8. It really helps keep code consistent and thus more readable: `http://www.python.org/dev/peps/pep-0008/ <http://www.python.org/dev/peps/pep-0008/>`_ - Also, not a big deal, but I saw you did None.. I generally find that if you're doing a comparison to None rather than to False, maybe you mean "is None"... "is None" will make sure it's None, " None" is the same basically as "== False" iirc. Could be wrong though. - Lastly, if you do string operations, best to do stuff like foo + u"bleh" instead of :: foo + "bleh" This just helps us avoid some unicode decoding issues :) Thanks much! Great work :)
comment:4 by , 13 years ago
Great, thanks. I'm new to python, so I will take your advices in much consideration :)
Note:
See TracTickets
for help on using tickets.