diff --git a/rhodecode/config/routing.py b/rhodecode/config/routing.py --- a/rhodecode/config/routing.py +++ b/rhodecode/config/routing.py @@ -137,7 +137,7 @@ def make_map(config): m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*}", action="repo_as_fork", conditions=dict(method=["PUT"], function=check_repo)) - + with rmap.submapper(path_prefix=ADMIN_PREFIX, controller='admin/repos_groups') as m: m.connect("repos_groups", "/repos_groups", diff --git a/rhodecode/controllers/admin/notifications.py b/rhodecode/controllers/admin/notifications.py --- a/rhodecode/controllers/admin/notifications.py +++ b/rhodecode/controllers/admin/notifications.py @@ -21,7 +21,7 @@ class NotificationsController(BaseContro """REST Controller styled on the Atom Publishing Protocol""" # To properly map this controller, ensure your config/routing.py # file has a resource setup: - # map.resource('notification', 'notifications', controller='_admin/notifications', + # map.resource('notification', 'notifications', controller='_admin/notifications', # path_prefix='/_admin', name_prefix='_admin_') @LoginRequired() diff --git a/rhodecode/controllers/admin/repos.py b/rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py +++ b/rhodecode/controllers/admin/repos.py @@ -112,7 +112,7 @@ class ReposController(BaseController): c.repo_last_rev) * 100) defaults = RepoModel()._get_defaults(repo_name) - + c.repos_list = [('', _('--REMOVE FORK--'))] c.repos_list += [(x.repo_id, x.repo_name) for x in Repository.query().order_by(Repository.repo_name).all()] @@ -393,7 +393,7 @@ class ReposController(BaseController): def repo_as_fork(self, repo_name): """ Mark given repository as a fork of another - + :param repo_name: """ try: @@ -402,7 +402,7 @@ class ReposController(BaseController): self.rhodecode_user.username) fork = repo.fork.repo_name if repo.fork else _('Nothing') Session.commit() - h.flash(_('Marked repo %s as fork of %s' % (repo_name,fork)), + h.flash(_('Marked repo %s as fork of %s' % (repo_name,fork)), category='success') except Exception, e: raise diff --git a/rhodecode/controllers/admin/repos_groups.py b/rhodecode/controllers/admin/repos_groups.py --- a/rhodecode/controllers/admin/repos_groups.py +++ b/rhodecode/controllers/admin/repos_groups.py @@ -226,5 +226,3 @@ class ReposGroupsController(BaseControll encoding="UTF-8", force_defaults=False ) - - diff --git a/rhodecode/controllers/admin/users.py b/rhodecode/controllers/admin/users.py --- a/rhodecode/controllers/admin/users.py +++ b/rhodecode/controllers/admin/users.py @@ -188,7 +188,7 @@ class UsersController(BaseController): grant_perm = request.POST.get('create_repo_perm', False) user_model = UserModel() - + if grant_perm: perm = Permission.get_by_key('hg.create.none') user_model.revoke_perm(id, perm) diff --git a/rhodecode/controllers/admin/users_groups.py b/rhodecode/controllers/admin/users_groups.py --- a/rhodecode/controllers/admin/users_groups.py +++ b/rhodecode/controllers/admin/users_groups.py @@ -113,9 +113,9 @@ class UsersGroupsController(BaseControll c.available_members = [(x.user_id, x.username) for x in self.sa.query(User).all()] - + available_members = [safe_unicode(x[0]) for x in c.available_members] - + users_group_form = UsersGroupForm(edit=True, old_data=c.users_group.get_dict(), available_members=available_members)() @@ -210,7 +210,7 @@ class UsersGroupsController(BaseControll UsersGroupModel().grant_perm(id, perm) h.flash(_("Granted 'repository create' permission to user"), category='success') - + Session.commit() else: perm = Permission.get_by_key('hg.create.repository') diff --git a/rhodecode/controllers/api/__init__.py b/rhodecode/controllers/api/__init__.py --- a/rhodecode/controllers/api/__init__.py +++ b/rhodecode/controllers/api/__init__.py @@ -7,19 +7,19 @@ :created_on: Aug 20, 2011 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski + :copyright: (C) 2009-2010 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License or (at your opinion) any later version of the license. -# +# # This program 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 General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, @@ -226,7 +226,7 @@ class JSONRPCController(WSGIController): if self._error is not None: raw_response = None - response = dict(id=self._req_id, result=raw_response, + response = dict(id=self._req_id, result=raw_response, error=self._error) try: @@ -259,4 +259,3 @@ class JSONRPCController(WSGIController): return func else: raise AttributeError("No such method: %s" % self._req_method) - diff --git a/rhodecode/controllers/bookmarks.py b/rhodecode/controllers/bookmarks.py --- a/rhodecode/controllers/bookmarks.py +++ b/rhodecode/controllers/bookmarks.py @@ -45,7 +45,7 @@ class BookmarksController(BaseRepoContro def index(self): if c.rhodecode_repo.alias != 'hg': raise HTTPNotFound() - + c.repo_bookmarks = OrderedDict() bookmarks = [(name, c.rhodecode_repo.get_changeset(hash_)) for \ diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -71,21 +71,21 @@ class ChangelogController(BaseRepoContro branch_name = request.params.get('branch', None) try: if branch_name: - collection = [z for z in - c.rhodecode_repo.get_changesets(start=0, + collection = [z for z in + c.rhodecode_repo.get_changesets(start=0, branch_name=branch_name)] c.total_cs = len(collection) else: collection = list(c.rhodecode_repo) c.total_cs = len(c.rhodecode_repo) - + c.pagination = RepoPage(collection, page=p, item_count=c.total_cs, items_per_page=c.size, branch=branch_name) except (RepositoryError, ChangesetDoesNotExistError, Exception), e: log.error(traceback.format_exc()) h.flash(str(e), category='warning') - return redirect(url('home')) + return redirect(url('home')) self._graph(c.rhodecode_repo, collection, c.total_cs, c.size, p) @@ -139,4 +139,3 @@ class ChangelogController(BaseRepoContro data.append(['', vtx, edges]) c.jsdata = json.dumps(data) - diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -417,7 +417,7 @@ class FilesController(BaseRepoController c.changeset_2 = EmptyChangeset(repo=c.rhodecode_repo) node2 = FileNode('.', '', changeset=c.changeset_2) except RepositoryError: - return redirect(url('files_home', repo_name=c.repo_name, + return redirect(url('files_home', repo_name=c.repo_name, f_path=f_path)) if c.action == 'download': @@ -490,4 +490,3 @@ class FilesController(BaseRepoController _d, _f = ScmModel().get_nodes(repo_name, cs.raw_id, f_path, flat=False) return _d + _f - diff --git a/rhodecode/controllers/home.py b/rhodecode/controllers/home.py --- a/rhodecode/controllers/home.py +++ b/rhodecode/controllers/home.py @@ -66,4 +66,3 @@ class HomeController(BaseController): return render('/switch_to_list.html') else: return HTTPBadRequest() - diff --git a/rhodecode/controllers/login.py b/rhodecode/controllers/login.py --- a/rhodecode/controllers/login.py +++ b/rhodecode/controllers/login.py @@ -81,7 +81,7 @@ class LoginController(BaseController): 'session, session attrs %s' % (username, cs)) user.update_lastlogin() Session.commit() - + if c.came_from: return redirect(c.came_from) else: diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -233,4 +233,3 @@ class SummaryController(BaseRepoControll download_l.append(tags_group) return download_l - diff --git a/rhodecode/lib/__init__.py b/rhodecode/lib/__init__.py --- a/rhodecode/lib/__init__.py +++ b/rhodecode/lib/__init__.py @@ -116,12 +116,12 @@ def str2bool(_str): def convert_line_endings(line, mode): """ Converts a given line "line end" accordingly to given mode - + Available modes are:: 0 - Unix 1 - Mac 2 - DOS - + :param line: given line to convert :param mode: mode to convert to :rtype: str @@ -183,7 +183,7 @@ def generate_api_key(username, salt=None def safe_unicode(str_, from_encoding='utf8'): """ safe unicode function. Does few trick to turn str_ into unicode - + In case of UnicodeDecode error we try to return it with encoding detected by chardet library if it fails fallback to unicode with errors replaced @@ -216,7 +216,7 @@ def safe_unicode(str_, from_encoding='ut def safe_str(unicode_, to_encoding='utf8'): """ safe str function. Does few trick to turn unicode_ into string - + In case of UnicodeEncodeError we try to return it with encoding detected by chardet library if it fails fallback to string with errors replaced @@ -254,7 +254,7 @@ def safe_str(unicode_, to_encoding='utf8 def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs): """ Custom engine_from_config functions that makes sure we use NullPool for - file based sqlite databases. This prevents errors on sqlite. This only + file based sqlite databases. This prevents errors on sqlite. This only applies to sqlalchemy versions < 0.7.0 """ @@ -313,7 +313,7 @@ def engine_from_config(configuration, pr def age(curdate): """ turns a datetime into an age string. - + :param curdate: datetime object :rtype: unicode :returns: unicode words describing age @@ -350,10 +350,10 @@ def age(curdate): def uri_filter(uri): """ Removes user:password from given url string - + :param uri: :rtype: unicode - :returns: filtered list of strings + :returns: filtered list of strings """ if not uri: return '' @@ -382,7 +382,7 @@ def uri_filter(uri): def credentials_filter(uri): """ Returns a url with removed credentials - + :param uri: """ @@ -395,9 +395,9 @@ def credentials_filter(uri): def get_changeset_safe(repo, rev): """ - Safe version of get_changeset if this changeset doesn't exists for a + Safe version of get_changeset if this changeset doesn't exists for a repo it returns a Dummy one instead - + :param repo: :param rev: """ @@ -419,7 +419,7 @@ def get_current_revision(quiet=False): """ Returns tuple of (number, id) from repository containing this package or None if repository could not be found. - + :param quiet: prints error for fetching revision if True """ @@ -440,7 +440,7 @@ def get_current_revision(quiet=False): def extract_mentioned_users(s): """ Returns unique usernames from given string s that have @mention - + :param s: string to get mentions """ usrs = {} diff --git a/rhodecode/lib/annotate.py b/rhodecode/lib/annotate.py --- a/rhodecode/lib/annotate.py +++ b/rhodecode/lib/annotate.py @@ -4,10 +4,10 @@ ~~~~~~~~~~~~~~~~~~~~~~ Anontation library for usage in rhodecode, previously part of vcs - + :created_on: Dec 4, 2011 :author: marcink - :copyright: (C) 2009-2011 Marcin Kuzminski + :copyright: (C) 2009-2011 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ diff --git a/rhodecode/lib/auth.py b/rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py +++ b/rhodecode/lib/auth.py @@ -56,7 +56,7 @@ log = logging.getLogger(__name__) class PasswordGenerator(object): """ - This is a simple class for generating password from different sets of + This is a simple class for generating password from different sets of characters usage:: @@ -131,7 +131,7 @@ def check_password(password, hashed): def generate_api_key(str_, salt=None): """ Generates API KEY from given string - + :param str_: :param salt: """ @@ -144,7 +144,7 @@ def generate_api_key(str_, salt=None): def authfunc(environ, username, password): """ - Dummy authentication wrapper function used in Mercurial and Git for + Dummy authentication wrapper function used in Mercurial and Git for access control. :param environ: needed only for using in Basic auth @@ -226,8 +226,8 @@ def authenticate(username, password): if user_model.create_ldap(username, password, user_dn, user_attrs): log.info('created new ldap user %s', username) - - Session.commit() + + Session.commit() return True except (LdapUsernameError, LdapPasswordError,): pass @@ -254,7 +254,7 @@ def login_container_auth(username): user.update_lastlogin() Session.commit() - + log.debug('User %s is now logged in by container authentication', user.username) return user @@ -311,7 +311,7 @@ class AuthUser(object): if self._api_key and self._api_key != self.anonymous_user.api_key: log.debug('Auth User lookup by API KEY %s', self._api_key) is_user_loaded = user_model.fill_data(self, api_key=self._api_key) - # lookup by userid + # lookup by userid elif (self.user_id is not None and self.user_id != self.anonymous_user.user_id): log.debug('Auth User lookup by USER ID %s', self.user_id) @@ -319,7 +319,7 @@ class AuthUser(object): # lookup by username elif self.username and \ str2bool(config.get('container_auth_enabled', False)): - + log.debug('Auth User lookup by USER NAME %s', self.username) dbuser = login_container_auth(self.username) if dbuser is not None: @@ -696,4 +696,3 @@ class HasPermissionAnyMiddleware(object) return True log.debug('permission denied') return False - diff --git a/rhodecode/lib/backup_manager.py b/rhodecode/lib/backup_manager.py --- a/rhodecode/lib/backup_manager.py +++ b/rhodecode/lib/backup_manager.py @@ -3,7 +3,7 @@ rhodecode.lib.backup_manager ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Mercurial repositories backup manager, it allows to backups all + Mercurial repositories backup manager, it allows to backups all repositories and send it to backup server using RSA key via ssh. :created_on: Feb 28, 2010 diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -175,4 +175,3 @@ class BaseRepoController(BaseController) c.repository_followers = self.scm_model.get_followers(c.repo_name) c.repository_forks = self.scm_model.get_forks(c.repo_name) - diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -114,7 +114,7 @@ def get_commits_stats(repo_name, ts_min_ repo = Repository.get_by_repo_name(repo_name) if repo is None: return True - + repo = repo.scm_instance repo_size = repo.count() # return if repo have no revisions @@ -364,7 +364,7 @@ def send_email(recipients, subject, body def create_repo_fork(form_data, cur_user): """ Creates a fork of repository using interval VCS methods - + :param form_data: :param cur_user: """ @@ -392,9 +392,9 @@ def create_repo_fork(form_data, cur_user update_after_clone=update_after_clone) action_logger(cur_user, 'user_forked_repo:%s' % fork_name, org_repo_name, '', Session) - + action_logger(cur_user, 'user_created_fork:%s' % fork_name, - fork_name, '', Session) + fork_name, '', Session) # finally commit at latest possible stage Session.commit() diff --git a/rhodecode/lib/compat.py b/rhodecode/lib/compat.py --- a/rhodecode/lib/compat.py +++ b/rhodecode/lib/compat.py @@ -4,11 +4,11 @@ ~~~~~~~~~~~~~~~~~~~~ Python backward compatibility functions and common libs - - + + :created_on: Oct 7, 2011 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski + :copyright: (C) 2009-2010 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify @@ -90,7 +90,7 @@ class _Nil(object): class _odict(object): """Ordered dict data structure, with O(1) complexity for dict operations that modify one element. - + Overwriting values doesn't change their original sequential order. """ diff --git a/rhodecode/lib/dbmigrate/migrate/__init__.py b/rhodecode/lib/dbmigrate/migrate/__init__.py --- a/rhodecode/lib/dbmigrate/migrate/__init__.py +++ b/rhodecode/lib/dbmigrate/migrate/__init__.py @@ -8,4 +8,4 @@ from rhodecode.lib.dbmigrate.migrate.versioning import * from rhodecode.lib.dbmigrate.migrate.changeset import * -__version__ = '0.7.3.dev' \ No newline at end of file +__version__ = '0.7.3.dev' diff --git a/rhodecode/lib/dbmigrate/migrate/changeset/__init__.py b/rhodecode/lib/dbmigrate/migrate/changeset/__init__.py --- a/rhodecode/lib/dbmigrate/migrate/changeset/__init__.py +++ b/rhodecode/lib/dbmigrate/migrate/changeset/__init__.py @@ -12,7 +12,7 @@ from sqlalchemy import __version__ as _s warnings.simplefilter('always', DeprecationWarning) -_sa_version = tuple(int(re.match("\d+", x).group(0)) +_sa_version = tuple(int(re.match("\d+", x).group(0)) for x in _sa_version.split(".")) SQLA_06 = _sa_version >= (0, 6) SQLA_07 = _sa_version >= (0, 7) diff --git a/rhodecode/lib/dbmigrate/migrate/versioning/genmodel.py b/rhodecode/lib/dbmigrate/migrate/versioning/genmodel.py --- a/rhodecode/lib/dbmigrate/migrate/versioning/genmodel.py +++ b/rhodecode/lib/dbmigrate/migrate/versioning/genmodel.py @@ -282,4 +282,3 @@ class ModelGenerator(object): except: trans.rollback() raise - diff --git a/rhodecode/lib/dbmigrate/migrate/versioning/repository.py b/rhodecode/lib/dbmigrate/migrate/versioning/repository.py --- a/rhodecode/lib/dbmigrate/migrate/versioning/repository.py +++ b/rhodecode/lib/dbmigrate/migrate/versioning/repository.py @@ -153,7 +153,7 @@ class Repository(pathed.Pathed): def create_script(self, description, **k): """API to :meth:`migrate.versioning.version.Collection.create_new_python_version`""" - + k['use_timestamp_numbering'] = self.use_timestamp_numbering self.versions.create_new_python_version(description, **k) diff --git a/rhodecode/lib/dbmigrate/migrate/versioning/version.py b/rhodecode/lib/dbmigrate/migrate/versioning/version.py --- a/rhodecode/lib/dbmigrate/migrate/versioning/version.py +++ b/rhodecode/lib/dbmigrate/migrate/versioning/version.py @@ -60,7 +60,7 @@ class Collection(pathed.Pathed): and store them in self.versions """ super(Collection, self).__init__(path) - + # Create temporary list of files, allowing skipped version numbers. files = os.listdir(path) if '1' in files: @@ -111,7 +111,7 @@ class Collection(pathed.Pathed): script.PythonScript.create(filepath, **k) self.versions[ver] = Version(ver, self.path, [filename]) - + def create_new_sql_version(self, database, description, **k): """Create SQL files for new version""" ver = self._next_ver_num(k.pop('use_timestamp_numbering', False)) @@ -131,7 +131,7 @@ class Collection(pathed.Pathed): filepath = self._version_path(filename) script.SqlScript.create(filepath, **k) self.versions[ver].add_script(filepath) - + def version(self, vernum=None): """Returns latest Version if vernum is not given. Otherwise, returns wanted version""" @@ -150,7 +150,7 @@ class Collection(pathed.Pathed): class Version(object): """A single version in a collection - :param vernum: Version Number + :param vernum: Version Number :param path: Path to script files :param filelist: List of scripts :type vernum: int, VerNum @@ -167,7 +167,7 @@ class Version(object): for script in filelist: self.add_script(os.path.join(path, script)) - + def script(self, database=None, operation=None): """Returns SQL or Python Script""" for db in (database, 'default'): @@ -196,7 +196,7 @@ class Version(object): def _add_script_sql(self, path): basename = os.path.basename(path) match = self.SQL_FILENAME.match(basename) - + if match: basename = basename.replace('.sql', '') parts = basename.split('_') diff --git a/rhodecode/lib/dbmigrate/schema/__init__.py b/rhodecode/lib/dbmigrate/schema/__init__.py --- a/rhodecode/lib/dbmigrate/schema/__init__.py +++ b/rhodecode/lib/dbmigrate/schema/__init__.py @@ -5,10 +5,10 @@ Schemas for migrations - - + + :created_on: Nov 1, 2011 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski + :copyright: (C) 2009-2010 Marcin Kuzminski :license: , see LICENSE_FILE for more details. """ diff --git a/rhodecode/lib/dbmigrate/schema/db_1_1_0.py b/rhodecode/lib/dbmigrate/schema/db_1_1_0.py --- a/rhodecode/lib/dbmigrate/schema/db_1_1_0.py +++ b/rhodecode/lib/dbmigrate/schema/db_1_1_0.py @@ -91,4 +91,4 @@ class CacheInvalidation(Base, BaseModel) self.cache_active = False def __repr__(self): - return "" % (self.cache_id, self.cache_key) \ No newline at end of file + return "" % (self.cache_id, self.cache_key) diff --git a/rhodecode/lib/dbmigrate/schema/db_1_2_0.py b/rhodecode/lib/dbmigrate/schema/db_1_2_0.py --- a/rhodecode/lib/dbmigrate/schema/db_1_2_0.py +++ b/rhodecode/lib/dbmigrate/schema/db_1_2_0.py @@ -1044,7 +1044,7 @@ class CacheInvalidation(Base, BaseModel) Returns Invalidation object if this given key should be invalidated None otherwise. `cache_active = False` means that this cache state is not valid and needs to be invalidated - + :param key: """ return cls.query()\ @@ -1056,7 +1056,7 @@ class CacheInvalidation(Base, BaseModel) def set_invalidate(cls, key): """ Mark this Cache key for invalidation - + :param key: """ @@ -1080,7 +1080,7 @@ class CacheInvalidation(Base, BaseModel) def set_valid(cls, key): """ Mark this cache key as active and currently cached - + :param key: """ inv_obj = Session.query(CacheInvalidation)\ @@ -1095,4 +1095,3 @@ class DbMigrateVersion(Base, BaseModel): repository_id = Column('repository_id', String(250), primary_key=True) repository_path = Column('repository_path', Text) version = Column('version', Integer) - diff --git a/rhodecode/lib/dbmigrate/schema/db_1_3_0.py b/rhodecode/lib/dbmigrate/schema/db_1_3_0.py --- a/rhodecode/lib/dbmigrate/schema/db_1_3_0.py +++ b/rhodecode/lib/dbmigrate/schema/db_1_3_0.py @@ -21,4 +21,4 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/rhodecode/lib/dbmigrate/versions/002_version_1_1_0.py b/rhodecode/lib/dbmigrate/versions/002_version_1_1_0.py --- a/rhodecode/lib/dbmigrate/versions/002_version_1_1_0.py +++ b/rhodecode/lib/dbmigrate/versions/002_version_1_1_0.py @@ -71,7 +71,7 @@ def upgrade(migrate_engine): #========================================================================== from rhodecode.lib.dbmigrate.schema.db_1_1_0 import UserFollowing UserFollowing().__table__.create() - + #========================================================================== # Add table `cache_invalidation` #========================================================================== diff --git a/rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py b/rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py --- a/rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py +++ b/rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py @@ -83,7 +83,7 @@ def upgrade(migrate_engine): nullable=True, unique=False, default=None) clone_uri.create(Repository().__table__) - + #ADD downloads column# enable_downloads = Column("downloads", Boolean(), nullable=True, unique=None, default=True) enable_downloads.create(Repository().__table__) @@ -106,8 +106,8 @@ def upgrade(migrate_engine): from rhodecode.lib.dbmigrate.schema.db_1_2_0 import UserFollowing - follows_from = Column('follows_from', DateTime(timezone=False), - nullable=True, unique=None, + follows_from = Column('follows_from', DateTime(timezone=False), + nullable=True, unique=None, default=datetime.datetime.now) follows_from.create(UserFollowing().__table__) diff --git a/rhodecode/lib/dbmigrate/versions/004_version_1_3_0.py b/rhodecode/lib/dbmigrate/versions/004_version_1_3_0.py --- a/rhodecode/lib/dbmigrate/versions/004_version_1_3_0.py +++ b/rhodecode/lib/dbmigrate/versions/004_version_1_3_0.py @@ -18,7 +18,7 @@ def upgrade(migrate_engine): Don't create your own engine; bind migrate_engine to your metadata """ - + return diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -585,7 +585,7 @@ class RepoPage(Page): self.items_per_page)) self.last_page = self.first_page + self.page_count - 1 - # Make sure that the requested page number is the range of + # Make sure that the requested page number is the range of # valid pages if self.page > self.last_page: self.page = self.last_page @@ -632,7 +632,7 @@ def changed_tooltip(nodes): """ Generates a html string for changed nodes in changeset page. It limits the output to 30 entries - + :param nodes: LazyNodesGenerator """ if nodes: @@ -651,10 +651,10 @@ def repo_link(groups_and_repos): """ Makes a breadcrumbs link to repo within a group joins » on each group to create a fancy link - + ex:: group >> subgroup >> repo - + :param groups_and_repos: """ groups, repo_name = groups_and_repos @@ -672,7 +672,7 @@ def fancy_file_stats(stats): """ Displays a fancy two colored bar for number of added/deleted lines of code on file - + :param stats: two element list of added/deleted lines of code """ @@ -745,7 +745,7 @@ def rst(source): def rst_w_mentions(source): """ Wrapped rst renderer with @mention highlighting - + :param source: """ return literal('
%s
' % diff --git a/rhodecode/lib/markup_renderer.py b/rhodecode/lib/markup_renderer.py --- a/rhodecode/lib/markup_renderer.py +++ b/rhodecode/lib/markup_renderer.py @@ -3,9 +3,9 @@ rhodecode.lib.markup_renderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + Renderer for markup languages with ability to parse using rst or markdown - + :created_on: Oct 27, 2011 :author: marcink :copyright: (C) 2009-2011 Marcin Kuzminski @@ -33,18 +33,18 @@ log = logging.getLogger(__name__) class MarkupRenderer(object): RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES = ['include', 'meta', 'raw'] - + MARKDOWN_PAT = re.compile(r'md|mkdn?|mdown|markdown',re.IGNORECASE) RST_PAT = re.compile(r're?st',re.IGNORECASE) PLAIN_PAT = re.compile(r'readme',re.IGNORECASE) - + def __detect_renderer(self, source, filename=None): """ runs detection of what renderer should be used for generating html from a markup language - + filename can be also explicitly a renderer name - + :param source: :param filename: """ @@ -66,7 +66,7 @@ class MarkupRenderer(object): Renders a given filename using detected renderer it detects renderers based on file extension or mimetype. At last it will just do a simple html replacing new lines with
- + :param file_name: :param source: """ @@ -130,10 +130,9 @@ class MarkupRenderer(object): @classmethod def rst_with_mentions(cls, source): mention_pat = re.compile(r'(?:^@|\s@)(\w+)') - + def wrapp(match_obj): uname = match_obj.groups()[0] return ' **@%(uname)s** ' % {'uname':uname} mention_hl = mention_pat.sub(wrapp, source).strip() return cls.rst(mention_hl) - diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -161,7 +161,7 @@ class SimpleGit(BaseVCSController): try: user = self.__get_user(username) if user is None or not user.active: - return HTTPForbidden()(environ, start_response) + return HTTPForbidden()(environ, start_response) username = user.username except: log.error(traceback.format_exc()) @@ -199,7 +199,7 @@ class SimpleGit(BaseVCSController): def __make_app(self, repo_name, repo_path): """ Make an wsgi application using dulserver - + :param repo_name: name of the repository :param repo_path: full path to the repository """ diff --git a/rhodecode/lib/middleware/simplehg.py b/rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py +++ b/rhodecode/lib/middleware/simplehg.py @@ -225,9 +225,9 @@ class SimpleHg(BaseVCSController): def __inject_extras(self, repo_path, baseui, extras={}): """ Injects some extra params into baseui instance - + also overwrites global settings with those takes from local hgrc file - + :param baseui: baseui instance :param extras: dict with extra params to put into baseui """ @@ -249,4 +249,3 @@ class SimpleHg(BaseVCSController): for section in ui_sections: for k, v in repoui.configitems(section): baseui.setconfig(section, k, v) - diff --git a/rhodecode/lib/rcmail/exceptions.py b/rhodecode/lib/rcmail/exceptions.py --- a/rhodecode/lib/rcmail/exceptions.py +++ b/rhodecode/lib/rcmail/exceptions.py @@ -5,7 +5,7 @@ class InvalidMessage(RuntimeError): as recipients or sender address. """ -class BadHeaders(RuntimeError): +class BadHeaders(RuntimeError): """ Raised if message contains newlines in headers. """ diff --git a/rhodecode/lib/rcmail/message.py b/rhodecode/lib/rcmail/message.py --- a/rhodecode/lib/rcmail/message.py +++ b/rhodecode/lib/rcmail/message.py @@ -13,11 +13,11 @@ class Attachment(object): :param disposition: content-disposition (if any) """ - def __init__(self, - filename=None, - content_type=None, + def __init__(self, + filename=None, + content_type=None, data=None, - disposition=None): + disposition=None): self.filename = filename self.content_type = content_type @@ -47,11 +47,11 @@ class Message(object): :param attachments: list of Attachment instances """ - def __init__(self, - subject=None, - recipients=None, - body=None, - html=None, + def __init__(self, + subject=None, + recipients=None, + body=None, + html=None, sender=None, cc=None, bcc=None, @@ -78,7 +78,7 @@ class Message(object): """ Returns raw email.Message instance.Validates message first. """ - + self.validate() return self.get_response().to_message() @@ -88,7 +88,7 @@ class Message(object): Creates a Lamson MailResponse instance """ - response = MailResponse(Subject=self.subject, + response = MailResponse(Subject=self.subject, To=self.recipients, From=self.sender, Body=self.body, @@ -102,20 +102,20 @@ class Message(object): for attachment in self.attachments: - response.attach(attachment.filename, - attachment.content_type, - attachment.data, + response.attach(attachment.filename, + attachment.content_type, + attachment.data, attachment.disposition) response.update(self.extra_headers) return response - + def is_bad_headers(self): """ Checks for bad headers i.e. newlines in subject, sender or recipients. """ - + headers = [self.subject, self.sender] headers += list(self.send_to) headers += self.extra_headers.values() @@ -125,7 +125,7 @@ class Message(object): if c in val: return True return False - + def validate(self): """ Checks if message is valid and raises appropriate exception. @@ -146,15 +146,15 @@ class Message(object): def add_recipient(self, recipient): """ Adds another recipient to the message. - + :param recipient: email address of recipient. """ - + self.recipients.append(recipient) def add_cc(self, recipient): """ - Adds an email address to the CC list. + Adds an email address to the CC list. :param recipient: email address of recipient. """ @@ -163,7 +163,7 @@ class Message(object): def add_bcc(self, recipient): """ - Adds an email address to the BCC list. + Adds an email address to the BCC list. :param recipient: email address of recipient. """ @@ -178,5 +178,3 @@ class Message(object): """ self.attachments.append(attachment) - - diff --git a/rhodecode/lib/rcmail/response.py b/rhodecode/lib/rcmail/response.py --- a/rhodecode/lib/rcmail/response.py +++ b/rhodecode/lib/rcmail/response.py @@ -48,7 +48,7 @@ VALUE_IS_EMAIL_ADDRESS = lambda v: '@' i def normalize_header(header): return string.capwords(header.lower(), '-') -class EncodingError(Exception): +class EncodingError(Exception): """Thrown when there is an encoding error.""" pass @@ -61,7 +61,7 @@ class MailBase(object): self.headers = dict(items) self.parts = [] self.body = None - self.content_encoding = {'Content-Type': (None, {}), + self.content_encoding = {'Content-Type': (None, {}), 'Content-Disposition': (None, {}), 'Content-Transfer-Encoding': (None, {})} @@ -312,7 +312,7 @@ class MailResponse(object): def to_message(mail): """ - Given a MailBase message, this will construct a MIMEPart + Given a MailBase message, this will construct a MIMEPart that is canonicalized for use with the Python email API. """ ctype, params = mail.content_encoding['Content-Type'] diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -201,7 +201,7 @@ def is_valid_repo(repo_name, base_path): def is_valid_repos_group(repos_group_name, base_path): """ Returns True if given path is a repos group False otherwise - + :param repo_name: :param base_path: """ @@ -461,7 +461,7 @@ def add_cache(settings): def create_test_index(repo_location, config, full_index): """ Makes default test index - + :param config: test config :param full_index: """ @@ -597,4 +597,4 @@ class BasePasterCommand(Command): path_to_ini_file = os.path.realpath(conf) conf = paste.deploy.appconfig('config:' + path_to_ini_file) - pylonsconfig.init_app(conf.global_conf, conf.local_conf) \ No newline at end of file + pylonsconfig.init_app(conf.global_conf, conf.local_conf) diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -96,7 +96,7 @@ class BaseModel(object): def get_dict(self, serialized=False): """ return dict with keys and values corresponding - to this model data + to this model data """ d = {} @@ -106,7 +106,7 @@ class BaseModel(object): # also use __json__() if present to get additional fields if hasattr(self, '__json__'): for k, val in self.__json__().iteritems(): - d[k] = val + d[k] = val return d def get_appstruct(self): @@ -970,7 +970,7 @@ class CacheInvalidation(Base, BaseModel) Returns Invalidation object if this given key should be invalidated None otherwise. `cache_active = False` means that this cache state is not valid and needs to be invalidated - + :param key: """ return cls.query()\ @@ -982,7 +982,7 @@ class CacheInvalidation(Base, BaseModel) def set_invalidate(cls, key): """ Mark this Cache key for invalidation - + :param key: """ @@ -1006,7 +1006,7 @@ class CacheInvalidation(Base, BaseModel) def set_valid(cls, key): """ Mark this cache key as active and currently cached - + :param key: """ inv_obj = CacheInvalidation.query()\ @@ -1037,7 +1037,7 @@ class ChangesetComment(Base, BaseModel): """ Returns user associated with this changesetComment. ie those who actually commented - + :param cls: :param revision: """ @@ -1120,4 +1120,3 @@ class DbMigrateVersion(Base, BaseModel): repository_id = Column('repository_id', String(250), primary_key=True) repository_path = Column('repository_path', Text) version = Column('version', Integer) - diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -483,7 +483,7 @@ class LoginForm(formencode.Schema): ) remember = StringBoolean(if_missing=False) - + chained_validators = [ValidAuth] def UserForm(edit=False, old_data={}): diff --git a/rhodecode/model/notification.py b/rhodecode/model/notification.py --- a/rhodecode/model/notification.py +++ b/rhodecode/model/notification.py @@ -68,7 +68,7 @@ class NotificationModel(BaseModel): notification :param subject: :param body: - :param recipients: list of int, str or User objects, when None + :param recipients: list of int, str or User objects, when None is given send to all admins :param type_: type of notification :param with_email: send email with this notification @@ -206,7 +206,7 @@ class EmailNotificationModel(BaseModel): def get_email_tmpl(self, type_, **kwargs): """ return generated template for email based on given type - + :param type_: """ @@ -217,5 +217,3 @@ class EmailNotificationModel(BaseModel): _kwargs.update(kwargs) log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) return email_template.render(**_kwargs) - - diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -94,9 +94,9 @@ class RepoModel(BaseModel): def _get_defaults(self, repo_name): """ - Get's information about repository, and returns a dict for + Get's information about repository, and returns a dict for usage in forms - + :param repo_name: """ @@ -299,7 +299,7 @@ class RepoModel(BaseModel): def create_fork(self, form_data, cur_user): """ Simple wrapper into executing celery task for fork creation - + :param form_data: :param cur_user: """ @@ -340,7 +340,7 @@ class RepoModel(BaseModel): def delete_stats(self, repo_name): """ removes stats for given repo - + :param repo_name: """ try: @@ -427,4 +427,3 @@ class RepoModel(BaseModel): % (datetime.today()\ .strftime('%Y%m%d_%H%M%S_%f'), repo.repo_name))) - diff --git a/rhodecode/model/repo_permission.py b/rhodecode/model/repo_permission.py --- a/rhodecode/model/repo_permission.py +++ b/rhodecode/model/repo_permission.py @@ -63,7 +63,7 @@ class RepositoryPermissionModel(BaseMode .filter(UsersGroupRepoToPerm.repository == repository) \ .scalar() - def update_users_group_permission(self, repository, users_group, + def update_users_group_permission(self, repository, users_group, permission): permission = Permission.get_by_key(permission) current = self.get_users_group_permission(repository, users_group) @@ -94,4 +94,4 @@ class RepositoryPermissionModel(BaseMode self.update_users_group_permission(repository, user_group, permission) else: - self.delete_users_group_permission(repository, user_group) \ No newline at end of file + self.delete_users_group_permission(repository, user_group) diff --git a/rhodecode/model/repos_group.py b/rhodecode/model/repos_group.py --- a/rhodecode/model/repos_group.py +++ b/rhodecode/model/repos_group.py @@ -68,7 +68,7 @@ class ReposGroupModel(BaseModel): def __rename_group(self, old, new): """ Renames a group on filesystem - + :param group_name: """ @@ -92,7 +92,7 @@ class ReposGroupModel(BaseModel): def __delete_group(self, group): """ Deletes a group from a filesystem - + :param group: instance of group from database """ paths = group.full_path.split(RepoGroup.url_sep()) @@ -136,7 +136,7 @@ class ReposGroupModel(BaseModel): self.__rename_group(old_path, new_path) - # we need to get all repositories from this new group and + # we need to get all repositories from this new group and # rename them accordingly to new group path for r in repos_group.repositories: r.repo_name = r.get_new_name(r.just_name) diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -97,7 +97,7 @@ class UserModel(BaseModel): active=True, admin=False, ldap_dn=None): """ Creates a new instance if not found, or updates current one - + :param username: :param password: :param email: @@ -140,7 +140,7 @@ class UserModel(BaseModel): def create_for_container_auth(self, username, attrs): """ Creates the given user if it's not already in the database - + :param username: :param attrs: """ @@ -173,7 +173,7 @@ class UserModel(BaseModel): """ Checks if user is in database, if not creates this user marked as ldap user - + :param username: :param password: :param user_dn: @@ -283,7 +283,7 @@ class UserModel(BaseModel): def delete(self, user): user = self.__get_user(user) - + try: if user.username == 'default': raise DefaultUserException( @@ -498,9 +498,9 @@ class UserModel(BaseModel): if not isinstance(perm, Permission): raise Exception('perm needs to be an instance of Permission class ' 'got %s instead' % type(perm)) - + user = self.__get_user(user) - + obj = UserToPerm.query().filter(UserToPerm.user == user)\ .filter(UserToPerm.permission == perm).scalar() if obj: diff --git a/rhodecode/model/users_group.py b/rhodecode/model/users_group.py --- a/rhodecode/model/users_group.py +++ b/rhodecode/model/users_group.py @@ -82,7 +82,7 @@ class UsersGroupModel(BaseModel): def delete(self, users_group): try: users_group = self.__get_users_group(users_group) - + # check if this group is not assigned to repo assigned_groups = UsersGroupRepoToPerm.query()\ .filter(UsersGroupRepoToPerm.users_group == users_group).all() @@ -90,7 +90,7 @@ class UsersGroupModel(BaseModel): if assigned_groups: raise UsersGroupsAssignedException('RepoGroup assigned to %s' % assigned_groups) - + self.sa.delete(users_group) except: log.error(traceback.format_exc()) @@ -141,12 +141,10 @@ class UsersGroupModel(BaseModel): def revoke_perm(self, users_group, perm): if not isinstance(perm, Permission): raise Exception('perm needs to be an instance of Permission class') - + users_group = self.__get_users_group(users_group) - + obj = UsersGroupToPerm.query()\ .filter(UsersGroupToPerm.users_group == users_group)\ .filter(UsersGroupToPerm.permission == perm).one() self.sa.delete(obj) - - diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py --- a/rhodecode/tests/__init__.py +++ b/rhodecode/tests/__init__.py @@ -44,7 +44,7 @@ log = logging.getLogger(__name__) ##RUNNING DESIRED TESTS # nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account -# nosetests --pdb --pdb-failures +# nosetests --pdb --pdb-failures environ = {} #SOME GLOBALS FOR TESTS @@ -107,4 +107,3 @@ class TestController(TestCase): def checkSessionFlash(self, response, msg): self.assertTrue('flash' in response.session) self.assertTrue(msg in response.session['flash'][0][1]) - diff --git a/rhodecode/tests/functional/test_admin_ldap_settings.py b/rhodecode/tests/functional/test_admin_ldap_settings.py --- a/rhodecode/tests/functional/test_admin_ldap_settings.py +++ b/rhodecode/tests/functional/test_admin_ldap_settings.py @@ -22,7 +22,7 @@ class TestLdapSettingsController(TestCon self.log_user() if skip_ldap_test: raise SkipTest('skipping due to missing ldap lib') - + test_url = url(controller='admin/ldap_settings', action='ldap_settings') @@ -53,7 +53,7 @@ class TestLdapSettingsController(TestCon self.log_user() if skip_ldap_test: raise SkipTest('skipping due to missing ldap lib') - + test_url = url(controller='admin/ldap_settings', action='ldap_settings') @@ -71,13 +71,13 @@ class TestLdapSettingsController(TestCon 'ldap_attr_firstname':'', 'ldap_attr_lastname':'', 'ldap_attr_email':'' }) - + self.assertTrue("""The LDAP Login""" """ attribute of the CN must be specified""" in response.body) - - - + + + self.assertTrue("""Please """ """enter a number""" in response.body) diff --git a/rhodecode/tests/functional/test_admin_users.py b/rhodecode/tests/functional/test_admin_users.py --- a/rhodecode/tests/functional/test_admin_users.py +++ b/rhodecode/tests/functional/test_admin_users.py @@ -23,7 +23,7 @@ class TestAdminUsersController(TestContr lastname = 'lastname' email = 'mail@mail.com' - response = self.app.post(url('users'), + response = self.app.post(url('users'), {'username':username, 'password':password, 'password_confirmation':password_confirmation, @@ -33,7 +33,7 @@ class TestAdminUsersController(TestContr 'email':email}) - self.assertTrue('''created user %s''' % (username) in + self.assertTrue('''created user %s''' % (username) in response.session['flash'][0]) new_user = self.Session.query(User).\ @@ -108,12 +108,12 @@ class TestAdminUsersController(TestContr .filter(User.username == username).one() response = self.app.delete(url('user', id=new_user.user_id)) - self.assertTrue("""successfully deleted user""" in + self.assertTrue("""successfully deleted user""" in response.session['flash'][0]) def test_delete_browser_fakeout(self): - response = self.app.post(url('user', id=1), + response = self.app.post(url('user', id=1), params=dict(_method='delete')) def test_show(self): diff --git a/rhodecode/tests/functional/test_admin_users_groups.py b/rhodecode/tests/functional/test_admin_users_groups.py --- a/rhodecode/tests/functional/test_admin_users_groups.py +++ b/rhodecode/tests/functional/test_admin_users_groups.py @@ -85,7 +85,3 @@ class TestAdminUsersGroupsController(Tes def test_revoke_members(self): pass - - - - diff --git a/rhodecode/tests/functional/test_branches.py b/rhodecode/tests/functional/test_branches.py --- a/rhodecode/tests/functional/test_branches.py +++ b/rhodecode/tests/functional/test_branches.py @@ -9,9 +9,3 @@ class TestBranchesController(TestControl response.mustcontain("""default""" % HG_REPO) response.mustcontain("""git""" % HG_REPO) response.mustcontain("""web""" % HG_REPO) - - - - - - diff --git a/rhodecode/tests/functional/test_changeset_comments.py b/rhodecode/tests/functional/test_changeset_comments.py --- a/rhodecode/tests/functional/test_changeset_comments.py +++ b/rhodecode/tests/functional/test_changeset_comments.py @@ -137,7 +137,3 @@ class TestChangeSetCommentrController(Te repo_name=HG_REPO, revision=rev)) self.assertTrue('''
0 comment(s)''' ''' (0 inline)
''' in response.body) - - - - diff --git a/rhodecode/tests/functional/test_files.py b/rhodecode/tests/functional/test_files.py --- a/rhodecode/tests/functional/test_files.py +++ b/rhodecode/tests/functional/test_files.py @@ -314,13 +314,10 @@ removed extra unicode conversion in diff def test_ajaxed_files_list(self): self.log_user() - rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' + rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' response = self.app.get(url('files_nodelist_home',repo_name=HG_REPO, f_path='/', revision=rev), extra_environ={'HTTP_X_PARTIAL_XHR':'1'}, ) self.assertTrue("vcs/web/simplevcs/views/repository.py" in response.body) - - - diff --git a/rhodecode/tests/functional/test_summary.py b/rhodecode/tests/functional/test_summary.py --- a/rhodecode/tests/functional/test_summary.py +++ b/rhodecode/tests/functional/test_summary.py @@ -9,7 +9,7 @@ class TestSummaryController(TestControll self.log_user() ID = Repository.get_by_repo_name(HG_REPO).repo_id response = self.app.get(url(controller='summary', - action='index', + action='index', repo_name=HG_REPO)) #repo type @@ -44,7 +44,7 @@ class TestSummaryController(TestControll self.log_user() ID = Repository.get_by_repo_name(HG_REPO).repo_id response = self.app.get(url(controller='summary', - action='index', + action='index', repo_name='_%s' % ID)) #repo type diff --git a/rhodecode/tests/functional/test_tags.py b/rhodecode/tests/functional/test_tags.py --- a/rhodecode/tests/functional/test_tags.py +++ b/rhodecode/tests/functional/test_tags.py @@ -10,4 +10,3 @@ class TestTagsController(TestController) response.mustcontain("""0.1.3""" % HG_REPO) response.mustcontain("""0.1.2""" % HG_REPO) response.mustcontain("""0.1.1""" % HG_REPO) - diff --git a/rhodecode/tests/rhodecode_crawler.py b/rhodecode/tests/rhodecode_crawler.py --- a/rhodecode/tests/rhodecode_crawler.py +++ b/rhodecode/tests/rhodecode_crawler.py @@ -6,7 +6,7 @@ Test for crawling a project for memory usage This should be runned just as regular script together with a watch script that will show memory usage. - + watch -n1 ./rhodecode/tests/mem_watch :created_on: Apr 21, 2010 diff --git a/rhodecode/tests/test_libs.py b/rhodecode/tests/test_libs.py --- a/rhodecode/tests/test_libs.py +++ b/rhodecode/tests/test_libs.py @@ -5,7 +5,7 @@ Package for testing various lib/helper functions in rhodecode - + :created_on: Jun 9, 2011 :copyright: (C) 2009-2011 Marcin Kuzminski :license: GPLv3, see COPYING for more details. @@ -112,5 +112,3 @@ class TestLibs(unittest.TestCase): s = ['2one_more22', 'D', 'MARCIN', 'first', 'lukaszb', 'maRCiN', 'marcink', 'one'] self.assertEqual(s, extract_mentioned_users(sample)) - - diff --git a/rhodecode/tests/test_models.py b/rhodecode/tests/test_models.py --- a/rhodecode/tests/test_models.py +++ b/rhodecode/tests/test_models.py @@ -161,7 +161,7 @@ class TestUser(unittest.TestCase): def __init__(self, methodName='runTest'): Session.remove() super(TestUser, self).__init__(methodName=methodName) - + def test_create_and_remove(self): usr = UserModel().create_or_update(username=u'test_user', password=u'qweqwe', email=u'u232@rhodecode.org', @@ -370,13 +370,13 @@ class TestUsers(unittest.TestCase): self.u1 = UserModel().create_or_update(username=u'u1', password=u'qweqwe', email=u'u1@rhodecode.org', - name=u'u1', lastname=u'u1') + name=u'u1', lastname=u'u1') def tearDown(self): perm = Permission.query().all() for p in perm: UserModel().revoke_perm(self.u1, p) - + UserModel().delete(self.u1) Session.commit() @@ -402,9 +402,3 @@ class TestUsers(unittest.TestCase): UserModel().revoke_perm(self.u1, perm) Session.commit() self.assertEqual(UserModel().has_perm(self.u1, perm),False) - - - - - -