Fix some stuff with logins and permissions, add tags to the mode.
This commit is contained in:
parent
744c73509b
commit
08446ef59e
10 changed files with 94 additions and 34 deletions
22
util/names.py
Normal file
22
util/names.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import urllib
|
||||
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def parse_namespace_repository(repository):
|
||||
parts = repository.rstrip('/').split('/', 1)
|
||||
if len(parts) < 2:
|
||||
namespace = 'library'
|
||||
repository = parts[0]
|
||||
else:
|
||||
(namespace, repository) = parts
|
||||
repository = urllib.quote_plus(repository)
|
||||
return (namespace, repository)
|
||||
|
||||
|
||||
def parse_repository_name(f):
|
||||
@wraps(f)
|
||||
def wrapper(repository, *args, **kwargs):
|
||||
(namespace, repository) = parse_namespace_repository(repository)
|
||||
return f(namespace, repository, *args, **kwargs)
|
||||
return wrapper
|
Reference in a new issue