Changeset - f4807acf643d
[Not reviewed]
beta
0 7 0
Marcin Kuzminski - 15 years ago 2011-04-04 19:43:31
marcin@python-works.com
added __license__ into main of rhodecode, PEP8ify
7 files changed with 16 insertions and 13 deletions:
0 comments (0 inline, 0 general)
rhodecode/__init__.py
Show inline comments
 
@@ -28,26 +28,28 @@
 
import platform
 

	
 
VERSION = (1, 2, 0, 'beta')
 
__version__ = '.'.join((str(each) for each in VERSION[:4]))
 
__dbversion__ = 3 #defines current db version for migrations
 
__platform__ = platform.system()
 
__license__ = 'GPLv3'
 

	
 
PLATFORM_WIN = ('Windows',)
 
PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD',)
 
PLATFORM_WIN = ('Windows')
 
PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD')
 

	
 
try:
 
    from rhodecode.lib.utils import get_current_revision
 
    _rev = get_current_revision()
 
except ImportError:
 
    #this is needed when doing some setup.py operations
 
    _rev = False
 

	
 
if len(VERSION) > 3 and _rev:
 
    __version__ += ' [rev:%s]' % _rev[0]
 

	
 

	
 
def get_version():
 
    """Returns shorter version (digit parts only) as string."""
 

	
 
    return '.'.join((str(each) for each in VERSION[:3]))
 

	
 
BACKENDS = {
rhodecode/config/environment.py
Show inline comments
 
@@ -18,12 +18,13 @@ from rhodecode.lib.utils import repo2db_
 
from rhodecode.model import init_model
 
from rhodecode.model.scm import ScmModel
 
from rhodecode.lib.timerproxy import TimerProxy
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
def load_environment(global_conf, app_conf, initial=False):
 
    """Configure the Pylons environment via the ``pylons.config``
 
    object
 
    """
 
    config = PylonsConfig()
 

	
 
@@ -64,13 +65,13 @@ def load_environment(global_conf, app_co
 

	
 
    #MULTIPLE DB configs
 
    # Setup the SQLAlchemy database engine
 
    if config['debug'] and not test:
 
        #use query time debugging.
 
        sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.',
 
                                                            proxy=TimerProxy())
 
                                           proxy=TimerProxy())
 
    else:
 
        sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
 

	
 
    init_model(sa_engine_db1)
 

	
 
    repos_path = make_ui('db').configitems('paths')[0][1]
rhodecode/config/middleware.py
Show inline comments
 
@@ -13,12 +13,13 @@ from pylons.wsgiapp import PylonsApp
 

	
 
from rhodecode.lib.middleware.simplehg import SimpleHg
 
from rhodecode.lib.middleware.simplegit import SimpleGit
 
from rhodecode.lib.middleware.https_fixup import HttpsFixup
 
from rhodecode.config.environment import load_environment
 

	
 

	
 
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
 
    """Create a Pylons WSGI application and return it
 

	
 
    ``global_conf``
 
        The inherited configuration for this application. Normally from
 
        the [DEFAULT] section of the Paste ini file.
rhodecode/config/routing.py
Show inline comments
 
@@ -6,12 +6,13 @@ may take precedent over the more generic
 
refer to the routes manual at http://routes.groovie.org/docs/
 
"""
 
from __future__ import with_statement
 
from routes import Mapper
 
from rhodecode.lib.utils import check_repo_fast as cr
 

	
 

	
 
def make_map(config):
 
    """Create, configure and return the routes Mapper"""
 
    routes_map = Mapper(directory=config['pylons.paths']['controllers'],
 
                 always_scan=config['debug'])
 
    routes_map.minimization = False
 
    routes_map.explicit = False
 
@@ -36,13 +37,12 @@ def make_map(config):
 
    #==========================================================================
 

	
 
    #MAIN PAGE
 
    routes_map.connect('home', '/', controller='home', action='index')
 
    routes_map.connect('repo_switcher', '/repos', controller='home', action='repo_switcher')
 
    routes_map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True)
 
    routes_map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True)
 
    routes_map.connect('rhodecode_official', "http://rhodecode.org", _static=True)
 

	
 
    #ADMIN REPOSITORY REST ROUTES
 
    with routes_map.submapper(path_prefix='/_admin', controller='admin/repos') as m:
 
        m.connect("repos", "/repos",
 
             action="create", conditions=dict(method=["POST"]))
 
