Пример #1
0
def _upgrade():
    global _upgraded
    _upgraded = True
    try:
        import sys

        sqlite_dll = File.new_instance(sys.exec_prefix, "dlls/sqlite3.dll")
        python_dll = File("pyLibrary/vendor/sqlite/sqlite3.dll")
        if python_dll.read_bytes() != sqlite_dll.read_bytes():
            backup = sqlite_dll.backup()
            File.copy(python_dll, sqlite_dll)
    except Exception, e:
        Log.warning("could not upgrade python's sqlite", cause=e)
Пример #2
0
    def test_read_home(self):
        file = "~/___test_file.json"
        source = "tests/resources/json_ref/simple.json"
        File.copy(File(source), File(file))
        content = jsons.ref.get("file://"+file)

        try:
            self.assertEqual(
                content,
                {"test_key": "test_value"}
            )
        finally:
            File(file).delete()
Пример #3
0
def _upgrade():
    global _upgraded
    _upgraded = True
    try:
        import sys

        sqlite_dll = File.new_instance(sys.exec_prefix, "dlls/sqlite3.dll")
        python_dll = File("pyLibrary/vendor/sqlite/sqlite3.dll")
        if python_dll.read_bytes() != sqlite_dll.read_bytes():
            backup = sqlite_dll.backup()
            File.copy(python_dll, sqlite_dll)
    except Exception, e:
        Log.warning("could not upgrade python's sqlite", cause=e)
Пример #4
0
                        finally:
                            signal.go()
                    else:
                        try:
                            self.db.execute(command)
                        except Exception, e:
                            e = Except.wrap(e)
                            e.cause = Except(
                                type=ERROR,
                                template="Bad call to Sqlite",
                                trace=trace
                            )
                            Log.warning("Failure to execute", cause=e)

        except Exception, e:
            Log.error("Problem with sql thread", e)
        finally:
            self.db.close()


try:
    import sys

    sqlite_dll = File.new_instance(sys.exec_prefix, "dlls/sqlite3.dll")
    python_dll = File("pyLibrary/vendor/sqlite/sqlite3.dll")
    if python_dll.read_bytes() != sqlite_dll.read_bytes():
        backup = sqlite_dll.backup()
        File.copy(python_dll, sqlite_dll)
except Exception, e:
    Log.warning("could not upgrade python's sqlite", cause=e)