cstate.pyx 1.1 KB

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