Пример #1
0
 def __init__(self, **kwargs):
     super(HeatMap, self).__init__(**kwargs)
     self.appname = sys.argv[0]
     if self.appname == '':
         self.appname = 'python'
     elif self.appname[-3:] == '.py':
         self.appname = self.appname[:-3]
     self.filename = 'heatmap-%s.db' % self.appname
     self.db = sqlite3.connect(self.filename)
     try:
         self.db.execute('''
             CREATE TABLE heatmap (
                 x NUMERIC,
                 y NUMERIC,
                 time NUMERIC
             )
         ''')
         self.db.commit()
         pymt_logger.info('Create new database for heatmap in %s' % self.filename)
     except sqlite3.OperationalError:
         pymt_logger.info('Fill heatmap database in %s' % self.filename)
Пример #2
0
 def __init__(self, **kwargs):
     super(HeatMap, self).__init__(**kwargs)
     self.appname = sys.argv[0]
     if self.appname == '':
         self.appname = 'python'
     elif self.appname[-3:] == '.py':
         self.appname = self.appname[:-3]
     self.filename = 'heatmap-%s.db' % self.appname
     self.db = sqlite3.connect(self.filename)
     try:
         self.db.execute('''
             CREATE TABLE heatmap (
                 x NUMERIC,
                 y NUMERIC,
                 time NUMERIC
             )
         ''')
         self.db.commit()
         pymt_logger.info('Heatmap: Create new database for heatmap in %s' %
                          self.filename)
     except sqlite3.OperationalError:
         pymt_logger.info('Heatmap: Fill heatmap database in %s' %
                          self.filename)
Пример #3
0
Accelerate module use cython, and is activated by default, if cython is
correctly installed. Please refer to http://www.cython.org/ about how
to install cython on your environment.

You can control the usage of accelerate module with env variable ::

    PYMT_USE_ACCELERATE

If the env is set to 0, the module will be deactivated.
'''

__all__ = ('accelerate', )

from pymt import options, pymt_logger

#: Accelerate module (None mean that the module is not available)
accelerate = None

# try to use cython is available
if options.get('use_accelerate'):
    try:
        import _accelerate as accelerate
        pymt_logger.info('Core: Using accelerate module')
    except ImportError, e:
        pymt_logger.warning('Core: Accelerate module not available <%s>' % e)
        pymt_logger.warning('Core: Execute "python setup.py build_ext --inplace"')
else:
    pymt_logger.info('Core: Accelerate module disabled by user')

Пример #4
0
Accelerate module use cython, and is activated by default, if cython is
correctly installed. Please refer to http://www.cython.org/ about how
to install cython on your environment.

You can control the usage of accelerate module with env variable ::

    PYMT_USE_ACCELERATE

If the env is set to 0, the module will be deactivated.
'''

__all__ = ('accelerate', )

from pymt import pymt_options, pymt_logger

#: Accelerate module (None mean that the module is not available)
accelerate = None

# try to use cython is available
if pymt_options.get('use_accelerate'):
    try:
        import pymt.c_ext.c_accelerate as accelerate
        pymt_logger.info('Core: Using accelerate module')
    except ImportError, e:
        pymt_logger.warning('Core: Accelerate module not available <%s>' % e)
        pymt_logger.warning('Core: Execute "python setup.py build_ext '
                            '--inplace"')
else:
    pymt_logger.info('Core: Accelerate module disabled by user')