summaryrefslogtreecommitdiff
path: root/migrate/versioning
diff options
context:
space:
mode:
Diffstat (limited to 'migrate/versioning')
-rw-r--r--migrate/versioning/repository.py4
-rw-r--r--migrate/versioning/script/base.py2
-rw-r--r--migrate/versioning/script/sql.py2
-rw-r--r--migrate/versioning/template.py6
-rw-r--r--migrate/versioning/templates/repository/default/migrate.cfg14
-rw-r--r--migrate/versioning/templates/repository/pylons/migrate.cfg14
-rw-r--r--migrate/versioning/util/__init__.py8
-rw-r--r--migrate/versioning/util/importpath.py2
-rw-r--r--migrate/versioning/util/keyedinstance.py4
-rw-r--r--migrate/versioning/version.py12
10 files changed, 34 insertions, 34 deletions
diff --git a/migrate/versioning/repository.py b/migrate/versioning/repository.py
index 6e2f678..82aa271 100644
--- a/migrate/versioning/repository.py
+++ b/migrate/versioning/repository.py
@@ -153,7 +153,7 @@ class Repository(pathed.Pathed):
def create_script(self, description, **k):
"""API to :meth:`migrate.versioning.version.Collection.create_new_python_version`"""
-
+
k['use_timestamp_numbering'] = self.use_timestamp_numbering
self.versions.create_new_python_version(description, **k)
@@ -229,7 +229,7 @@ class Repository(pathed.Pathed):
@classmethod
def create_manage_file(cls, file_, **opts):
"""Create a project management script (manage.py)
-
+
:param file_: Destination file to be written
:param opts: Options that are passed to :func:`migrate.versioning.shell.main`
"""
diff --git a/migrate/versioning/script/base.py b/migrate/versioning/script/base.py
index 4287235..22ca7b4 100644
--- a/migrate/versioning/script/base.py
+++ b/migrate/versioning/script/base.py
@@ -28,7 +28,7 @@ class BaseScript(pathed.Pathed):
self.verify(path)
super(BaseScript, self).__init__(path)
log.debug('Script %s loaded successfully' % path)
-
+
@classmethod
def verify(cls, path):
"""Ensure this is a valid script
diff --git a/migrate/versioning/script/sql.py b/migrate/versioning/script/sql.py
index ed80764..fdc9e2b 100644
--- a/migrate/versioning/script/sql.py
+++ b/migrate/versioning/script/sql.py
@@ -15,7 +15,7 @@ class SqlScript(base.BaseScript):
@classmethod
def create(cls, path, **opts):
"""Create an empty migration script at specified path
-
+
:returns: :class:`SqlScript instance <migrate.versioning.script.sql.SqlScript>`"""
cls.require_notfound(path)
diff --git a/migrate/versioning/template.py b/migrate/versioning/template.py
index 182898a..8182e6b 100644
--- a/migrate/versioning/template.py
+++ b/migrate/versioning/template.py
@@ -33,7 +33,7 @@ class SQLScriptCollection(Collection):
class Template(pathed.Pathed):
"""Finds the paths/packages of various Migrate templates.
-
+
:param path: Templates are loaded from migrate package
if `path` is not provided.
"""
@@ -65,7 +65,7 @@ class Template(pathed.Pathed):
def _get_item(self, collection, theme=None):
"""Locates and returns collection.
-
+
:param collection: name of collection to locate
:param type_: type of subfolder in collection (defaults to "_default")
:returns: (package, source)
@@ -79,7 +79,7 @@ class Template(pathed.Pathed):
def get_repository(self, *a, **kw):
"""Calls self._get_item('repository', *a, **kw)"""
return self._get_item('repository', *a, **kw)
-
+
def get_script(self, *a, **kw):
"""Calls self._get_item('script', *a, **kw)"""
return self._get_item('script', *a, **kw)
diff --git a/migrate/versioning/templates/repository/default/migrate.cfg b/migrate/versioning/templates/repository/default/migrate.cfg
index dae0612..bcc33a7 100644
--- a/migrate/versioning/templates/repository/default/migrate.cfg
+++ b/migrate/versioning/templates/repository/default/migrate.cfg
@@ -5,16 +5,16 @@ repository_id={{ locals().pop('repository_id') }}
# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.
-# If this is changed once a database is under version control, you'll need to
-# change the table name in each database too.
+# If this is changed once a database is under version control, you'll need to
+# change the table name in each database too.
version_table={{ locals().pop('version_table') }}
-# When committing a change script, Migrate will attempt to generate the
+# When committing a change script, Migrate will attempt to generate the
# sql for all supported databases; normally, if one of them fails - probably
-# because you don't have that database installed - it is ignored and the
-# commit continues, perhaps ending successfully.
-# Databases in this list MUST compile successfully during a commit, or the
-# entire commit will fail. List the databases your application will actually
+# because you don't have that database installed - it is ignored and the
+# commit continues, perhaps ending successfully.
+# Databases in this list MUST compile successfully during a commit, or the
+# entire commit will fail. List the databases your application will actually
# be using to ensure your updates to that database work properly.
# This must be a list; example: ['postgres','sqlite']
required_dbs={{ locals().pop('required_dbs') }}
diff --git a/migrate/versioning/templates/repository/pylons/migrate.cfg b/migrate/versioning/templates/repository/pylons/migrate.cfg
index dae0612..bcc33a7 100644
--- a/migrate/versioning/templates/repository/pylons/migrate.cfg
+++ b/migrate/versioning/templates/repository/pylons/migrate.cfg
@@ -5,16 +5,16 @@ repository_id={{ locals().pop('repository_id') }}
# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.
-# If this is changed once a database is under version control, you'll need to
-# change the table name in each database too.
+# If this is changed once a database is under version control, you'll need to
+# change the table name in each database too.
version_table={{ locals().pop('version_table') }}
-# When committing a change script, Migrate will attempt to generate the
+# When committing a change script, Migrate will attempt to generate the
# sql for all supported databases; normally, if one of them fails - probably
-# because you don't have that database installed - it is ignored and the
-# commit continues, perhaps ending successfully.
-# Databases in this list MUST compile successfully during a commit, or the
-# entire commit will fail. List the databases your application will actually
+# because you don't have that database installed - it is ignored and the
+# commit continues, perhaps ending successfully.
+# Databases in this list MUST compile successfully during a commit, or the
+# entire commit will fail. List the databases your application will actually
# be using to ensure your updates to that database work properly.
# This must be a list; example: ['postgres','sqlite']
required_dbs={{ locals().pop('required_dbs') }}
diff --git a/migrate/versioning/util/__init__.py b/migrate/versioning/util/__init__.py
index 0928644..34ec5b2 100644
--- a/migrate/versioning/util/__init__.py
+++ b/migrate/versioning/util/__init__.py
@@ -22,7 +22,7 @@ def load_model(dotted_name):
"""Import module and use module-level variable".
:param dotted_name: path to model in form of string: ``some.python.module:Class``
-
+
.. versionchanged:: 0.5.4
"""
@@ -54,9 +54,9 @@ def asbool(obj):
def guess_obj_type(obj):
"""Do everything to guess object type from string
-
+
Tries to convert to `int`, `bool` and finally returns if not succeded.
-
+
.. versionadded: 0.5.4
"""
@@ -81,7 +81,7 @@ def guess_obj_type(obj):
@decorator
def catch_known_errors(f, *a, **kw):
"""Decorator that catches known api errors
-
+
.. versionadded: 0.5.4
"""
diff --git a/migrate/versioning/util/importpath.py b/migrate/versioning/util/importpath.py
index 59b57f1..0b398e1 100644
--- a/migrate/versioning/util/importpath.py
+++ b/migrate/versioning/util/importpath.py
@@ -3,7 +3,7 @@ import sys
def import_path(fullpath):
""" Import a file with full path specification. Allows one to
- import from anywhere, something __import__ does not do.
+ import from anywhere, something __import__ does not do.
"""
# http://zephyrfalcon.org/weblog/arch_d7_2002_08_31.html
path, filename = os.path.split(fullpath)
diff --git a/migrate/versioning/util/keyedinstance.py b/migrate/versioning/util/keyedinstance.py
index 3f6cb91..a692e08 100644
--- a/migrate/versioning/util/keyedinstance.py
+++ b/migrate/versioning/util/keyedinstance.py
@@ -4,7 +4,7 @@
class KeyedInstance(object):
"""A class whose instances have a unique identifier of some sort
No two instances with the same unique ID should exist - if we try to create
- a second instance, the first should be returned.
+ a second instance, the first should be returned.
"""
_instances = dict()
@@ -24,7 +24,7 @@ class KeyedInstance(object):
@classmethod
def _key(cls, *p, **k):
"""Given a unique identifier, return a dictionary key
- This should be overridden by child classes, to specify which parameters
+ This should be overridden by child classes, to specify which parameters
should determine an object's uniqueness
"""
raise NotImplementedError()
diff --git a/migrate/versioning/version.py b/migrate/versioning/version.py
index 0f92dd8..37dfbb9 100644
--- a/migrate/versioning/version.py
+++ b/migrate/versioning/version.py
@@ -75,7 +75,7 @@ class Collection(pathed.Pathed):
and store them in self.versions
"""
super(Collection, self).__init__(path)
-
+
# Create temporary list of files, allowing skipped version numbers.
files = os.listdir(path)
if '1' in files:
@@ -126,7 +126,7 @@ class Collection(pathed.Pathed):
script.PythonScript.create(filepath, **k)
self.versions[ver] = Version(ver, self.path, [filename])
-
+
def create_new_sql_version(self, database, description, **k):
"""Create SQL files for new version"""
ver = self._next_ver_num(k.pop('use_timestamp_numbering', False))
@@ -146,7 +146,7 @@ class Collection(pathed.Pathed):
filepath = self._version_path(filename)
script.SqlScript.create(filepath, **k)
self.versions[ver].add_script(filepath)
-
+
def version(self, vernum=None):
"""Returns latest Version if vernum is not given.
Otherwise, returns wanted version"""
@@ -165,7 +165,7 @@ class Collection(pathed.Pathed):
class Version(object):
"""A single version in a collection
- :param vernum: Version Number
+ :param vernum: Version Number
:param path: Path to script files
:param filelist: List of scripts
:type vernum: int, VerNum
@@ -182,7 +182,7 @@ class Version(object):
for script in filelist:
self.add_script(os.path.join(path, script))
-
+
def script(self, database=None, operation=None):
"""Returns SQL or Python Script"""
for db in (database, 'default'):
@@ -211,7 +211,7 @@ class Version(object):
def _add_script_sql(self, path):
basename = os.path.basename(path)
match = self.SQL_FILENAME.match(basename)
-
+
if match:
basename = basename.replace('.sql', '')
parts = basename.split('_')