Commits

Rodrigo Pinheiro Matias committed 9ba54e3

Corrigindo dependencias no setup
Movimento o arquivo de dados para .config/qsc.db

  • Participants
  • Parent commits f7e29b9

Comments (0)

Files changed (3)

QSupervisorControl/db.py

 
 
 def get_engine():
-    print '%s' % os.path.join(os.environ.get('HOME'), 'qsc.dat')
+    dbfile = os.path.sep.join([os.environ.get('HOME'), '.config', 'qsc.dat'])
+    old_dbfile = os.path.sep.join([os.environ.get('HOME'), 'qsc.dat'])
+
+    if os.path.exists(old_dbfile) is True:
+        print('move old configuration for new destination %s' % old_dbfile)
+        src_fd = open(old_dbfile, 'rb')
+        dst_fd = open(dbfile, 'wb')
+
+        dst_fd.write(src_fd.read())
+        dst_fd.close()
+        src_fd.close()
+
+        os.unlink(old_dbfile)
+
+    print('database file %s' % dbfile)
 
     return sqlalchemy.create_engine(
-        'sqlite:///%s' % os.path.join(os.environ.get('HOME'), 'qsc.dat'),
+        'sqlite:///%s' % dbfile,
+        native_datetime=True,
         echo=False
     )
 

QSupervisorControl/system.py

 import sys
 import logging
 
-VERSION = '0.3.5'
+VERSION = '0.3.6'
 DEBUG = False
 
 __version__ = VERSION
     rst = [locale_file(filename) for filename in os.listdir(i18n_dir) if test(filename) is True]
     return rst
 
+
 def get_long_description():
     text = None
     try:
     url='https://bitbucket.org/rodrigopmatias/qsupervisorcontrol/downloads',
     py_modules=['QSupervisorControl'],
     scripts=['qsc'],
-    install_requires=['supervisor', 'sqlalchemy'],
+    install_requires=['supervisor', 'sqlalchemy', 'pysqlite'],
     packages=[
         'QSupervisorControl',
         'QSupervisorControl.ui',
         ] + get_locales()
     }
 )
-