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
6db7ecc9
Commit
6db7ecc9
authored
Jan 18, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
81ba8eba
babf3f85
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
21 deletions
+85
-21
weblate/settings_jenkins.py
weblate/settings_jenkins.py
+6
-0
weblate/trans/management/commands/__init__.py
weblate/trans/management/commands/__init__.py
+13
-0
weblate/trans/management/commands/commit_pending.py
weblate/trans/management/commands/commit_pending.py
+2
-10
weblate/trans/management/commands/loadpo.py
weblate/trans/management/commands/loadpo.py
+3
-11
weblate/trans/tests/__init__.py
weblate/trans/tests/__init__.py
+1
-0
weblate/trans/tests/test_models.py
weblate/trans/tests/test_models.py
+60
-0
No files found.
weblate/settings_jenkins.py
View file @
6db7ecc9
...
...
@@ -19,3 +19,9 @@ PROJECT_APPS = (
)
PYLINT_RCFILE
=
os
.
path
.
join
(
WEB_ROOT
,
'..'
,
'pylint.rc'
)
# Different root for test repos
GIT_ROOT
=
'%s/test-repos/'
%
WEB_ROOT
# Avoid migrating during testsuite
SOUTH_TESTS_MIGRATE
=
False
weblate/trans/management/commands/__init__.py
View file @
6db7ecc9
...
...
@@ -81,3 +81,16 @@ class WeblateCommand(BaseCommand):
result
|=
found
return
result
class
WeblateLangCommand
(
WeblateCommand
):
option_list
=
WeblateCommand
.
option_list
+
(
make_option
(
'--lang'
,
action
=
'store'
,
type
=
'string'
,
dest
=
'lang'
,
default
=
None
,
help
=
'Limit only to given languages (comma separated list)'
),
)
weblate/trans/management/commands/commit_pending.py
View file @
6db7ecc9
...
...
@@ -18,13 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
weblate.trans.management.commands
import
WeblateCommand
from
weblate.trans.management.commands
import
Weblate
Lang
Command
from
django.utils
import
timezone
from
datetime
import
timedelta
from
optparse
import
make_option
class
Command
(
WeblateCommand
):
class
Command
(
Weblate
Lang
Command
):
help
=
'commits pending changes older than given age'
option_list
=
WeblateCommand
.
option_list
+
(
make_option
(
...
...
@@ -35,14 +35,6 @@ class Command(WeblateCommand):
default
=
24
,
help
=
'Age of changes to commit in hours (default is 24 hours)'
),
make_option
(
'--lang'
,
action
=
'store'
,
type
=
'string'
,
dest
=
'lang'
,
default
=
None
,
help
=
'Limit only to given languages (comma separated list)'
),
)
def
handle
(
self
,
*
args
,
**
options
):
...
...
weblate/trans/management/commands/loadpo.py
View file @
6db7ecc9
...
...
@@ -18,13 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
weblate.trans.management.commands
import
WeblateCommand
from
weblate.trans.management.commands
import
Weblate
Lang
Command
from
optparse
import
make_option
class
Command
(
WeblateCommand
):
class
Command
(
Weblate
Lang
Command
):
help
=
'(re)loads translations from disk'
option_list
=
WeblateCommand
.
option_list
+
(
option_list
=
Weblate
Lang
Command
.
option_list
+
(
make_option
(
'--force'
,
action
=
'store_true'
,
...
...
@@ -32,14 +32,6 @@ class Command(WeblateCommand):
default
=
False
,
help
=
'Force rereading files even when they should be up to date'
),
make_option
(
'--lang'
,
action
=
'store'
,
type
=
'string'
,
dest
=
'lang'
,
default
=
None
,
help
=
'Limit only to given languages (comma separated list)'
),
)
def
handle
(
self
,
*
args
,
**
options
):
...
...
weblate/trans/tests/__init__.py
View file @
6db7ecc9
from
test_checks
import
*
from
test_models
import
*
weblate/trans/tests/test_models.py
0 → 100644
View file @
6db7ecc9
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Tests for translation models.
"""
from
django.test
import
TestCase
from
django.conf
import
settings
import
shutil
import
os
from
weblate.trans.models
import
(
Project
,
)
class
RepoTestCase
(
TestCase
):
'''
Generic class for tests working with repositories.
'''
def
setUp
(
self
):
if
'test-repos'
in
settings
.
GIT_ROOT
:
if
os
.
path
.
exists
(
settings
.
GIT_ROOT
):
shutil
.
rmtree
(
settings
.
GIT_ROOT
)
def
create_project
(
self
):
'''
Creates test project.
'''
return
Project
.
objects
.
create
(
name
=
'Test'
,
slug
=
'test'
,
web
=
'http://weblate.org/'
)
class
ProjectTest
(
RepoTestCase
):
'''
Project object testing.
'''
def
test_create
(
self
):
project
=
self
.
create_project
()
self
.
assertTrue
(
os
.
path
.
exists
(
project
.
get_path
()))
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