/usr/lib/python2.7/dist-packages/south/exceptions.py is in python-django-south 1.0-0.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | from __future__ import print_function
from traceback import format_exception, format_exc
class SouthError(RuntimeError):
pass
class SouthWarning(RuntimeWarning):
pass
class BrokenMigration(SouthError):
def __init__(self, migration, exc_info):
self.migration = migration
self.exc_info = exc_info
if self.exc_info:
self.traceback = ''.join(format_exception(*self.exc_info))
else:
try:
self.traceback = format_exc()
except AttributeError: # Python3 when there is no previous exception
self.traceback = None
def __str__(self):
return ("While loading migration '%(migration)s':\n"
'%(traceback)s' % self.__dict__)
class UnknownMigration(BrokenMigration):
def __str__(self):
if not hasattr(self, "traceback"):
self.traceback = ""
return ("Migration '%(migration)s' probably doesn't exist.\n"
'%(traceback)s' % self.__dict__)
class InvalidMigrationModule(SouthError):
def __init__(self, application, module):
self.application = application
self.module = module
def __str__(self):
return ('The migration module specified for %(application)s, %(module)r, is invalid; the parent module does not exist.' % self.__dict__)
class NoMigrations(SouthError):
def __init__(self, application):
self.application = application
def __str__(self):
return "Application '%(application)s' has no migrations." % self.__dict__
class MultiplePrefixMatches(SouthError):
def __init__(self, prefix, matches):
self.prefix = prefix
self.matches = matches
def __str__(self):
self.matches_list = "\n ".join([str(m) for m in self.matches])
return ("Prefix '%(prefix)s' matches more than one migration:\n"
" %(matches_list)s") % self.__dict__
class GhostMigrations(SouthError):
def __init__(self, ghosts):
self.ghosts = ghosts
def __str__(self):
self.ghosts_list = "\n ".join([str(m) for m in self.ghosts])
return ("\n\n ! These migrations are in the database but not on disk:\n"
" %(ghosts_list)s\n"
" ! I'm not trusting myself; either fix this yourself by fiddling\n"
" ! with the south_migrationhistory table, or pass --delete-ghost-migrations\n"
" ! to South to have it delete ALL of these records (this may not be good).") % self.__dict__
class CircularDependency(SouthError):
def __init__(self, trace):
self.trace = trace
def __str__(self):
trace = " -> ".join([str(s) for s in self.trace])
return ("Found circular dependency:\n"
" %s") % trace
class InconsistentMigrationHistory(SouthError):
def __init__(self, problems):
self.problems = problems
def __str__(self):
return ('Inconsistent migration history\n'
'The following options are available:\n'
' --merge: will just attempt the migration ignoring any potential dependency conflicts.')
class DependsOnHigherMigration(SouthError):
def __init__(self, migration, depends_on):
self.migration = migration
self.depends_on = depends_on
def __str__(self):
return "Lower migration '%(migration)s' depends on a higher migration '%(depends_on)s' in the same app." % self.__dict__
class DependsOnUnknownMigration(SouthError):
def __init__(self, migration, depends_on):
self.migration = migration
self.depends_on = depends_on
def __str__(self):
print("Migration '%(migration)s' depends on unknown migration '%(depends_on)s'." % self.__dict__)
class DependsOnUnmigratedApplication(SouthError):
def __init__(self, migration, application):
self.migration = migration
self.application = application
def __str__(self):
return "Migration '%(migration)s' depends on unmigrated application '%(application)s'." % self.__dict__
class FailedDryRun(SouthError):
def __init__(self, migration, exc_info):
self.migration = migration
self.name = migration.name()
self.exc_info = exc_info
self.traceback = ''.join(format_exception(*self.exc_info))
def __str__(self):
return (" ! Error found during dry run of '%(name)s'! Aborting.\n"
"%(traceback)s") % self.__dict__
class ORMBaseNotIncluded(SouthError):
"""Raised when a frozen model has something in _ormbases which isn't frozen."""
pass
class UnfreezeMeLater(Exception):
"""An exception, which tells the ORM unfreezer to postpone this model."""
pass
class ImpossibleORMUnfreeze(SouthError):
"""Raised if the ORM can't manage to unfreeze all the models in a linear fashion."""
pass
class ConstraintDropped(SouthWarning):
def __init__(self, constraint, table, column=None):
self.table = table
if column:
self.column = ".%s" % column
else:
self.column = ""
self.constraint = constraint
def __str__(self):
return "Constraint %(constraint)s was dropped from %(table)s%(column)s -- was this intended?" % self.__dict__
|