__init__.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. appname = "Pwman3"
  22. version = "0.4.4-dev"
  23. website = "http://github.com/pwman3/pwman3"
  24. author = "Oz Nahum"
  25. authoremail = "nahumoz@gmail.com"
  26. description = "Pwman -a command line password management application."
  27. keywords = "password management sqlite crypto"
  28. import os
  29. def which(cmd):
  30. _, cmdname = os.path.split(cmd)
  31. for path in os.environ["PATH"].split(os.pathsep):
  32. cmd = os.path.join(path, cmdname)
  33. if os.path.isfile(cmd) and os.access(cmd, os.X_OK):
  34. return cmd
  35. return None
  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. }