Returns:
(errors, response)
- errors List of core_ex.Error instances
+ errors List of core_ex.SetupError instances
response Dict pyramid will use to render the resulting form.
The dict returned by func(conn) plus reserved keys.
Reserved keys:
Returns:
(errors, response)
- errors List of core_ex.Error instantiations
+ errors List of core_ex.PGWUIError instantiations
response Dict containing connection result info
Side effects:
a transaction.
func(conn) Call this function with the connection.
- func(conn) must return a list of core_ex.Error instances
+ func(conn) must return a list of core_ex.PGWUIError
+ instances
Returns:
- errors List of core_ex.Error instances
+ errors List of core_ex.PGWUIError instances
Side effects:
Calls func(conn)
'''
Call a database modification function with a connection.
func(conn) Call this function with the connection.
- func(conn) must return a list of core_ex.Error instances
+ func(conn) must return a list of core_ex.PGWUIError
+ instances
Returns:
- errors List of core_ex.Error instances
+ errors List of core_ex.PGWUIError instances
Side effects:
Calls func(conn)
'''
func(conn) Call this function with the connection.
f(conn) must return a (errors, dict) tuple result,
- errors list of core_ex.Error instances
+ errors list of core_ex.PWGUIError instances
dict other results
Returns:
(errors, response)
- errors List of core_ex.Error instances
+ errors List of core_ex.PGWUIError instances
response Dict pyramid will use to render the resulting form.
The dict returned by func(conn) plus reserved keys.
Reserved keys:
return self
-class Error(UploadError):
+class SetupError(UploadError):
'''
Module exceptions raised while setting up to read data lines
are derived from this class.
detail Extra HTML describing the error
'''
def __init__(self, e, descr='', detail=''):
- super(Error, self).__init__(e=e, descr=descr, detail=detail)
+ super(SetupError, self).__init__(e=e, descr=descr, detail=detail)
-class NoFileError(Error):
+class NoFileError(SetupError):
'''No file uploaded'''
def __init__(self, e, descr='', detail=''):
super(NoFileError, self).__init__(e, descr, detail)
-class NoDBError(Error):
+class NoDBError(SetupError):
'''No database name given'''
def __init__(self, e, descr='', detail=''):
super(NoDBError, self).__init__(e, descr, detail)
-class NoUserError(Error):
+class NoUserError(SetupError):
'''No user name supplied'''
def __init__(self, e, descr='', detail=''):
super(NoUserError, self).__init__(e, descr, detail)
-class AuthFailError(Error):
+class AuthFailError(SetupError):
'''Unable to connect to the db'''
def __init__(self, e, descr='', detail=''):
super(AuthFailError, self).__init__(e, descr, detail)
-class DryRunError(Error):
+class DryRunError(SetupError):
'''Rollback due to dry_run config option'''
def __init__(self, e, descr='', detail=''):
super(DryRunError, self).__init__(e, descr, detail)
-class CSRFError(Error):
+class CSRFError(SetupError):
'''Invalid CSRF token'''
def __init__(self, e, descr='', detail=''):
super(CSRFError, self).__init__(e, descr, detail)
-class NoHeadersError(Error):
+class NoHeadersError(SetupError):
'''No column headings found'''
def __init__(self, e, descr='', detail=''):
super(NoHeadersError, self).__init__(e, descr, detail)
-class NoDataError(Error):
+class NoDataError(SetupError):
'''No data uploaded'''
def __init__(self, e, descr='', detail=''):
super(NoDataError, self).__init__(e, descr, detail)
-class CantDecodeError(Error):
+class CantDecodeError(SetupError):
'''Can't decode file data into unicode'''
def __init__(self, e, descr='', detail=''):
super().__init__(e, descr, detail)
-class DuplicateUploadError(Error):
+class DuplicateUploadError(SetupError):
'''The same filename updated twice into the same db'''
def __init__(self, e, descr='', detail=''):
super(DuplicateUploadError, self).__init__(e, descr, detail)
-class DataInconsistencyError(Error):
+class DataInconsistencyError(SetupError):
def __init__(self, e, descr='', detail=''):
super(DataInconsistencyError, self).__init__(e, descr, detail)
-class DBError(Error):
+class DBError(SetupError):
'''psycopg2 raised an error'''
def __init__(self, pgexc, e='process your request'):
'''