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
f010757c
Commit
f010757c
authored
Sep 16, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move helper to appsettings, not used anywhere else
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
aae9110c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
18 deletions
+16
-18
weblate/appsettings.py
weblate/appsettings.py
+15
-1
weblate/trans/scripts.py
weblate/trans/scripts.py
+0
-16
weblate/trans/tests/test_util.py
weblate/trans/tests/test_util.py
+1
-1
No files found.
weblate/appsettings.py
View file @
f010757c
...
...
@@ -19,10 +19,24 @@
#
from
django.conf
import
settings
from
weblate.trans.scripts
import
get_script_choices
import
os
def
get_script_name
(
name
):
'''
Returns script name from string possibly containing full path and
parameters.
'''
return
os
.
path
.
basename
(
name
).
split
()[
0
]
def
get_script_choices
(
choices
):
"""Generates list of script choice in the Admin interface."""
return
[
(
script
,
get_script_name
(
script
))
for
script
in
choices
]
+
[(
''
,
''
)]
def
getvalue
(
name
,
default
):
"""
Returns setting from django settings with default value.
...
...
weblate/trans/scripts.py
View file @
f010757c
...
...
@@ -20,26 +20,10 @@
#
"""Hook scripts handling"""
import
os.path
import
subprocess
from
weblate.trans.util
import
get_clean_env
def
get_script_name
(
name
):
'''
Returns script name from string possibly containing full path and
parameters.
'''
return
os
.
path
.
basename
(
name
).
split
()[
0
]
def
get_script_choices
(
choices
):
"""Generates list of script choice in the Admin interface."""
return
[
(
script
,
get_script_name
(
script
))
for
script
in
choices
]
+
[(
''
,
''
)]
def
run_post_push_script
(
component
):
"""Run post push hook"""
run_hook
(
component
,
None
,
component
.
post_push_script
)
...
...
weblate/trans/tests/test_util.py
View file @
f010757c
...
...
@@ -20,7 +20,7 @@
from
unittest
import
TestCase
from
weblate.trans.util
import
cleanup_repo_url
from
weblate.
trans.script
s
import
get_script_name
from
weblate.
appsetting
s
import
get_script_name
class
HideCredentialsTest
(
TestCase
):
...
...
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