state.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. from Naked.settings import debug as DEBUG_FLAG
  4. from Naked.toolshed.system import cwd
  5. import Naked.toolshed.python as py
  6. import sys
  7. import os
  8. import datetime
  9. class StateObject:
  10. def __init__(self):
  11. now = datetime.datetime.now()
  12. self.py2 = py.is_py2() #truth test Python 2 interpreter
  13. self.py3 = py.is_py3() #truth test Python 3 interpreter
  14. self.py_major = py.py_major_version() #Python major version
  15. self.py_minor = py.py_minor_version() #Python minor version
  16. self.py_patch = py.py_patch_version() #Python patch version
  17. self.os = sys.platform #user operating system
  18. self.cwd = cwd() #current (present) working directory
  19. self.parent_dir = os.pardir
  20. self.default_path = os.defpath
  21. self.user_path = os.path.expanduser("~")
  22. self.string_encoding = sys.getdefaultencoding()
  23. self.file_encoding = sys.getfilesystemencoding()
  24. self.hour = now.hour
  25. self.min = now.minute
  26. self.year = now.year
  27. self.day = now.day
  28. self.month = now.month
  29. self.second = now.second
  30. if __name__ == '__main__':
  31. pass