@@ -111,13 +111,13 @@ def make_map(config):
 
    #ADMIN PERMISSIONS REST ROUTES
 
    routes_map.resource('permission', 'permissions', controller='admin/permissions', path_prefix='/_admin')
 

	
 
    ##ADMIN LDAP SETTINGS
 
    routes_map.connect('ldap_settings', '/_admin/ldap', controller='admin/ldap_settings',
 
                action='ldap_settings', conditions=dict(method=["POST"]))
 
    routes_map.connect('ldap_home', '/_admin/ldap', controller='admin/ldap_settings',)
 
    routes_map.connect('ldap_home', '/_admin/ldap', controller='admin/ldap_settings')
 

	
 

	
 
    #ADMIN SETTINGS REST ROUTES
 
    with routes_map.submapper(path_prefix='/_admin', controller='admin/settings') as m:
 
        m.connect("admin_settings", "/settings",
 
             action="create", conditions=dict(method=["POST"]))
 
@@ -153,23 +153,23 @@ def make_map(config):
 
        m.connect('admin_home', '', action='index')#main page
 
        m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
 
                  action='add_repo')
 

	
 

	
 
    #USER JOURNAL
 
    routes_map.connect('journal', '/_admin/journal', controller='journal',)
 
    routes_map.connect('journal', '/_admin/journal', controller='journal')
 
    routes_map.connect('public_journal', '/_admin/public_journal', controller='journal', action="public_journal")
 
    routes_map.connect('public_journal_rss', '/_admin/public_journal_rss', controller='journal', action="public_journal_rss")
 
    routes_map.connect('public_journal_atom', '/_admin/public_journal_atom', controller='journal', action="public_journal_atom")
 

	
 
    routes_map.connect('toggle_following', '/_admin/toggle_following', controller='journal',
 
                action='toggle_following', conditions=dict(method=["POST"]))
 

	
 

	
 
    #SEARCH
 
    routes_map.connect('search', '/_admin/search', controller='search',)
 
    routes_map.connect('search', '/_admin/search', controller='search')
 
    routes_map.connect('search_repo', '/_admin/search/{search_repo:.*}', controller='search')
 

	
 
    #LOGIN/LOGOUT/REGISTER/SIGN IN
 
    routes_map.connect('login_home', '/_admin/login', controller='login')
 
    routes_map.connect('logout_home', '/_admin/logout', controller='login', action='logout')
 
    routes_map.connect('register', '/_admin/register', controller='login', action='register')
rhodecode/templates/base/base.html
Show inline comments
 
@@ -67,15 +67,12 @@
 
<div id="footer">
 
   <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
 
       <div>
 
           <p class="footer-link">
 
                <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
 
           </p>
 
	       <p class="footer-link">
 
	           <a href="${h.url('gpl_license')}">${_('GPL license')}</a>
 
	       </p>
 
	       <p class="footer-link-right">
 
	           <a href="${h.url('rhodecode_official')}">RhodeCode</a> 
 
	           ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
 
	       </p>
 
       </div>
 
   </div>
rhodecode/websetup.py
Show inline comments
 
@@ -31,16 +31,18 @@ import logging
 
from rhodecode.config.environment import load_environment
 
from rhodecode.lib.db_manage import DbManage
 

	
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
def setup_app(command, conf, vars):
 
    """Place any commands to setup rhodecode here"""
 
    dbconf = conf['sqlalchemy.db1.url']
 
    dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], tests=False)
 
    dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'],
 
                        tests=False)
 
    dbmanage.create_tables(override=True)
 
    dbmanage.set_db_version()
 
    dbmanage.create_settings(dbmanage.config_prompt(None))
 
    dbmanage.create_default_user()
 
    dbmanage.admin_prompt()
 
    dbmanage.create_permissions()
setup.py
Show inline comments
 
import sys
 
from rhodecode import get_version
 
from rhodecode import __platform__
 
from rhodecode import __license__
 

	
 
py_version = sys.version_info
 

	
 
if py_version < (2, 5):
 
    raise Exception('RhodeCode requires python 2.5 or later')
 

	
 
@@ -22,13 +23,12 @@ requirements = [
 
    ]
 

	
 
classifiers = ['Development Status :: 4 - Beta',
 
               'Environment :: Web Environment',
 
               'Framework :: Pylons',
 
               'Intended Audience :: Developers',
 
               'License :: OSI Approved :: BSD License',
 
               'Operating System :: OS Independent',
 
               'Programming Language :: Python',
 
               'Programming Language :: Python :: 2.5',
 
               'Programming Language :: Python :: 2.6',
 
               'Programming Language :: Python :: 2.7', ]
 

	
 
@@ -78,13 +78,13 @@ packages = find_packages(exclude=['ez_se
 
setup(
 
    name='RhodeCode',
 
    version=get_version(),
 
    description=description,
 
    long_description=long_description,
 
    keywords=keywords,
 
    license='GPLv3',
 
    license=__license__,
 
    author='Marcin Kuzminski',
 
    author_email='marcin@python-works.com',
 
    url='http://rhodecode.org',
 
    install_requires=requirements,
 
    classifiers=classifiers,
 
    setup_requires=["PasteScript>=1.6.3"],
0 comments (0 inline, 0 general)