Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
81b844a6
Commit
81b844a6
authored
Jan 22, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs
parent
1072d9a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
weblate/trans/validators.py
weblate/trans/validators.py
+13
-0
No files found.
weblate/trans/validators.py
View file @
81b844a6
...
@@ -21,6 +21,10 @@ from django.core.exceptions import ValidationError
...
@@ -21,6 +21,10 @@ from django.core.exceptions import ValidationError
def
validate_repoweb
(
val
):
def
validate_repoweb
(
val
):
'''
Validates whether URL for repository browser is valid and
can be filled in using format string.
'''
try
:
try
:
val
%
{
'file'
:
'file.po'
,
'line'
:
'9'
,
'branch'
:
'master'
}
val
%
{
'file'
:
'file.po'
,
'line'
:
'9'
,
'branch'
:
'master'
}
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -28,6 +32,9 @@ def validate_repoweb(val):
...
@@ -28,6 +32,9 @@ def validate_repoweb(val):
def
validate_commit_message
(
val
):
def
validate_commit_message
(
val
):
'''
Validates that commit message is a valid format string.
'''
try
:
try
:
val
%
{
val
%
{
'language'
:
'cs'
,
'language'
:
'cs'
,
...
@@ -45,6 +52,9 @@ def validate_commit_message(val):
...
@@ -45,6 +52,9 @@ def validate_commit_message(val):
def
validate_filemask
(
val
):
def
validate_filemask
(
val
):
'''
Validates file mask that it contains *.
'''
if
not
'*'
in
val
:
if
not
'*'
in
val
:
raise
ValidationError
(
raise
ValidationError
(
_
(
'File mask does not contain * as a language placeholder!'
)
_
(
'File mask does not contain * as a language placeholder!'
)
...
@@ -52,6 +62,9 @@ def validate_filemask(val):
...
@@ -52,6 +62,9 @@ def validate_filemask(val):
def
validate_repo
(
val
):
def
validate_repo
(
val
):
'''
Validates Git URL, and special weblate:// links.
'''
try
:
try
:
repo
=
get_linked_repo
(
val
)
repo
=
get_linked_repo
(
val
)
if
repo
is
not
None
and
repo
.
is_repo_link
():
if
repo
is
not
None
and
repo
.
is_repo_link
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment