apps: modernize for python3
This commit is contained in:
parent
230f12827e
commit
4026ee36ee
97 changed files with 72 additions and 254 deletions
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -56,8 +54,8 @@ URL_NAME_REQUIREMENTS = {
|
|||
# file path eats up everything at the end
|
||||
'f_path': r'.*',
|
||||
# reference types
|
||||
'source_ref_type': '(branch|book|tag|rev|\%\(source_ref_type\)s)',
|
||||
'target_ref_type': '(branch|book|tag|rev|\%\(target_ref_type\)s)',
|
||||
'source_ref_type': r'(branch|book|tag|rev|\%\(source_ref_type\)s)',
|
||||
'target_ref_type': r'(branch|book|tag|rev|\%\(target_ref_type\)s)',
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -94,7 +92,7 @@ def _format_ref_id(name, raw_id):
|
|||
|
||||
def _format_ref_id_svn(name, raw_id):
|
||||
"""Special way of formatting a reference for Subversion including path"""
|
||||
return '%s@%s' % (name, raw_id)
|
||||
return '{}@{}'.format(name, raw_id)
|
||||
|
||||
|
||||
class TemplateArgs(StrictAttributeDict):
|
||||
|
|
@ -231,7 +229,7 @@ class BaseAppView(object):
|
|||
class RepoAppView(BaseAppView):
|
||||
|
||||
def __init__(self, context, request):
|
||||
super(RepoAppView, self).__init__(context, request)
|
||||
super().__init__(context, request)
|
||||
self.db_repo = request.db_repo
|
||||
self.db_repo_name = self.db_repo.repo_name
|
||||
self.db_repo_pull_requests = ScmModel().get_pull_requests(self.db_repo)
|
||||
|
|
@ -261,7 +259,7 @@ class RepoAppView(BaseAppView):
|
|||
|
||||
def _get_local_tmpl_context(self, include_app_defaults=True):
|
||||
_ = self.request.translate
|
||||
c = super(RepoAppView, self)._get_local_tmpl_context(
|
||||
c = super()._get_local_tmpl_context(
|
||||
include_app_defaults=include_app_defaults)
|
||||
|
||||
# register common vars for this type of view
|
||||
|
|
@ -353,7 +351,7 @@ class RepoAppView(BaseAppView):
|
|||
return None, None
|
||||
landing_commit_id = landing_commit.raw_id
|
||||
|
||||
cache_namespace_uid = 'repo.{}'.format(db_repo.repo_id)
|
||||
cache_namespace_uid = f'repo.{db_repo.repo_id}'
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid, use_async_runner=True)
|
||||
start = time.time()
|
||||
|
||||
|
|
@ -477,13 +475,13 @@ class PathFilter(object):
|
|||
|
||||
class RepoGroupAppView(BaseAppView):
|
||||
def __init__(self, context, request):
|
||||
super(RepoGroupAppView, self).__init__(context, request)
|
||||
super().__init__(context, request)
|
||||
self.db_repo_group = request.db_repo_group
|
||||
self.db_repo_group_name = self.db_repo_group.group_name
|
||||
|
||||
def _get_local_tmpl_context(self, include_app_defaults=True):
|
||||
_ = self.request.translate
|
||||
c = super(RepoGroupAppView, self)._get_local_tmpl_context(
|
||||
c = super()._get_local_tmpl_context(
|
||||
include_app_defaults=include_app_defaults)
|
||||
c.repo_group = self.db_repo_group
|
||||
return c
|
||||
|
|
@ -502,14 +500,14 @@ class RepoGroupAppView(BaseAppView):
|
|||
|
||||
class UserGroupAppView(BaseAppView):
|
||||
def __init__(self, context, request):
|
||||
super(UserGroupAppView, self).__init__(context, request)
|
||||
super().__init__(context, request)
|
||||
self.db_user_group = request.db_user_group
|
||||
self.db_user_group_name = self.db_user_group.users_group_name
|
||||
|
||||
|
||||
class UserAppView(BaseAppView):
|
||||
def __init__(self, context, request):
|
||||
super(UserAppView, self).__init__(context, request)
|
||||
super().__init__(context, request)
|
||||
self.db_user = request.db_user
|
||||
self.db_user_id = self.db_user.user_id
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2018-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -80,7 +78,7 @@ class ExceptionsTrackerView(BaseAppView):
|
|||
exc_metadata = exc_tracking.exc_unserialize(f.read())
|
||||
exc.update(exc_metadata)
|
||||
except Exception:
|
||||
log.exception('Failed to read exc data from:{}'.format(full_path))
|
||||
log.exception(f'Failed to read exc data from:{full_path}')
|
||||
pass
|
||||
# convert our timestamp to a date obj, for nicer representation
|
||||
exc['exc_utc_date'] = time_to_utcdatetime(exc['exc_timestamp'])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -410,7 +408,7 @@ class AdminPermissionsView(BaseAppView, DataGridAppView):
|
|||
base_q = UserSshKeys.query().join(UserSshKeys.user)
|
||||
|
||||
if search_q:
|
||||
like_expression = u'%{}%'.format(safe_str(search_q))
|
||||
like_expression = f'%{safe_str(search_q)}%'
|
||||
base_q = base_q.filter(or_(
|
||||
User.username.ilike(like_expression),
|
||||
UserSshKeys.ssh_key_fingerprint.ilike(like_expression),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -132,14 +130,14 @@ class AdminProcessManagementView(BaseAppView):
|
|||
try:
|
||||
p.terminate()
|
||||
except psutil.AccessDenied as e:
|
||||
log.warning('Access denied: {}'.format(e))
|
||||
log.warning(f'Access denied: {e}')
|
||||
|
||||
gone, alive = psutil.wait_procs(procs, timeout=10, callback=on_terminate)
|
||||
for p in alive:
|
||||
try:
|
||||
p.kill()
|
||||
except psutil.AccessDenied as e:
|
||||
log.warning('Access denied: {}'.format(e))
|
||||
log.warning(f'Access denied: {e}')
|
||||
|
||||
return {'result': result}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -182,7 +180,7 @@ class AdminRepoGroupsView(BaseAppView, DataGridAppView):
|
|||
base_q = base_q.group_by(RepoGroup, OwnerUser)
|
||||
|
||||
if search_q:
|
||||
like_expression = u'%{}%'.format(safe_str(search_q))
|
||||
like_expression = f'%{safe_str(search_q)}%'
|
||||
base_q = base_q.filter(or_(
|
||||
RepoGroup.group_name.ilike(like_expression),
|
||||
))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -117,7 +115,7 @@ class AdminReposView(BaseAppView, DataGridAppView):
|
|||
.join(OwnerUser, Repository.user_id == OwnerUser.user_id)
|
||||
|
||||
if search_q:
|
||||
like_expression = u'%{}%'.format(safe_str(search_q))
|
||||
like_expression = f'%{safe_str(search_q)}%'
|
||||
base_q = base_q.filter(or_(
|
||||
Repository.repo_name.ilike(like_expression),
|
||||
))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -464,7 +463,7 @@ class AdminSettingsView(BaseAppView):
|
|||
except formencode.Invalid as errors:
|
||||
log.exception('Failed to add new pattern')
|
||||
error = errors
|
||||
h.flash(_('Invalid issue tracker pattern: {}'.format(error)),
|
||||
h.flash(_(f'Invalid issue tracker pattern: {error}'),
|
||||
category='error')
|
||||
raise HTTPFound(h.route_path('admin_settings_issuetracker'))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -399,7 +397,7 @@ class MyAccountView(BaseAppView, DataGridAppView):
|
|||
channelstream_request(channelstream_config, [payload], '/message')
|
||||
except ChannelstreamException as e:
|
||||
log.exception('Failed to send channelstream data')
|
||||
return {"response": 'ERROR: {}'.format(e.__class__.__name__)}
|
||||
return {"response": f'ERROR: {e.__class__.__name__}'}
|
||||
return {"response": 'Channelstream data sent. '
|
||||
'You should see a new live message now.'}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2017-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -52,7 +50,7 @@ class RepoCachesView(RepoAppView):
|
|||
c.cached_diff_size = system_info.get_storage_size(cached_diffs_dir)
|
||||
c.shadow_repos = c.rhodecode_db_repo.shadow_repos()
|
||||
|
||||
cache_namespace_uid = 'repo.{}'.format(self.db_repo.repo_id)
|
||||
cache_namespace_uid = f'repo.{self.db_repo.repo_id}'
|
||||
c.region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
c.backend = c.region.backend
|
||||
c.repo_keys = sorted(c.region.backend.list_keys(prefix=cache_namespace_uid))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -111,7 +110,7 @@ class RepoChangelogView(RepoAppView):
|
|||
|
||||
def _check_if_valid_branch(self, branch_name, repo_name, f_path):
|
||||
if branch_name not in self.rhodecode_vcs_repo.branches_all:
|
||||
h.flash(u'Branch {} is not found.'.format(h.escape(safe_str(branch_name))),
|
||||
h.flash(f'Branch {h.escape(safe_str(branch_name))} is not found.',
|
||||
category='warning')
|
||||
redirect_url = h.route_path(
|
||||
'repo_commits_file', repo_name=repo_name,
|
||||
|
|
@ -300,7 +299,7 @@ class RepoChangelogView(RepoAppView):
|
|||
c.selected_name = branch_name or book_name
|
||||
if branch_name and branch_name not in self.rhodecode_vcs_repo.branches_all:
|
||||
return wrap_for_error(
|
||||
safe_str('Branch: {} is not valid'.format(branch_name)))
|
||||
safe_str(f'Branch: {branch_name} is not valid'))
|
||||
|
||||
pre_load = self.get_commit_preload_attrs()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -383,7 +382,7 @@ class RepoCommitsView(RepoAppView):
|
|||
resolves_comment_id = entry['resolves_comment_id']
|
||||
f_path = entry['f_path']
|
||||
line_no = entry['line']
|
||||
target_elem_id = 'file-{}'.format(h.safeid(h.safe_str(f_path)))
|
||||
target_elem_id = f'file-{h.safeid(h.safe_str(f_path))}'
|
||||
|
||||
if status:
|
||||
text = text or (_('Status change %(transition_icon)s %(status)s')
|
||||
|
|
@ -579,7 +578,7 @@ class RepoCommitsView(RepoAppView):
|
|||
self.request.response.status = 400
|
||||
return {'store_fid': None,
|
||||
'access_path': None,
|
||||
'error': '{} data field is missing'.format(upload_key)}
|
||||
'error': f'{upload_key} data field is missing'}
|
||||
|
||||
if not hasattr(file_obj, 'filename'):
|
||||
self.request.response.status = 400
|
||||
|
|
@ -628,7 +627,7 @@ class RepoCommitsView(RepoAppView):
|
|||
file_uid=store_uid, filename=metadata["filename"],
|
||||
file_hash=metadata["sha256"], file_size=metadata["size"],
|
||||
file_display_name=file_display_name,
|
||||
file_description=u'comment attachment `{}`'.format(safe_str(filename)),
|
||||
file_description=f'comment attachment `{safe_str(filename)}`',
|
||||
hidden=True, check_acl=True, user_id=self._rhodecode_user.user_id,
|
||||
scope_repo_id=self.db_repo.repo_id
|
||||
)
|
||||
|
|
@ -640,7 +639,7 @@ class RepoCommitsView(RepoAppView):
|
|||
self.request.response.status = 400
|
||||
return {'store_fid': None,
|
||||
'access_path': None,
|
||||
'error': 'File {} failed to store in DB.'.format(filename)}
|
||||
'error': f'File {filename} failed to store in DB.'}
|
||||
|
||||
Session().commit()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2012-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2017-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -99,7 +97,7 @@ class RepoFeedView(RepoAppView):
|
|||
has_hidden_changes=has_hidden_changes
|
||||
)
|
||||
|
||||
def _set_timezone(self, date, tzinfo=datetime.timezone.utc):
|
||||
def _set_timezone(self, date, tzinfo=datetime.UTC):
|
||||
if not getattr(date, "tzinfo", None):
|
||||
date.replace(tzinfo=tzinfo)
|
||||
return date
|
||||
|
|
@ -131,7 +129,7 @@ class RepoFeedView(RepoAppView):
|
|||
self.load_default_context()
|
||||
force_recache = self.get_recache_flag()
|
||||
|
||||
cache_namespace_uid = 'repo_feed.{}'.format(self.db_repo.repo_id)
|
||||
cache_namespace_uid = f'repo_feed.{self.db_repo.repo_id}'
|
||||
condition = not (self.path_filter.is_enabled or force_recache)
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
|
||||
|
|
@ -178,7 +176,7 @@ class RepoFeedView(RepoAppView):
|
|||
self.load_default_context()
|
||||
force_recache = self.get_recache_flag()
|
||||
|
||||
cache_namespace_uid = 'repo_feed.{}'.format(self.db_repo.repo_id)
|
||||
cache_namespace_uid = f'repo_feed.{self.db_repo.repo_id}'
|
||||
condition = not (self.path_filter.is_enabled or force_recache)
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -312,7 +310,7 @@ class RepoFilesView(RepoAppView):
|
|||
'with caching: %s[TTL: %ss]' % (
|
||||
repo_id, commit_id, f_path, cache_on, cache_seconds or 0))
|
||||
|
||||
cache_namespace_uid = 'repo.{}'.format(repo_id)
|
||||
cache_namespace_uid = f'repo.{repo_id}'
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
|
||||
@region.conditional_cache_on_arguments(namespace=cache_namespace_uid, condition=cache_on)
|
||||
|
|
@ -387,7 +385,7 @@ class RepoFilesView(RepoAppView):
|
|||
|
||||
# we used a ref, or a shorter version, lets redirect client ot use explicit hash
|
||||
if commit_id != commit.raw_id:
|
||||
fname='{}{}'.format(commit.raw_id, ext)
|
||||
fname=f'{commit.raw_id}{ext}'
|
||||
raise HTTPFound(self.request.current_route_path(fname=fname))
|
||||
|
||||
try:
|
||||
|
|
@ -772,7 +770,7 @@ class RepoFilesView(RepoAppView):
|
|||
prev_url = h.route_path(
|
||||
'repo_files:annotated', repo_name=self.db_repo_name,
|
||||
commit_id=prev_commit_id, f_path=f_path,
|
||||
_anchor='L{}'.format(line_anchor))
|
||||
_anchor=f'L{line_anchor}')
|
||||
|
||||
raise HTTPFound(prev_url)
|
||||
|
||||
|
|
@ -792,7 +790,7 @@ class RepoFilesView(RepoAppView):
|
|||
try:
|
||||
dir_node = commit.get_node(f_path)
|
||||
except RepositoryError as e:
|
||||
return Response('error: {}'.format(h.escape(safe_str(e))))
|
||||
return Response(f'error: {h.escape(safe_str(e))}')
|
||||
|
||||
if dir_node.is_file():
|
||||
return Response('')
|
||||
|
|
@ -921,7 +919,7 @@ class RepoFilesView(RepoAppView):
|
|||
'with caching: %s[TTL: %ss]' % (
|
||||
repo_id, commit_id, f_path, cache_on, cache_seconds or 0))
|
||||
|
||||
cache_namespace_uid = 'repo.{}'.format(repo_id)
|
||||
cache_namespace_uid = f'repo.{repo_id}'
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
|
||||
@region.conditional_cache_on_arguments(namespace=cache_namespace_uid, condition=cache_on)
|
||||
|
|
@ -998,7 +996,7 @@ class RepoFilesView(RepoAppView):
|
|||
commits_group = ([], _("Changesets"))
|
||||
for commit in commits:
|
||||
branch = ' (%s)' % commit.branch if commit.branch else ''
|
||||
n_desc = 'r%s:%s%s' % (commit.idx, commit.short_id, branch)
|
||||
n_desc = 'r{}:{}{}'.format(commit.idx, commit.short_id, branch)
|
||||
commits_group[0].append((commit.raw_id, n_desc, 'sha'))
|
||||
history.append(commits_group)
|
||||
|
||||
|
|
@ -1086,7 +1084,7 @@ class RepoFilesView(RepoAppView):
|
|||
c.file_last_commit = file_node.last_commit
|
||||
if self.request.GET.get('annotate') == '1':
|
||||
# use _hist from annotation if annotation mode is on
|
||||
commit_ids = set(x[1] for x in file_node.annotate)
|
||||
commit_ids = {x[1] for x in file_node.annotate}
|
||||
_hist = (
|
||||
self.rhodecode_vcs_repo.get_commit(commit_id)
|
||||
for commit_id in commit_ids)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -102,7 +100,7 @@ class RepoForksView(RepoAppView, DataGridAppView):
|
|||
.filter(Repository.repo_id.in_(allowed_ids))\
|
||||
|
||||
if search_q:
|
||||
like_expression = u'%{}%'.format(safe_str(search_q))
|
||||
like_expression = f'%{safe_str(search_q)}%'
|
||||
base_q = base_q.filter(or_(
|
||||
Repository.repo_name.ilike(like_expression),
|
||||
Repository.description.ilike(like_expression),
|
||||
|
|
@ -174,7 +172,7 @@ class RepoForksView(RepoAppView, DataGridAppView):
|
|||
defaults = RepoModel()._get_defaults(self.db_repo_name)
|
||||
# alter the description to indicate a fork
|
||||
defaults['description'] = (
|
||||
'fork of repository: %s \n%s' % (
|
||||
'fork of repository: {} \n{}'.format(
|
||||
defaults['repo_name'], defaults['description']))
|
||||
# add suffix to fork
|
||||
defaults['repo_name'] = '%s-fork' % defaults['repo_name']
|
||||
|
|
@ -235,7 +233,7 @@ class RepoForksView(RepoAppView, DataGridAppView):
|
|||
return Response(html)
|
||||
except Exception:
|
||||
log.exception(
|
||||
u'Exception while trying to fork the repository %s', self.db_repo_name)
|
||||
'Exception while trying to fork the repository %s', self.db_repo_name)
|
||||
msg = _('An error occurred during repository forking %s') % (self.db_repo_name, )
|
||||
h.flash(msg, category='error')
|
||||
raise HTTPFound(h.route_path('home'))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -932,7 +930,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
.filter(Repository.fork_id == self.db_repo.parent.repo_id)
|
||||
|
||||
if filter_query:
|
||||
ilike_expression = u'%{}%'.format(safe_str(filter_query))
|
||||
ilike_expression = f'%{safe_str(filter_query)}%'
|
||||
parents_query = parents_query.filter(
|
||||
Repository.repo_name.ilike(ilike_expression))
|
||||
parents = parents_query.limit(20).all()
|
||||
|
|
@ -952,7 +950,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
.filter(~Repository.repo_id.in_([x.repo_id for x in parent_target_repos]))
|
||||
|
||||
if filter_query:
|
||||
ilike_expression = u'%{}%'.format(safe_str(filter_query))
|
||||
ilike_expression = f'%{safe_str(filter_query)}%'
|
||||
query = query.filter(Repository.repo_name.ilike(ilike_expression))
|
||||
|
||||
limit = max(20 - len(parent_target_repos), 5) # not less then 5
|
||||
|
|
@ -1274,7 +1272,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
|
||||
if pull_request.is_closed():
|
||||
log.debug('update: forbidden because pull request is closed')
|
||||
msg = _(u'Cannot update closed pull requests.')
|
||||
msg = _('Cannot update closed pull requests.')
|
||||
h.flash(msg, category='error')
|
||||
return {'response': True,
|
||||
'redirect_url': redirect_url}
|
||||
|
|
@ -1306,8 +1304,8 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
if is_state_changing:
|
||||
log.debug('commits update: forbidden because pull request is in state %s',
|
||||
pull_request.pull_request_state)
|
||||
msg = _(u'Cannot update pull requests commits in state other than `{}`. '
|
||||
u'Current state is: `{}`').format(
|
||||
msg = _('Cannot update pull requests commits in state other than `{}`. '
|
||||
'Current state is: `{}`').format(
|
||||
PullRequest.STATE_CREATED, pull_request.pull_request_state)
|
||||
h.flash(msg, category='error')
|
||||
return {'response': True,
|
||||
|
|
@ -1343,13 +1341,13 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
self.request.POST.get('description_renderer'),
|
||||
self._rhodecode_user)
|
||||
except ValueError:
|
||||
msg = _(u'Cannot update closed pull requests.')
|
||||
msg = _('Cannot update closed pull requests.')
|
||||
h.flash(msg, category='error')
|
||||
return
|
||||
else:
|
||||
Session().commit()
|
||||
|
||||
msg = _(u'Pull request title & description updated.')
|
||||
msg = _('Pull request title & description updated.')
|
||||
h.flash(msg, category='success')
|
||||
return
|
||||
|
||||
|
|
@ -1376,9 +1374,9 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
else:
|
||||
changed = 'nothing'
|
||||
|
||||
msg = _(u'Pull request updated to "{source_commit_id}" with '
|
||||
u'{count_added} added, {count_removed} removed commits. '
|
||||
u'Source of changes: {change_source}.')
|
||||
msg = _('Pull request updated to "{source_commit_id}" with '
|
||||
'{count_added} added, {count_removed} removed commits. '
|
||||
'Source of changes: {change_source}.')
|
||||
msg = msg.format(
|
||||
source_commit_id=pull_request.source_ref_parts.commit_id,
|
||||
count_added=len(resp.changes.added),
|
||||
|
|
@ -1406,7 +1404,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
try:
|
||||
reviewers = validate_default_reviewers(review_members, reviewer_rules)
|
||||
except ValueError as e:
|
||||
log.error('Reviewers Validation: {}'.format(e))
|
||||
log.error(f'Reviewers Validation: {e}')
|
||||
h.flash(e, category='error')
|
||||
return
|
||||
|
||||
|
|
@ -1432,7 +1430,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
try:
|
||||
observers = validate_observers(review_members, reviewer_rules)
|
||||
except ValueError as e:
|
||||
log.error('Observers Validation: {}'.format(e))
|
||||
log.error(f'Observers Validation: {e}')
|
||||
h.flash(e, category='error')
|
||||
return
|
||||
|
||||
|
|
@ -1464,8 +1462,8 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
if pull_request.is_state_changing():
|
||||
log.debug('show: forbidden because pull request is in state %s',
|
||||
pull_request.pull_request_state)
|
||||
msg = _(u'Cannot merge pull requests in state other than `{}`. '
|
||||
u'Current state is: `{}`').format(PullRequest.STATE_CREATED,
|
||||
msg = _('Cannot merge pull requests in state other than `{}`. '
|
||||
'Current state is: `{}`').format(PullRequest.STATE_CREATED,
|
||||
pull_request.pull_request_state)
|
||||
h.flash(msg, category='error')
|
||||
raise HTTPFound(
|
||||
|
|
@ -1566,7 +1564,7 @@ class RepoPullRequestsView(RepoAppView, DataGridAppView):
|
|||
close_pull_request = entry['close_pull_request']
|
||||
f_path = entry['f_path']
|
||||
line_no = entry['line']
|
||||
target_elem_id = 'file-{}'.format(h.safeid(h.safe_str(f_path)))
|
||||
target_elem_id = f'file-{h.safeid(h.safe_str(f_path))}'
|
||||
|
||||
# the logic here should work like following, if we submit close
|
||||
# pr comment, use `close_pull_request_with_comment` function
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -231,7 +229,7 @@ class RepoSettingsView(RepoAppView):
|
|||
c.stats_percentage = 0
|
||||
else:
|
||||
c.stats_percentage = '%.2f' % (
|
||||
(float((last_rev)) / c.repo_last_rev) * 100)
|
||||
(float(last_rev) / c.repo_last_rev) * 100)
|
||||
return self._get_template_context(c)
|
||||
|
||||
@LoginRequired()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2017-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2017-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -110,7 +108,7 @@ class RepoSettingsIssueTrackersView(RepoAppView):
|
|||
except formencode.Invalid as errors:
|
||||
log.exception('Failed to add new pattern')
|
||||
error = errors
|
||||
h.flash(_('Invalid issue tracker pattern: {}'.format(error)),
|
||||
h.flash(_(f'Invalid issue tracker pattern: {error}'),
|
||||
category='error')
|
||||
raise HTTPFound(
|
||||
h.route_path('edit_repo_issuetracker',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2017-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -161,7 +159,7 @@ class RepoSummaryView(RepoAppView):
|
|||
'with caching: %s[TTL: %ss]' % (
|
||||
repo_id, landing_commit, cache_on, cache_seconds or 0))
|
||||
|
||||
cache_namespace_uid = 'repo.{}'.format(repo_id)
|
||||
cache_namespace_uid = f'repo.{repo_id}'
|
||||
region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid)
|
||||
|
||||
@region.conditional_cache_on_arguments(namespace=cache_namespace_uid,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -195,7 +194,7 @@ class TestSearchController(TestController):
|
|||
_, kwargs = search_mock.call_args
|
||||
assert isinstance(kwargs['filter'], query.Or)
|
||||
expected_repositories = [
|
||||
'vcs_test_{}'.format(b) for b in enabled_backends]
|
||||
f'vcs_test_{b}' for b in enabled_backends]
|
||||
queried_repositories = [
|
||||
name for type_, name in kwargs['filter'].all_terms()]
|
||||
for repository in expected_repositories:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2011-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -97,7 +95,7 @@ def perform_search(request, tmpl_context, repo_name=None, repo_group_name=None):
|
|||
search_tags = searcher.extract_search_tags(search_query)
|
||||
|
||||
if not search_result['error']:
|
||||
execution_time = '%s results (%.4f seconds)' % (
|
||||
execution_time = '{} results ({:.4f} seconds)'.format(
|
||||
search_result['count'],
|
||||
search_result['runtime'])
|
||||
elif not errors:
|
||||
|
|
@ -122,7 +120,7 @@ def perform_search(request, tmpl_context, repo_name=None, repo_group_name=None):
|
|||
c.sort_tag = None
|
||||
c.sort_tag_dir = direction
|
||||
if sort_definition:
|
||||
c.sort = '{}:{}'.format(direction, sort_field)
|
||||
c.sort = f'{direction}:{sort_field}'
|
||||
c.sort_tag = sort_field
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -107,7 +105,7 @@ class VcsServer(object):
|
|||
'make_lock': None,
|
||||
'locked_by': [None, None],
|
||||
'server_url': None,
|
||||
'user_agent': '{}/ssh-user-agent'.format(self.repo_user_agent),
|
||||
'user_agent': f'{self.repo_user_agent}/ssh-user-agent',
|
||||
'hooks': ['push', 'pull'],
|
||||
'hooks_module': 'rhodecode.lib.hooks_daemon',
|
||||
'is_shadow_repo': False,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -63,7 +61,7 @@ class GitServer(VcsServer):
|
|||
|
||||
def __init__(self, store, ini_path, repo_name, repo_mode,
|
||||
user, user_permissions, config, env):
|
||||
super(GitServer, self).\
|
||||
super().\
|
||||
__init__(user, user_permissions, config, env)
|
||||
|
||||
self.store = store
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -101,7 +99,7 @@ class MercurialServer(VcsServer):
|
|||
cli_flags = ['phases', 'largefiles', 'extensions', 'experimental', 'hooks']
|
||||
|
||||
def __init__(self, store, ini_path, repo_name, user, user_permissions, config, env):
|
||||
super(MercurialServer, self).__init__(user, user_permissions, config, env)
|
||||
super().__init__(user, user_permissions, config, env)
|
||||
|
||||
self.store = store
|
||||
self.ini_path = ini_path
|
||||
|
|
@ -142,7 +140,7 @@ class MercurialServer(VcsServer):
|
|||
flags = []
|
||||
for _sec, key_val in ui_sections.items():
|
||||
flags.append(' ')
|
||||
flags.append('[{}]'.format(_sec))
|
||||
flags.append(f'[{_sec}]')
|
||||
for key, val in key_val:
|
||||
flags.append('{}= {}'.format(key, val))
|
||||
flags.append(f'{key}= {val}')
|
||||
return flags
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -126,7 +124,7 @@ class SubversionTunnelWrapper(object):
|
|||
def _svn_string(self, str_):
|
||||
if not str_:
|
||||
return ''
|
||||
return '{length}:{string} '.format(length=len(str_), string=str_)
|
||||
return f'{len(str_)}:{str_} '
|
||||
|
||||
def _read_first_client_response(self):
|
||||
buffer_ = ""
|
||||
|
|
@ -226,7 +224,7 @@ class SubversionServer(VcsServer):
|
|||
|
||||
def __init__(self, store, ini_path, repo_name,
|
||||
user, user_permissions, config, env):
|
||||
super(SubversionServer, self)\
|
||||
super()\
|
||||
.__init__(user, user_permissions, config, env)
|
||||
self.store = store
|
||||
self.ini_path = ini_path
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -31,9 +29,9 @@ class TestModDavSvnConfig(object):
|
|||
|
||||
@classmethod
|
||||
def setup_class(cls):
|
||||
cls.location_root = u'/location/root/çµäö'
|
||||
cls.parent_path_root = u'/parent/path/çµäö'
|
||||
cls.realm = u'Dummy Realm (äöüçµ)'
|
||||
cls.location_root = '/location/root/çµäö'
|
||||
cls.parent_path_root = '/parent/path/çµäö'
|
||||
cls.realm = 'Dummy Realm (äöüçµ)'
|
||||
|
||||
@classmethod
|
||||
def get_repo_group_mocks(cls, count=1):
|
||||
|
|
@ -47,12 +45,12 @@ class TestModDavSvnConfig(object):
|
|||
return repo_groups
|
||||
|
||||
def assert_root_location_directive(self, config):
|
||||
pattern = u'<Location "{location}">'.format(
|
||||
pattern = '<Location "{location}">'.format(
|
||||
location=self.location_root)
|
||||
assert len(re.findall(pattern, config)) == 1
|
||||
|
||||
def assert_group_location_directive(self, config, group_path):
|
||||
pattern = u'<Location "{location}{group_path}">'.format(
|
||||
pattern = '<Location "{location}{group_path}">'.format(
|
||||
location=self.location_root, group_path=group_path)
|
||||
assert len(re.findall(pattern, config)) == 1
|
||||
|
||||
|
|
@ -78,7 +76,7 @@ class TestModDavSvnConfig(object):
|
|||
def test_render_mod_dav_svn_config_with_alternative_template(self, tmpdir):
|
||||
repo_groups = self.get_repo_group_mocks(count=10)
|
||||
test_file_path = os.path.join(str(tmpdir), 'example.mako')
|
||||
with open(test_file_path, 'wt') as f:
|
||||
with open(test_file_path, 'w') as f:
|
||||
f.write('TEST_EXAMPLE\n')
|
||||
|
||||
generated_config = utils._render_mod_dav_svn_config(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
# Copyright (C) 2016-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue