diff options
author | Harel Ben-Attia <harelba@gmail.com> | 2017-11-24 11:34:33 +0200 |
---|---|---|
committer | Harel Ben-Attia <harelba@gmail.com> | 2017-11-24 11:34:33 +0200 |
commit | eb8c455d038dd736044e5b956face73dae960bab (patch) | |
tree | ebd6076dcb878168f48b6119f79a69c87c0c84b7 | |
parent | ea99c0133844596c2ba4ad531a58a10a376330fb (diff) |
1.7.0
-rwxr-xr-x | bin/q | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -137,9 +137,8 @@ class Sqlite3DB(object): try: import sqlitebck except ImportError, e: - msg = "sqlitebck python module cannot be found - fast store to disk cannot be performed" - print >>sys.stderr,msg - raise ValueError(msg) + msg = "sqlitebck python module cannot be found - fast store to disk cannot be performed. Note that for now, sqlitebck is not packaged as part of q. In order to use the fast method, you need to manually `pip install sqlitebck` into your python environment. We obviously consider this as a bug and it will be fixed once proper packaging will be done, making the fast method the standard one." + raise MissingSqliteBckModuleException(msg) new_db = sqlite3.connect(sqlite_db_filename) sqlitebck.copy(self.conn,new_db) @@ -254,6 +253,15 @@ class ColumnMaxLengthLimitExceededException(Exception): def __str(self): return repr(self.msg) +class MissingSqliteBckModuleException(Exception): + + def __init__(self, msg): + self.msg = msg + + def __str(self): + return repr(self.msg) + + class CouldNotParseInputException(Exception): def __init__(self, msg): @@ -1365,6 +1373,8 @@ class QTextAsData(object): error = QError(e,"Could not parse the input. Please make sure to set the proper -w input-wrapping parameter for your input, and that you use the proper input encoding (-e). Error: %s" % e.msg,59) except ColumnMaxLengthLimitExceededException,e: error = QError(e,e.msg,31) + except MissingSqliteBckModuleException, e: + error = QError(e,e.msg,79) except KeyboardInterrupt,e: warnings.append(QWarning(e,"Interrupted")) except Exception, e: |