remove versioning.base in favor of versioning.config
This commit is contained in:
		@@ -1,5 +0,0 @@
 | 
			
		||||
"""Things that should be imported by all migrate packages"""
 | 
			
		||||
 | 
			
		||||
#__all__ = ['logging','log','databases','operations']
 | 
			
		||||
from logger import logging, log
 | 
			
		||||
from const import databases, operations
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 | 
			
		||||
from ConfigParser import ConfigParser
 | 
			
		||||
 | 
			
		||||
from migrate.versioning.base import *
 | 
			
		||||
from migrate.versioning.config import *
 | 
			
		||||
from migrate.versioning import pathed
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,6 @@
 | 
			
		||||
#!/usr/bin/python
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
 | 
			
		||||
from sqlalchemy.util import OrderedDict
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -4,11 +4,14 @@
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import shutil
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
from migrate.versioning import exceptions
 | 
			
		||||
from migrate.versioning.base import *
 | 
			
		||||
from migrate.versioning.config import *
 | 
			
		||||
from migrate.versioning.util import KeyedInstance
 | 
			
		||||
 | 
			
		||||
log = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Pathed(KeyedInstance):
 | 
			
		||||
    """
 | 
			
		||||
@@ -32,7 +35,7 @@ class Pathed(KeyedInstance):
 | 
			
		||||
        """Try to initialize this object's parent, if it has one"""
 | 
			
		||||
        parent_path = self.__class__._parent_path(path)
 | 
			
		||||
        self.parent = self.__class__.parent(parent_path)
 | 
			
		||||
        log.info("Getting parent %r:%r" % (self.__class__.parent, parent_path))
 | 
			
		||||
        log.debug("Getting parent %r:%r" % (self.__class__.parent, parent_path))
 | 
			
		||||
        self.parent._init_child(path, self)
 | 
			
		||||
 | 
			
		||||
    def _init_child(self, child, path):
 | 
			
		||||
 
 | 
			
		||||
@@ -4,15 +4,18 @@
 | 
			
		||||
import os
 | 
			
		||||
import shutil
 | 
			
		||||
import string
 | 
			
		||||
import logging
 | 
			
		||||
from pkg_resources import resource_filename
 | 
			
		||||
 | 
			
		||||
from tempita import Template as TempitaTemplate
 | 
			
		||||
 | 
			
		||||
from migrate.versioning import exceptions, script, version, pathed, cfgparse
 | 
			
		||||
from migrate.versioning.template import Template
 | 
			
		||||
from migrate.versioning.base import *
 | 
			
		||||
from migrate.versioning.config import *
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
log = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
class Changeset(dict):
 | 
			
		||||
    """A collection of changes to be applied to a database.
 | 
			
		||||
 | 
			
		||||
@@ -69,13 +72,13 @@ class Repository(pathed.Pathed):
 | 
			
		||||
    _versions = 'versions'
 | 
			
		||||
 | 
			
		||||
    def __init__(self, path):
 | 
			
		||||
        log.info('Loading repository %s...' % path)
 | 
			
		||||
        log.debug('Loading repository %s...' % path)
 | 
			
		||||
        self.verify(path)
 | 
			
		||||
        super(Repository, self).__init__(path)
 | 
			
		||||
        self.config = cfgparse.Config(os.path.join(self.path, self._config))
 | 
			
		||||
        self.versions = version.Collection(os.path.join(self.path,
 | 
			
		||||
                                                      self._versions))
 | 
			
		||||
        log.info('Repository %s loaded successfully' % path)
 | 
			
		||||
        log.debug('Repository %s loaded successfully' % path)
 | 
			
		||||
        log.debug('Config: %r' % self.config.to_dict())
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,13 @@
 | 
			
		||||
#!/usr/bin/env python
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
 | 
			
		||||
from migrate.versioning.base import log, operations
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
from migrate.versioning.config import operations
 | 
			
		||||
from migrate.versioning import pathed, exceptions
 | 
			
		||||
 | 
			
		||||
log = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class BaseScript(pathed.Pathed):
 | 
			
		||||
    """Base class for other types of scripts.
 | 
			
		||||
@@ -20,10 +24,10 @@ class BaseScript(pathed.Pathed):
 | 
			
		||||
    """ # TODO: sphinxfy this and implement it correctly
 | 
			
		||||
 | 
			
		||||
    def __init__(self, path):
 | 
			
		||||
        log.info('Loading script %s...' % path)
 | 
			
		||||
        log.debug('Loading script %s...' % path)
 | 
			
		||||
        self.verify(path)
 | 
			
		||||
        super(BaseScript, self).__init__(path)
 | 
			
		||||
        log.info('Script %s loaded successfully' % path)
 | 
			
		||||
        log.debug('Script %s loaded successfully' % path)
 | 
			
		||||
    
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def verify(cls, path):
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ from StringIO import StringIO
 | 
			
		||||
 | 
			
		||||
import migrate
 | 
			
		||||
from migrate.versioning import exceptions, genmodel, schemadiff
 | 
			
		||||
from migrate.versioning.base import operations
 | 
			
		||||
from migrate.versioning.config import operations
 | 
			
		||||
from migrate.versioning.template import Template
 | 
			
		||||
from migrate.versioning.script import base
 | 
			
		||||
from migrate.versioning.util import import_path, load_model, construct_engine
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ import sys
 | 
			
		||||
import inspect
 | 
			
		||||
from optparse import OptionParser, BadOptionError
 | 
			
		||||
 | 
			
		||||
from migrate.versioning.base import *
 | 
			
		||||
from migrate.versioning.config import *
 | 
			
		||||
from migrate.versioning import api, exceptions
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ import sys
 | 
			
		||||
 | 
			
		||||
from pkg_resources import resource_filename
 | 
			
		||||
 | 
			
		||||
from migrate.versioning.base import *
 | 
			
		||||
from migrate.versioning.config import *
 | 
			
		||||
from migrate.versioning import pathed
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user