apply some PEP8 love to template.py

This commit is contained in:
iElectric 2009-06-01 22:27:45 +00:00
parent 7cd2c3233b
commit 5aaaa05fcc

View File

@ -1,11 +1,18 @@
from pkg_resources import resource_filename
import os,shutil
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import sys
from pkg_resources import resource_filename
from migrate.versioning.base import *
from migrate.versioning import pathed
class Packaged(pathed.Pathed):
"""An object assoc'ed with a Python package"""
def __init__(self, pkg):
self.pkg = pkg
path = self._find_path(pkg)
@ -19,9 +26,12 @@ class Packaged(pathed.Pathed):
class Collection(Packaged):
"""A collection of templates of a specific type"""
_default = None
def get_path(self, file):
return os.path.join(self.path, str(file))
def get_pkg(self, file):
return (self.pkg, str(file))
@ -33,6 +43,7 @@ class ScriptCollection(Collection):
class Template(Packaged):
"""Finds the paths/packages of various Migrate templates"""
_repository = 'repository'
_script = 'script'
_manage = 'manage.py_tmpl'