Changeset - dabdc356393b
[Not reviewed]
default
0 56 0
Thomas De Schampheleire - 11 years ago 2015-03-12 21:09:10
thomas.de.schampheleire@gmail.com
lib: trivial typo fixes
56 files changed with 106 insertions and 106 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/annotate.py
Show inline comments
 
@@ -15,7 +15,7 @@
 
kallithea.lib.annotate
 
~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Anontation library for usage in kallithea, previously part of vcs
 
Annotation library for usage in Kallithea, previously part of vcs
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
kallithea/lib/auth.py
Show inline comments
 
@@ -236,7 +236,7 @@ def _cached_perms_data(user_id, user_is_
 
    #==================================================================
 
    uid = user_id
 

	
 
    # default global permissions taken fron the default user
 
    # default global permissions taken from the default user
 
    default_global_perms = UserToPerm.query()\
 
        .filter(UserToPerm.user_id == default_user_id)\
 
        .options(joinedload(UserToPerm.permission))
 
@@ -554,7 +554,7 @@ class AuthUser(object):
 

	
 
        :param user: instance of User object from database
 
        :param explicit: In case there are permissions both for user and a group
 
            that user is part of, explicit flag will defiine if user will
 
            that user is part of, explicit flag will define if user will
 
            explicitly override permissions from group, if it's False it will
 
            make decision based on the algo
 
        :param algo: algorithm to decide what permission should be choose if
kallithea/lib/auth_modules/__init__.py
Show inline comments
 
@@ -67,7 +67,7 @@ class KallitheaAuthPluginBase(object):
 
        Exposes Kallithea validators modules
 
        """
 
        # this is a hack to overcome issues with pylons threadlocals and
 
        # translator object _() not beein registered properly.
 
        # translator object _() not being registered properly.
 
        class LazyCaller(object):
 
            def __init__(self, name):
 
                self.validator_name = name
 
@@ -130,7 +130,7 @@ class KallitheaAuthPluginBase(object):
 
    def get_user(self, username=None, **kwargs):
 
        """
 
        Helper method for user fetching in plugins, by default it's using
 
        simple fetch by username, but this method can be custimized in plugins
 
        simple fetch by username, but this method can be customized in plugins
 
        eg. container auth plugin to fetch user by environ params
 

	
 
        :param username: username if given to fetch from database
 
@@ -263,7 +263,7 @@ class KallitheaExternalAuthPlugin(Kallit
 
            # maybe plugin will clean the username ?
 
            # we should use the return value
 
            username = auth['username']
 
            # if user is not active from our extern type we should fail to authe
 
            # if user is not active from our extern type we should fail to auth
 
            # this can prevent from creating users in Kallithea when using
 
            # external authentication, but if it's inactive user we shouldn't
 
            # create that user anyway
 
@@ -324,7 +324,7 @@ def importplugin(plugin):
 
    except (ImportError, TypeError):
 
        log.error(traceback.format_exc())
 
        # TODO: make this more error prone, if by some accident we screw up
 
        # the plugin name, the crash is preatty bad and hard to recover
 
        # the plugin name, the crash is pretty bad and hard to recover
 
        raise
 

	
 
    log.debug("Loaded auth plugin from %s (module:%s, file:%s)"
 
@@ -346,7 +346,7 @@ def loadplugin(plugin):
 
    plugin = importplugin(plugin)()
 
    if plugin.plugin_settings.im_func != KallitheaAuthPluginBase.plugin_settings.im_func:
 
        raise TypeError("Authentication class %s.KallitheaAuthPluginBase "
 
                        "has overriden the plugin_settings method, which is "
 
                        "has overridden the plugin_settings method, which is "
 
                        "forbidden." % plugin)
 
    return plugin
 

	
 
@@ -399,7 +399,7 @@ def authenticate(username, password, env
 

	
 
        log.info('Authenticating user using %s plugin' % plugin.__module__)
 
        # _authenticate is a wrapper for .auth() method of plugin.
 
        # it checks if .auth() sends proper data. for KallitheaExternalAuthPlugin
 
        # it checks if .auth() sends proper data. For KallitheaExternalAuthPlugin
 
        # it also maps users to Database and maps the attributes returned
 
        # from .auth() to Kallithea database. If this function returns data
 
        # then auth is correct.
kallithea/lib/auth_modules/auth_container.py
Show inline comments
 
@@ -118,7 +118,7 @@ class KallitheaAuthPlugin(auth_modules.K
 
    def get_user(self, username=None, **kwargs):
 
        """
 
        Helper method for user fetching in plugins, by default it's using
 
        simple fetch by username, but this method can be custimized in plugins
 
        simple fetch by username, but this method can be customized in plugins
 
        eg. container auth plugin to fetch user by environ params
 
        :param username: username if given to fetch
 
        :param kwargs: extra arguments needed for user fetching.
 
@@ -131,7 +131,7 @@ class KallitheaAuthPlugin(auth_modules.K
 

	
 
    def auth(self, userobj, username, password, settings, **kwargs):
 
        """
 
        Get's the container_auth username (or email). It tries to get username
 
        Gets the container_auth username (or email). It tries to get username
 
        from REMOTE_USER if this plugin is enabled, if that fails
 
        it tries to get username from HTTP_X_FORWARDED_USER if fallback header
 
        is set. clean_username extracts the username from this data if it's
 
@@ -161,8 +161,8 @@ class KallitheaAuthPlugin(auth_modules.K
 
            username = getattr(userobj, 'username')
 

	
 
        if not username:
 
            # we don't have any objects in DB user doesn't exist extrac username
 
            # from environ based on the settings
 
            # we don't have any objects in DB, user doesn't exist, extract
 
            # username from environ based on the settings
 
            username = self._get_username(environ, settings)
 

	
 
        # if cannot fetch username, it's a no-go for this plugin to proceed
kallithea/lib/auth_modules/auth_internal.py
Show inline comments
 
@@ -54,7 +54,7 @@ class KallitheaAuthPlugin(auth_modules.K
 
    def accepts(self, user, accepts_empty=True):
 
        """
 
        Custom accepts for this auth that doesn't accept empty users. We
 
        know that user exisits in database.
 
        know that user exists in database.
 
        """
 
        return super(KallitheaAuthPlugin, self).accepts(user,
 
                                                        accepts_empty=False)
kallithea/lib/base.py
Show inline comments
 
@@ -154,7 +154,7 @@ class BaseVCSController(object):
 
    def _get_by_id(self, repo_name):
 
        """
 
        Gets a special pattern _<ID> from clone url and tries to replace it
 
        with a repository_name for support of _<ID> non changable urls
 
        with a repository_name for support of _<ID> non changeable urls
 

	
 
        :param repo_name:
 
        """
 
@@ -170,7 +170,7 @@ class BaseVCSController(object):
 

	
 
    def _invalidate_cache(self, repo_name):
 
        """
 
        Set's cache for this repository for invalidation on next access
 
        Sets cache for this repository for invalidation on next access
 

	
 
        :param repo_name: full repo name, also a cache key
 
        """
kallithea/lib/caching_query.py
Show inline comments
 
@@ -124,7 +124,7 @@ def get_cache_region(name, region):
 

	
 
def _get_cache_parameters(query):
 
    """For a query with cache_region and cache_namespace configured,
 
    return the correspoinding Cache instance and cache key, based
 
    return the corresponding Cache instance and cache key, based
 
    on this query's current criterion and parameter values.
 

	
 
    """
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -210,7 +210,7 @@ def get_commits_stats(repo_name, ts_min_
 
        stats.commit_activity = json.dumps(co_day_auth_aggr)
 
        stats.commit_activity_combined = json.dumps(overview_data)
 

	
 
        log.debug('last revison %s' % last_rev)
 
        log.debug('last revision %s' % last_rev)
 
        leftovers = len(repo.revisions[last_rev:])
 
        log.debug('revisions to parse %s' % leftovers)
 

	
kallithea/lib/compat.py
Show inline comments
 
@@ -430,7 +430,7 @@ except ImportError:
 
if __py_version__ >= (2, 6):
 
    _bytes = bytes
 
else:
 
    # in py2.6 bytes is a synonim for str
 
    # in py2.6 bytes is a synonym for str
 
    _bytes = str
 

	
 
if __py_version__ >= (2, 6):
kallithea/lib/db_manage.py
Show inline comments
 
@@ -402,7 +402,7 @@ class DbManage(object):
 

	
 
    def reset_permissions(self, username):
 
        """
 
        Resets permissions to default state, usefull when old systems had
 
        Resets permissions to default state, useful when old systems had
 
        bad permissions, we must clean them up
 

	
 
        :param username:
 
@@ -534,8 +534,8 @@ class DbManage(object):
 
                                            email='anonymous@kallithea-scm.org',
 
                                            firstname='Anonymous',
 
                                            lastname='User')
 
        # based on configuration options activate/deactive this user which
 
        # controlls anonymous access
 
        # based on configuration options activate/deactivate this user which
 
        # controls anonymous access
 
        if self.cli_args.get('public_access') is False:
 
            log.info('Public access disabled')
 
            user.active = False
kallithea/lib/dbmigrate/migrate/changeset/constraint.py
Show inline comments
 
@@ -38,7 +38,7 @@ class ConstraintChangeset(object):
 
        :param engine: the database engine to use. If this is \
 
        :keyword:`None` the instance's engine will be used
 
        :type engine: :class:`sqlalchemy.engine.base.Engine`
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
 
        """
 
        # TODO: set the parent here instead of in __init__
 
@@ -52,7 +52,7 @@ class ConstraintChangeset(object):
 
        :param cascade: Issue CASCADE drop if database supports it
 
        :type engine: :class:`sqlalchemy.engine.base.Engine`
 
        :type cascade: bool
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
 
        :returns: Instance with cleared columns
 
        """
kallithea/lib/dbmigrate/migrate/changeset/databases/firebird.py
Show inline comments
 
@@ -69,7 +69,7 @@ class FBSchemaChanger(ansisql.ANSISchema
 
        """Changing NULL is not supported"""
 
        # TODO: http://www.firebirdfaq.org/faq103/
 
        raise exceptions.NotSupportedError(
 
            "Firebird does not support altering NULL bevahior.")
 
            "Firebird does not support altering NULL behavior.")
 

	
 

	
 
class FBConstraintGenerator(ansisql.ANSIConstraintGenerator):
 
@@ -77,7 +77,7 @@ class FBConstraintGenerator(ansisql.ANSI
 

	
 

	
 
class FBConstraintDropper(ansisql.ANSIConstraintDropper):
 
    """Firebird constaint dropper implementation."""
 
    """Firebird constraint dropper implementation."""
 

	
 
    def cascade_constraint(self, constraint):
 
        """Cascading constraints is not supported"""
kallithea/lib/dbmigrate/migrate/changeset/databases/postgres.py
Show inline comments
 
@@ -31,7 +31,7 @@ class PGConstraintGenerator(ansisql.ANSI
 

	
 

	
 
class PGConstraintDropper(ansisql.ANSIConstraintDropper):
 
    """PostgreSQL constaint dropper implementation."""
 
    """PostgreSQL constraint dropper implementation."""
 
    pass
 

	
 

	
kallithea/lib/dbmigrate/migrate/changeset/schema.py
Show inline comments
 
@@ -430,7 +430,7 @@ class ChangesetTable(object):
 

	
 
        API to :meth:`ChangesetColumn.drop`
 

	
 
        :param column: Column to be droped
 
        :param column: Column to be dropped
 
        :type column: Column instance or string
 
        """
 
        if not isinstance(column, sqlalchemy.Column):
 
@@ -449,7 +449,7 @@ class ChangesetTable(object):
 

	
 
        :param name: New name of the table.
 
        :type name: string
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
 
        """
 
        engine = self.bind
 
@@ -505,7 +505,7 @@ class ChangesetColumn(object):
 
`~migrate.changeset.constraint.PrimaryKeyConstraint` on this column.
 
        :param populate_default: If True, created column will be \
 
populated with defaults
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type table: Table instance
 
        :type index_name: string
 
        :type unique_name: string
 
@@ -539,7 +539,7 @@ populated with defaults
 

	
 
        ``ALTER TABLE DROP COLUMN``, for most databases.
 

	
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
 
        """
 
        if table is not None:
 
@@ -633,7 +633,7 @@ class ChangesetIndex(object):
 

	
 
        :param name: New name of the Index.
 
        :type name: string
 
        :param connection: reuse connection istead of creating new one.
 
        :param connection: reuse connection instead of creating new one.
 
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
 
        """
 
        engine = self.table.bind
kallithea/lib/dbmigrate/migrate/versioning/script/py.py
Show inline comments
 
@@ -120,7 +120,7 @@ class PythonScript(base.BaseScript):
 

	
 
    def run(self, engine, step):
 
        """Core method of Script file.
 
        Exectues :func:`update` or :func:`downgrade` functions
 
        Executes :func:`update` or :func:`downgrade` functions
 

	
 
        :param engine: SQLAlchemy Engine
 
        :param step: Operation to run
kallithea/lib/dbmigrate/migrate/versioning/shell.py
Show inline comments
 
@@ -58,7 +58,7 @@ class PassiveOptionParser(OptionParser):
 
def main(argv=None, **kwargs):
 
    """Shell interface to :mod:`migrate.versioning.api`.
 

	
 
    kwargs are default options that can be overriden with passing
 
    kwargs are default options that can be overridden with passing
 
    --some_option as command line option
 

	
 
    :param disable_logging: Let migrate configure logging
kallithea/lib/dbmigrate/schema/db_1_1_0.py
Show inline comments
 
@@ -23,7 +23,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
kallithea/lib/dbmigrate/schema/db_1_2_0.py
Show inline comments
 
@@ -88,7 +88,7 @@ class ModelSerializer(json.JSONEncoder):
 
            return json.JSONEncoder.default(self, obj)
 

	
 
class BaseModel(object):
 
    """Base Model for all classess
 
    """Base Model for all classes
 

	
 
    """
 

	
 
@@ -107,7 +107,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -784,7 +784,7 @@ class Group(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_3_0.py
Show inline comments
 
@@ -118,7 +118,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -812,7 +812,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_4_0.py
Show inline comments
 
@@ -95,7 +95,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1080,7 +1080,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_5_0.py
Show inline comments
 
@@ -94,7 +94,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1099,7 +1099,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_5_2.py
Show inline comments
 
@@ -96,7 +96,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1220,7 +1220,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_6_0.py
Show inline comments
 
@@ -96,7 +96,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1295,7 +1295,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_7_0.py
Show inline comments
 
@@ -96,7 +96,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1313,7 +1313,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_1_8_0.py
Show inline comments
 
@@ -96,7 +96,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1343,7 +1343,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_0_0.py
Show inline comments
 
@@ -97,7 +97,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1400,7 +1400,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_0_1.py
Show inline comments
 
@@ -97,7 +97,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1401,7 +1401,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_0_2.py
Show inline comments
 
@@ -97,7 +97,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1422,7 +1422,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_1_0.py
Show inline comments
 
@@ -97,7 +97,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1461,7 +1461,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_2_0.py
Show inline comments
 
@@ -98,7 +98,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1511,7 +1511,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/dbmigrate/schema/db_2_2_3.py
Show inline comments
 
@@ -98,7 +98,7 @@ class BaseModel(object):
 
        return d
 

	
 
    def get_appstruct(self):
 
        """return list with keys and values tupples corresponding
 
        """return list with keys and values tuples corresponding
 
        to this model data """
 

	
 
        l = []
 
@@ -1538,7 +1538,7 @@ class RepoGroup(Base, BaseModel):
 
            if gr is None:
 
                break
 
            if cnt == parents_recursion_limit:
 
                # this will prevent accidental infinit loops
 
                # this will prevent accidental infinite loops
 
                log.error('group nested more than %s' %
 
                          parents_recursion_limit)
 
                break
kallithea/lib/diffs.py
Show inline comments
 
@@ -202,7 +202,7 @@ class DiffProcessor(object):
 
    def __init__(self, diff, vcs='hg', format='gitdiff', diff_limit=None):
 
        """
 
        :param diff:   a text in diff format
 
        :param vcs: type of version controll hg or git
 
        :param vcs: type of version control hg or git
 
        :param format: format of diff passed, `udiff` or `gitdiff`
 
        :param diff_limit: define the size of diff that is considered "big"
 
            based on that parameter cut off will be triggered, set to None
kallithea/lib/graphmod.py
Show inline comments
 
@@ -118,7 +118,7 @@ def _colored(repo, dag):
 

	
 
        # Add unknown parents to nextrow
 
        tmprow = row[:]
 
        tmprow[col:col + 1] = reversed(addparents) # higest revs first (to the right), dead ends last (to the left)
 
        tmprow[col:col + 1] = reversed(addparents) # highest revs first (to the right), dead ends last (to the left)
 
        # Stop looking for non-existing ancestors
 
        nextrow = []
 
        for r in tmprow:
kallithea/lib/helpers.py
Show inline comments
 
@@ -124,7 +124,7 @@ safeid = _make_safe_id_component
 

	
 
def FID(raw_id, path):
 
    """
 
    Creates a uniqe ID for filenode based on it's hash of path and revision
 
    Creates a unique ID for filenode based on it's hash of path and revision
 
    it's safe to use in urls
 

	
 
    :param raw_id:
 
@@ -963,7 +963,7 @@ class Page(_Page):
 
            nav_items.append(text)
 

	
 
        for thispage in xrange(leftmost_page, rightmost_page + 1):
 
            # Hilight the current page number and do not use a link
 
            # Highlight the current page number and do not use a link
 
            if thispage == self.page:
 
                text = '%s' % (thispage,)
 
                # Wrap in a SPAN tag if nolink_attr is set
 
@@ -1262,7 +1262,7 @@ def fancy_file_stats(stats):
 

	
 
def urlify_text(text_, safe=True):
 
    """
 
    Extrac urls from text and make html links out of them
 
    Extract urls from text and make html links out of them
 

	
 
    :param text_:
 
    """
kallithea/lib/hooks.py
Show inline comments
 
@@ -15,7 +15,7 @@
 
kallithea.lib.hooks
 
~~~~~~~~~~~~~~~~~~~
 

	
 
Hooks runned by kallithea
 
Hooks run by Kallithea
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
 
@@ -377,9 +377,9 @@ handle_git_post_receive = (lambda repo_p
 

	
 
def handle_git_receive(repo_path, revs, env, hook_type='post'):
 
    """
 
    A really hacky method that is runned by git post-receive hook and logs
 
    A really hacky method that is run by git post-receive hook and logs
 
    an push action together with pushed revisions. It's executed by subprocess
 
    thus needs all info to be able to create a on the fly pylons enviroment,
 
    thus needs all info to be able to create a on the fly pylons environment,
 
    connect to database and run the logging code. Hacky as sh*t but works.
 

	
 
    :param repo_path:
kallithea/lib/ipaddr.py
Show inline comments
 
@@ -733,7 +733,7 @@ class _BaseNet(_IPAddrBase):
 
            minus other.
 

	
 
        Raises:
 
            TypeError: If self and other are of difffering address
 
            TypeError: If self and other are of differing address
 
              versions, or if other is not a network object.
 
            ValueError: If other is not completely contained by self.
 

	
kallithea/lib/markup_renderer.py
Show inline comments
 
@@ -151,7 +151,7 @@ class MarkupRenderer(object):
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            if safe:
 
                log.debug('Fallbacking to render in plain mode')
 
                log.debug('Falling back to render in plain mode')
 
                return cls.plain(source)
 
            else:
 
                raise
 
@@ -182,7 +182,7 @@ class MarkupRenderer(object):
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            if safe:
 
                log.debug('Fallbacking to render in plain mode')
 
                log.debug('Falling back to render in plain mode')
 
                return cls.plain(source)
 
            else:
 
                raise
kallithea/lib/middleware/wrapper.py
Show inline comments
 
@@ -15,7 +15,7 @@
 
kallithea.lib.middleware.wrapper
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
request time mesuring app
 
request time measuring app
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
kallithea/lib/pidlock.py
Show inline comments
 
@@ -54,7 +54,7 @@ class DaemonLock(object):
 
    def _on_finalize(lock, debug):
 
        if lock.held:
 
            if debug:
 
                print 'leck held finilazing and running lock.release()'
 
                print 'lock held finalizing and running lock.release()'
 
            lock.release()
 

	
 
    def lock(self):
 
@@ -130,7 +130,7 @@ class DaemonLock(object):
 
        """
 
        this function will make an actual lock
 

	
 
        :param lockname: acctual pid of file
 
        :param lockname: actual pid of file
 
        :param pidfile: the file to write the pid in
 
        """
 
        if self.debug:
kallithea/lib/profiler.py
Show inline comments
 
@@ -27,7 +27,7 @@ class ProfilingMiddleware(object):
 
            profiler.snapshot_stats()
 

	
 
            stats = pstats.Stats(profiler)
 
            stats.sort_stats('calls') #cummulative
 
            stats.sort_stats('calls') #cumulative
 

	
 
            # Redirect output
 
            out = StringIO()
kallithea/lib/utils2.py
Show inline comments
 
@@ -116,7 +116,7 @@ def aslist(obj, sep=None, strip=True):
 

	
 
def convert_line_endings(line, mode):
 
    """
 
    Converts a given line  "line end" accordingly to given mode
 
    Converts a given line  "line end" according to given mode
 

	
 
    Available modes are::
 
        0 - Unix
kallithea/lib/vcs/backends/base.py
Show inline comments
 
@@ -65,7 +65,7 @@ class BaseRepository(object):
 
        exists and ``create`` is set to True.
 

	
 
        :param repo_path: local path of the repository
 
        :param create=False: if set to True, would try to craete repository.
 
        :param create=False: if set to True, would try to create repository.
 
        :param src_url=None: if set, should be proper url from which repository
 
          would be cloned; requires ``create`` parameter to be set to True -
 
          raises RepositoryError if src_url is set and create evaluates to
 
@@ -633,7 +633,7 @@ class BaseChangeset(object):
 

	
 
    def walk(self, topurl=''):
 
        """
 
        Similar to os.walk method. Insted of filesystem it walks through
 
        Similar to os.walk method. Instead of filesystem it walks through
 
        changeset starting at given ``topurl``.  Returns generator of tuples
 
        (topnode, dirnodes, filenodes).
 
        """
 
@@ -961,7 +961,7 @@ class BaseInMemoryChangeset(object):
 
        :param message: message of the commit
 
        :param author: full username, i.e. "Joe Doe <joe.doe@example.com>"
 
        :param parents: single parent or sequence of parents from which commit
 
          would be derieved
 
          would be derived
 
        :param date: ``datetime.datetime`` instance. Defaults to
 
          ``datetime.datetime.now()``.
 
        :param branch: branch name, as string. If none given, default backend's
kallithea/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -323,7 +323,7 @@ class GitChangeset(BaseChangeset):
 
        """
 
        cmd = 'blame -l --root -r %s -- "%s"' % (self.id, path)
 
        # -l     ==> outputs long shas (and we need all 40 characters)
 
        # --root ==> doesn't put '^' character for bounderies
 
        # --root ==> doesn't put '^' character for boundaries
 
        # -r sha ==> blames for the given revision
 
        so, se = self.repository.run_git_command(cmd)
 

	
kallithea/lib/vcs/backends/git/inmemory.py
Show inline comments
 
@@ -20,7 +20,7 @@ class GitInMemoryChangeset(BaseInMemoryC
 
        :param message: message of the commit
 
        :param author: full username, i.e. "Joe Doe <joe.doe@example.com>"
 
        :param parents: single parent or sequence of parents from which commit
 
          would be derieved
 
          would be derived
 
        :param date: ``datetime.datetime`` instance. Defaults to
 
          ``datetime.datetime.now()``.
 
        :param branch: branch name, as string. If none given, default backend's
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -278,7 +278,7 @@ class GitRepository(BaseRepository):
 
    def _get_revision(self, revision):
 
        """
 
        For git backend we always return integer here. This way we ensure
 
        that changset's revision attribute would become integer.
 
        that changeset's revision attribute would become integer.
 
        """
 

	
 
        is_null = lambda o: len(o) == revision.count('0')
kallithea/lib/vcs/backends/hg/inmemory.py
Show inline comments
 
@@ -19,7 +19,7 @@ class MercurialInMemoryChangeset(BaseInM
 
        :param message: message of the commit
 
        :param author: full username, i.e. "Joe Doe <joe.doe@example.com>"
 
        :param parents: single parent or sequence of parents from which commit
 
          would be derieved
 
          would be derived
 
        :param date: ``datetime.datetime`` instance. Defaults to
 
          ``datetime.datetime.now()``.
 
        :param branch: branch name, as string. If none given, default backend's
kallithea/lib/vcs/conf/settings.py
Show inline comments
 
@@ -19,7 +19,7 @@ if os.path.isdir(VCSRC_PATH):
 
# list of default encoding used in safe_unicode/safe_str methods
 
DEFAULT_ENCODINGS = aslist('utf8')
 

	
 
# path to git executable runned by run_git_command function
 
# path to git executable run by run_git_command function
 
GIT_EXECUTABLE_PATH = 'git'
 
# can be also --branches --tags
 
GIT_REV_FILTER = '--all'
kallithea/lib/vcs/nodes.py
Show inline comments
 
@@ -237,7 +237,7 @@ class FileNode(Node):
 
    """
 
    Class representing file nodes.
 

	
 
    :attribute: path: path to the node, relative to repostiory's root
 
    :attribute: path: path to the node, relative to repository's root
 
    :attribute: content: if given arbitrary sets content of the file
 
    :attribute: changeset: if given, first time content is accessed, callback
 
    :attribute: mode: octal stat mode for a node. Default is 0100644.
 
@@ -479,7 +479,7 @@ class DirNode(Node):
 
    """
 
    DirNode stores list of files and directories within this node.
 
    Nodes may be used standalone but within repository context they
 
    lazily fetch data within same repositorty's changeset.
 
    lazily fetch data within same repository's changeset.
 
    """
 

	
 
    def __init__(self, path, nodes=(), changeset=None):
kallithea/lib/vcs/subprocessio.py
Show inline comments
 
@@ -229,7 +229,7 @@ class BufferedGenerator(object):
 
    @property
 
    def done_reading_event(self):
 
        """
 
        Done_reding does not mean that the iterator's buffer is empty.
 
        Done_reading does not mean that the iterator's buffer is empty.
 
        Iterator might have done reading from underlying source, but the read
 
        chunks might still be available for serving through .next() method.
 

	
 
@@ -240,7 +240,7 @@ class BufferedGenerator(object):
 
    @property
 
    def done_reading(self):
 
        """
 
        Done_reding does not mean that the iterator's buffer is empty.
 
        Done_reading does not mean that the iterator's buffer is empty.
 
        Iterator might have done reading from underlying source, but the read
 
        chunks might still be available for serving through .next() method.
 

	
 
@@ -253,15 +253,15 @@ class BufferedGenerator(object):
 
        """
 
        returns int.
 

	
 
        This is the lenght of the que of chunks, not the length of
 
        This is the length of the queue of chunks, not the length of
 
        the combined contents in those chunks.
 

	
 
        __len__() cannot be meaningfully implemented because this
 
        reader is just flying throuh a bottomless pit content and
 
        can only know the lenght of what it already saw.
 
        reader is just flying through a bottomless pit content and
 
        can only know the length of what it already saw.
 

	
 
        If __len__() on WSGI server per PEP 3333 returns a value,
 
        the responce's length will be set to that. In order not to
 
        the response's length will be set to that. In order not to
 
        confuse WSGI PEP3333 servers, we will not implement __len__
 
        at all.
 
        """
 
@@ -297,11 +297,11 @@ class SubprocessIOChunker(object):
 
       does not block the parallel inpipe reading occurring parallel thread.)
 

	
 
    The purpose of the object is to allow us to wrap subprocess interactions into
 
    and interable that can be passed to a WSGI server as the application's return
 
    an iterable that can be passed to a WSGI server as the application's return
 
    value. Because of stream-processing-ability, WSGI does not have to read ALL
 
    of the subprocess's output and buffer it, before handing it to WSGI server for
 
    HTTP response. Instead, the class initializer reads just a bit of the stream
 
    to figure out if error ocurred or likely to occur and if not, just hands the
 
    to figure out if error occurred or likely to occur and if not, just hands the
 
    further iteration over subprocess output to the server for completion of HTTP
 
    response.
 

	
kallithea/lib/vcs/utils/__init__.py
Show inline comments
 
@@ -50,7 +50,7 @@ def date_fromtimestamp(unixts, tzoffset=
 

	
 
def safe_int(val, default=None):
 
    """
 
    Returns int() of val if val is not convertable to int use default
 
    Returns int() of val if val is not convertible to int use default
 
    instead
 

	
 
    :param val:
kallithea/lib/vcs/utils/baseui_config.py
Show inline comments
 
@@ -3,7 +3,7 @@ from kallithea.lib.vcs.utils.hgcompat im
 

	
 
def make_ui(self, path='hgwebdir.config'):
 
    """
 
    A funcion that will read python rc files and make an ui from read options
 
    A function that will read python rc files and make an ui from read options
 

	
 
    :param path: path to mercurial config file
 
    """
kallithea/lib/vcs/utils/compat.py
Show inline comments
 
@@ -16,7 +16,7 @@ else:
 
if sys.version_info >= (2, 6):
 
    _bytes = bytes
 
else:
 
    # in py2.6 bytes is a synonim for str
 
    # in py2.6 bytes is a synonym for str
 
    _bytes = str
 

	
 
if sys.version_info >= (2, 6):
kallithea/lib/vcs/utils/helpers.py
Show inline comments
 
"""
 
Utitlites aimed to help achieve mostly basic tasks.
 
Utilities aimed to help achieve mostly basic tasks.
 
"""
 
from __future__ import division
 

	
kallithea/lib/vcs/utils/hgcompat.py
Show inline comments
 
@@ -30,8 +30,8 @@ from mercurial.util import url as hg_url
 
from mercurial.scmutil import revrange
 
from mercurial.node import nullrev
 

	
 
# those authnadlers are patched for python 2.6.5 bug an
 
# infinit looping when given invalid resources
 
# those authhandlers are patched for python 2.6.5 bug an
 
# infinite looping when given invalid resources
 
from mercurial.url import httpbasicauthhandler, httpdigestauthhandler
 

	
 
import inspect
kallithea/lib/vcs/utils/imports.py
Show inline comments
 
@@ -11,7 +11,7 @@ def import_class(class_path):
 
        try:
 
            hgrepo = import_class('vcs.backends.hg.MercurialRepository')
 
        except VCSError:
 
            # hadle error
 
            # handle error
 
    """
 
    splitted = class_path.split('.')
 
    mod_path = '.'.join(splitted[:-1])
kallithea/lib/vcs/utils/lockfiles.py
Show inline comments
 
@@ -57,7 +57,7 @@ class LockFile(object):
 
        if not self._has_lock():
 
            return
 

	
 
        # if someone removed our file beforhand, lets just flag this issue
 
        # if someone removed our file beforehand, lets just flag this issue
 
        # instead of failing, to make it more usable.
 
        lfp = self._lock_file_path()
 
        try:
0 comments (0 inline, 0 general)