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
79870bdc
Commit
79870bdc
authored
Aug 15, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify imports
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
ad35a15b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
17 deletions
+9
-17
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+3
-5
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+2
-4
weblate/trans/models/unit.py
weblate/trans/models/unit.py
+3
-5
weblate/trans/models/unitdata.py
weblate/trans/models/unitdata.py
+1
-3
No files found.
weblate/trans/models/subproject.py
View file @
79870bdc
...
...
@@ -36,6 +36,7 @@ from weblate.trans.filelock import FileLock
from
weblate.trans.util
import
is_repo_link
from
weblate.trans.util
import
get_site_url
from
weblate.trans.util
import
sleep_while_git_locked
from
weblate.trans.models.translation
import
Translation
from
weblate.trans.validators
import
(
validate_repoweb
,
validate_filemask
,
validate_extra_file
,
validate_autoaccept
,
...
...
@@ -43,6 +44,8 @@ from weblate.trans.validators import (
)
from
weblate.lang.models
import
Language
from
weblate.appsettings
import
SCRIPT_CHOICES
from
weblate.accounts.models
import
notify_merge_failure
from
weblate.trans.models.changes
import
Change
def
validate_repo
(
val
):
...
...
@@ -718,7 +721,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
Sends out notifications on merge failure.
'''
# Notify subscribed users about failure
from
weblate.accounts.models
import
notify_merge_failure
notify_merge_failure
(
self
,
error
,
status
)
def
update_branch
(
self
,
request
=
None
):
...
...
@@ -787,7 +789,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'''
Loads translations from git.
'''
from
weblate.trans.models.translation
import
Translation
translations
=
[]
for
path
in
self
.
get_mask_matches
():
code
=
self
.
get_lang_code
(
path
)
...
...
@@ -1175,7 +1176,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'''
Returns date of last change done in Weblate.
'''
from
weblate.trans.models.changes
import
Change
try
:
change
=
Change
.
objects
.
content
().
filter
(
translation__subproject
=
self
...
...
@@ -1200,8 +1200,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
'''
Creates new language file.
'''
from
weblate.trans.models.translation
import
Translation
if
self
.
project
.
new_lang
!=
'add'
:
raise
ValueError
(
'Not supported operation!'
)
...
...
weblate/trans/models/translation.py
View file @
79870bdc
...
...
@@ -47,6 +47,8 @@ from weblate.trans.util import (
from
weblate.accounts.avatar
import
get_user_display
from
weblate.trans.mixins
import
URLMixin
,
PercentMixin
from
weblate.trans.boolean_sum
import
BooleanSum
from
weblate.accounts.models
import
notify_new_string
from
weblate.trans.models.changes
import
Change
class
TranslationManager
(
models
.
Manager
):
...
...
@@ -491,7 +493,6 @@ class Translation(models.Model, URLMixin, PercentMixin):
'''
Checks whether database is in sync with git and possibly does update.
'''
from
weblate.trans.models.changes
import
Change
if
change
is
None
:
change
=
Change
.
ACTION_UPDATE
...
...
@@ -595,7 +596,6 @@ class Translation(models.Model, URLMixin, PercentMixin):
# Notify subscribed users
if
was_new
:
from
weblate.accounts.models
import
notify_new_string
notify_new_string
(
self
)
@
property
...
...
@@ -1138,8 +1138,6 @@ class Translation(models.Model, URLMixin, PercentMixin):
'''
Merges translate-toolkit store into current translation.
'''
from
weblate.trans.models.changes
import
Change
# Merge with lock acquired
with
self
.
subproject
.
git_lock
:
...
...
weblate/trans/models/unit.py
View file @
79870bdc
...
...
@@ -31,7 +31,9 @@ from weblate.trans.models.source import Source
from
weblate.trans.models.unitdata
import
Check
,
Comment
,
Suggestion
from
weblate.trans.models.changes
import
Change
from
weblate.trans.search
import
update_index_unit
,
fulltext_search
,
more_like
from
weblate.accounts.models
import
(
notify_new_contributor
,
notify_new_translation
)
from
weblate.trans.filelock
import
FileLockException
from
weblate.trans.util
import
(
is_plural
,
split_plural
,
join_plural
,
get_distinct_translations
...
...
@@ -509,8 +511,6 @@ class Unit(models.Model):
Optional user parameters defines authorship of a change.
"""
from
weblate.accounts.models
import
notify_new_translation
# Update lock timestamp
self
.
translation
.
update_lock
(
request
)
...
...
@@ -606,8 +606,6 @@ class Unit(models.Model):
"""
Creates Change entry for saving unit.
"""
from
weblate.accounts.models
import
notify_new_contributor
# Notify about new contributor
user_changes
=
Change
.
objects
.
filter
(
translation
=
self
.
translation
,
...
...
weblate/trans/models/unitdata.py
View file @
79870bdc
...
...
@@ -25,6 +25,7 @@ from weblate.lang.models import Language
from
weblate.trans.checks
import
CHECKS
from
weblate.trans.models.changes
import
Change
from
weblate.accounts.avatar
import
get_user_display
from
weblate.accounts.models
import
notify_new_suggestion
,
notify_new_comment
class
RelatedUnitMixin
(
object
):
...
...
@@ -52,7 +53,6 @@ class SuggestionManager(models.Manager):
'''
Creates new suggestion for this unit.
'''
from
weblate.accounts.models
import
notify_new_suggestion
if
not
request
.
user
.
is_authenticated
():
user
=
None
...
...
@@ -224,8 +224,6 @@ class CommentManager(models.Manager):
'''
Adds comment to this unit.
'''
from
weblate.accounts.models
import
notify_new_comment
new_comment
=
self
.
create
(
user
=
user
,
contentsum
=
unit
.
contentsum
,
...
...
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