# Path: PyDvi/Tools/EnumFactory.py
# def EnumFactory(cls_name, constant_names):
# 
#     """ Return an :class:`EnumMetaClass` instance, where *cls_name* is the class name and
#     *constant_names* is an iterable of constant's names.
#     """
# 
#     dict_ = {}
#     dict_['_size'] = len(constant_names)
#     for index, name in enumerate(constant_names):
#         dict_[str(name)] = index
# 
#     return EnumMetaClass(cls_name, (), dict_)
# 
# Path: PyDviGui/Tools/Math.py
# def rint(f):
#     return int(round(f))


import os
import platform
import sys
        import OpenGL.GL as GL
from PyQt4 import QtCore, QtGui
from PyDvi.Tools.EnumFactory import EnumFactory
from .Math import rint
####################################################################################################

platform_enum = EnumFactory('PlatformEnum', ('linux', 'windows', 'macosx'))

####################################################################################################

class Platform(object):

    ##############################################

    def __init__(self):

        self.python_version = platform.python_version()
        self.qt_version = QtCore.QT_VERSION_STR
        self.pyqt_version = QtCore.PYQT_VERSION_STR

        self.os = self._get_os()
        self.node = platform.node()
        self.distribution = ' '.join(platform.dist())
        self.machine = platform.machine()
        self.architecture = platform.architecture()[0]

        # CPU
        self.cpu = self._get_cpu()
        self.number_of_cores = self._get_number_of_cores()
        self.cpu_khz = self._get_cpu_khz()
        self.cpu_mhz = rint(self._get_cpu_khz()/float(1000))
        
        # RAM
        self.memory_size_kb = self._get_memory_size_kb()

# Path: PyDvi/Tools/EnumFactory.py
# def EnumFactory(cls_name, constant_names):
# 
#     """ Return an :class:`EnumMetaClass` instance, where *cls_name* is the class name and
#     *constant_names* is an iterable of constant's names.
#     """
# 
#     dict_ = {}
#     dict_['_size'] = len(constant_names)
#     for index, name in enumerate(constant_names):
#         dict_[str(name)] = index
# 
#     return EnumMetaClass(cls_name, (), dict_)
# 
# Path: PyDviGui/Tools/Math.py
# def rint(f):
#     return int(round(f))


# Path: PyDviGui/Tools/Platform.py
import os
import platform
import sys
        import OpenGL.GL as GL
from PyQt4 import QtCore, QtGui
from PyDvi.Tools.EnumFactory import EnumFactory
from .Math import rint

####################################################################################################

platform_enum = EnumFactory('PlatformEnum', ('linux', 'windows', 'macosx'))

####################################################################################################

class Platform(object):

    ##############################################

    def __init__(self):

        self.python_version = platform.python_version()
        self.qt_version = QtCore.QT_VERSION_STR
        self.pyqt_version = QtCore.PYQT_VERSION_STR

        self.os = self._get_os()
        self.node = platform.node()
        self.distribution = ' '.join(platform.dist())
        self.machine = platform.machine()
        self.architecture = platform.architecture()[0]

        # CPU
        self.cpu = self._get_cpu()
        self.number_of_cores = self._get_number_of_cores()
        self.cpu_khz = self._get_cpu_khz()
        self.cpu_mhz = rint(self._get_cpu_khz()/float(1000))
        
        # RAM
        self.memory_size_kb = self._get_memory_size_kb()

        self.memory_size_mb = rint(self.memory_size_kb/float(1024))