__init__.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #============================================================================
  2. # This file is part of Pwman3.
  3. #
  4. # Pwman3 is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License, version 2
  6. # as published by the Free Software Foundation;
  7. #
  8. # Pwman3 is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with Pwman3; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. #============================================================================
  17. # Copyright (C) 2012 Oz Nahum <nahumoz@gmail.com>
  18. #============================================================================
  19. # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net>
  20. #============================================================================
  21. import os
  22. import pkg_resources
  23. appname = "Pwman3"
  24. version = pkg_resources.get_distribution('pwman3').version
  25. website = "http://github.com/pwman3/pwman3"
  26. author = "Oz Nahum"
  27. authoremail = "nahumoz@gmail.com"
  28. description = "Pwman -a command line password management application."
  29. keywords = "password management sqlite crypto"
  30. def which(cmd):
  31. _, cmdname = os.path.split(cmd)
  32. for path in os.environ["PATH"].split(os.pathsep):
  33. cmd = os.path.join(path, cmdname)
  34. if os.path.isfile(cmd) and os.access(cmd, os.X_OK): # pragma: no cover
  35. return cmd
  36. config_dir = os.path.expanduser("~/.pwman")
  37. default_config = {'Global': {'umask': '0100', 'colors': 'yes',
  38. 'cls_timeout': '5'
  39. },
  40. 'Database': {'type': 'SQLite',
  41. 'filename': os.path.join(config_dir,
  42. "pwman.db")},
  43. 'Encryption': {'algorithm': 'AES'},
  44. 'Readline': {'history': os.path.join(config_dir,
  45. "history")}
  46. }