Changeset - 63745288a387
[Not reviewed]
3 2 4
Lance Edgar (lance) - 12 years ago 2012-07-25 17:23:31
lance@edbob.org
move db extension to subdir
6 files changed with 46 insertions and 14 deletions:
0 comments (0 inline, 0 general)
rattail/__init__.py
Show inline comments
 
@@ -27,20 +27,7 @@
 
"""
 

	
 
from pkgutil import extend_path
 
__path__ = extend_path(__path__, __name__)
 

	
 

	
 
from edbob.db.extensions import Extension
 

	
 
import rattail.model
 
from rattail._version import __version__
 
from rattail.enum import *
 
from rattail.model import *
 

	
 

	
 
__all__ = rattail.model.__all__
 

	
 

	
 
class RattailExtension(Extension):
 

	
 
    name = 'rattail'
rattail/db/__init__.py
Show inline comments
 
file renamed from rattail/db.py to rattail/db/__init__.py
 
@@ -23,17 +23,28 @@
 
################################################################################
 

	
 
"""
 
``rattail.db`` -- Database Stuff
 
"""
 

	
 
import edbob
 
from edbob.db.extensions import activate_extension
 

	
 
import rattail
 

	
 

	
 
def init(config):
 
    """
 
    Initialize the Rattail database framework.
 
    """
 

	
 
    from rattail.db import extension
 
    edbob.graft(rattail, extension.model)
 
    edbob.graft(rattail, extension.enum)
 

	
 

	
 
def init_database(engine, session):
 
    """
 
    Initialize an ``edbob`` database for use with Rattail.
 
    """
 

	
 
    activate_extension('rattail', engine)
rattail/db/extension/__init__.py
Show inline comments
 
new file 100644
 
#!/usr/bin/env python
 
# -*- coding: utf-8  -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2012 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail is free software: you can redistribute it and/or modify it under the
 
#  terms of the GNU Affero General Public License as published by the Free
 
#  Software Foundation, either version 3 of the License, or (at your option)
 
#  any later version.
 
#
 
#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
 
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
#  FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for
 
#  more details.
 
#
 
#  You should have received a copy of the GNU Affero General Public License
 
#  along with Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 

	
 
"""
 
``rattail.extension`` -- Database Extension
 
"""
 

	
 
from edbob.db.extensions import Extension
 

	
 

	
 
class RattailExtension(Extension):
 

	
 
    name = 'rattail'
rattail/db/extension/enum.py
Show inline comments
 
file renamed from rattail/enum.py to rattail/db/extension/enum.py
rattail/db/extension/model.py
Show inline comments
 
file renamed from rattail/model.py to rattail/db/extension/model.py
setup.py
Show inline comments
 
@@ -106,13 +106,13 @@ setup(
 
rattail = rattail.commands:main
 

	
 
[gui_scripts]
 
rattailw = rattail.commands:main
 

	
 
[edbob.db.extensions]
 
rattail = rattail:RattailExtension
 
rattail = rattail.db.extension:RattailExtension
 

	
 
[rattail.commands]
 
filemon = rattail.commands:FileMonitorCommand
 

	
 
""",
 
    )
0 comments (0 inline, 0 general)