Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
08008fdd
Commit
08008fdd
authored
13 years ago
by
Sebastien Luttringer
Browse files
Options
Downloads
Patches
Plain Diff
repository name checking moved inside reposiory class
parent
20259050
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
installsystems/repository.py
+14
-10
14 additions, 10 deletions
installsystems/repository.py
with
14 additions
and
10 deletions
installsystems/repository.py
+
14
−
10
View file @
08008fdd
...
@@ -28,6 +28,19 @@ class Repository(object):
...
@@ -28,6 +28,19 @@ class Repository(object):
Repository class
Repository class
'''
'''
@staticmethod
def
is_repository_name
(
name
):
return
re
.
match
(
"
^[-_\w]+$
"
,
name
)
is
not
None
@staticmethod
def
check_repository_name
(
name
):
'''
Raise exception is repository name is invalid
'''
if
not
Repository
.
is_repository_name
(
name
):
raise
Exception
(
"
Invalid repository name %s
"
%
name
)
return
name
@classmethod
@classmethod
def
diff
(
cls
,
repo1
,
repo2
):
def
diff
(
cls
,
repo1
,
repo2
):
'''
'''
...
@@ -694,18 +707,9 @@ class RepositoryConfig(object):
...
@@ -694,18 +707,9 @@ class RepositoryConfig(object):
Repository configuration container
Repository configuration container
'''
'''
@staticmethod
def
check_repository_name
(
name
):
'''
Raise exception is repository name is invalid
'''
if
re
.
match
(
"
^[-_\w]+$
"
,
name
)
is
None
:
raise
Exception
(
"
Invalid repository name %s
"
%
name
)
return
name
def
__init__
(
self
,
name
,
**
kwargs
):
def
__init__
(
self
,
name
,
**
kwargs
):
# set default value for arguments
# set default value for arguments
self
.
name
=
self
.
check_repository_name
(
name
)
self
.
name
=
Repository
.
check_repository_name
(
name
)
self
.
path
=
""
self
.
path
=
""
self
.
_offline
=
False
self
.
_offline
=
False
self
.
_dbpath
=
None
self
.
_dbpath
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment