mirror of
https://abf.rosa.ru/djam/abf-console-client-src.git
synced 2025-02-23 18:02:50 +00:00
Ignore trailing '/' in project names
This commit is contained in:
parent
226742dc8a
commit
3548d84aee
1 changed files with 6 additions and 6 deletions
12
abf.py
12
abf.py
|
@ -694,7 +694,7 @@ def search():
|
|||
|
||||
def get_project_name_only(must_exist=True, name=None):
|
||||
if name:
|
||||
tmp = name.split('/')
|
||||
tmp = name.rstrip('/').split('/')
|
||||
if len(tmp) > 2:
|
||||
log.error(_('The project format is "[owner_name/]project_name"'))
|
||||
exit(1)
|
||||
|
@ -743,7 +743,7 @@ def get_maintainer_id(models, name):
|
|||
return user_id
|
||||
|
||||
def split_repo_name(fullname):
|
||||
items = fullname.split('/')
|
||||
items = fullname.rstrip('/').split('/')
|
||||
if len(items) == 2:
|
||||
repo_name = items[1]
|
||||
pl_name = items[0]
|
||||
|
@ -787,7 +787,7 @@ def get_repo_id(repo_name, pl_name):
|
|||
def get():
|
||||
log.debug(_('GET started'))
|
||||
proj = command_line.project
|
||||
tmp = proj.split('/')
|
||||
tmp = proj.rstrip('/').split('/')
|
||||
if len(tmp) > 2:
|
||||
log.error(_('Specify a project name as "group_name/project_name" or just "project_name"'))
|
||||
exit(1)
|
||||
|
@ -1329,7 +1329,7 @@ def build(return_ids=False):
|
|||
available_repos = proj.repositories
|
||||
|
||||
if command_line.save_to_repository:
|
||||
items = command_line.save_to_repository.split('/')
|
||||
items = command_line.save_to_repository.rstrip('/').split('/')
|
||||
else:
|
||||
items = []
|
||||
if len(items) == 2:
|
||||
|
@ -1381,7 +1381,7 @@ def build(return_ids=False):
|
|||
build_repositories = []
|
||||
if command_line.repository:
|
||||
for repo in command_line.repository:
|
||||
items = repo.split('/')
|
||||
items = repo.rstrip('/').split('/')
|
||||
if len(items) == 2:
|
||||
repo_name = items[1]
|
||||
pl_name = items[0]
|
||||
|
@ -1610,7 +1610,7 @@ def locate():
|
|||
print(_("To show a project location, you have to specify a project name ('-p' option)"))
|
||||
return
|
||||
|
||||
tmp = command_line.project.split('/')
|
||||
tmp = command_line.project.rstrip('/').split('/')
|
||||
if len(tmp) > 2:
|
||||
log.error(_('error: the project format is "[owner_name/]project_name"'))
|
||||
exit(1)
|
||||
|
|
Loading…
Add table
Reference in a new issue