-
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from nitely/v0.4.x
v0.4.1
- Loading branch information
Showing
17 changed files
with
265 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,6 @@ docs/_build/ | |
*~ | ||
*.swp | ||
*.swo | ||
|
||
# Tx | ||
.transifexrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
lang_map = sr@latin:sr_Latn, zh_CN:zh_Hans, zh_TW:zh_Hant | ||
|
||
[spirit.core] | ||
file_filter = spirit/core/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/core/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.admin] | ||
file_filter = spirit/admin/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/admin/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.search] | ||
file_filter = spirit/search/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/search/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.user] | ||
file_filter = spirit/user/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/user/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.user_admin] | ||
file_filter = spirit/user/admin/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/user/admin/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.user_auth] | ||
file_filter = spirit/user/auth/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/user/auth/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.category] | ||
file_filter = spirit/category/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/category/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.category_admin] | ||
file_filter = spirit/category/admin/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/category/admin/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic] | ||
file_filter = spirit/topic/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_admin] | ||
file_filter = spirit/topic/admin/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/admin/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_favorite] | ||
file_filter = spirit/topic/favorite/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/favorite/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_notification] | ||
file_filter = spirit/topic/notification/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/notification/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_poll] | ||
file_filter = spirit/topic/poll/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/poll/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_private] | ||
file_filter = spirit/topic/private/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/private/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.topic_unread] | ||
file_filter = spirit/topic/unread/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/topic/unread/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment] | ||
file_filter = spirit/comment/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment_bookmark] | ||
file_filter = spirit/comment/bookmark/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/bookmark/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment_flag] | ||
file_filter = spirit/comment/flag/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/flag/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment_flag_admin] | ||
file_filter = spirit/comment/flag/admin/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/flag/admin/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment_history] | ||
file_filter = spirit/comment/history/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/history/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO | ||
|
||
[spirit.comment_like] | ||
file_filter = spirit/comment/like/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = spirit/comment/like/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
type = PO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
0.4.1 | ||
================== | ||
|
||
* Adds missing user profile migration (issue #62) | ||
|
||
0.4.0 | ||
================== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
setup( | ||
name='django-spirit', | ||
version='0.4.0', | ||
version='0.4.1', | ||
description='Spirit is a Python based forum powered by Django.', | ||
author='Esteban Castro Borsani', | ||
author_email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
from __future__ import unicode_literals | ||
|
||
__version__ = '0.4.0' | ||
__version__ = '0.4.1' |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import unicode_literals | ||
import os | ||
|
||
from django.core.management.base import BaseCommand, CommandError | ||
from django.core.management import call_command | ||
from django.conf import settings | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Compiles .po files created by makemessages to .mo ' \ | ||
'files for use with the builtin gettext support' | ||
|
||
requires_system_checks = False | ||
|
||
def handle(self, *args, **options): | ||
if not settings.ST_BASE_DIR.endswith('spirit'): | ||
raise CommandError( | ||
'settings.ST_BASE_DIR is not the spirit root folder, are you overriding it?' | ||
) | ||
|
||
base_dir = os.getcwd() | ||
|
||
for root, dirs, files in os.walk(settings.ST_BASE_DIR): | ||
if 'locale' not in dirs: | ||
continue | ||
|
||
os.chdir(root) | ||
call_command('compilemessages', stdout=self.stdout, stderr=self.stderr) | ||
os.chdir(base_dir) | ||
|
||
self.stdout.write('ok') | ||
self.stdout.write('Run \'python manage.py spirittxpush\' to push the changes to transifex.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import unicode_literals | ||
from subprocess import call | ||
import os | ||
|
||
from django.core.management.base import BaseCommand, CommandError | ||
from django.conf import settings | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Pushes all the local files listed in ./.tx/config to transifex' | ||
|
||
requires_system_checks = False | ||
|
||
def handle(self, *args, **options): | ||
# todo: test or not to test? | ||
# Requir python27 and "pip install transifex-client==0.11b3" | ||
root = os.path.split(settings.ST_BASE_DIR)[0] | ||
tx_dir = os.path.join(root, '.tx') | ||
|
||
if not os.path.isdir(tx_dir): | ||
raise CommandError('Can\'t find the .tx folder in %s' % (root, )) | ||
|
||
os.chdir(root) | ||
call(["tx", "push", "-s", "-t", "--skip"]) | ||
self.stdout.write('ok') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import unicode_literals | ||
|
||
from django.test import TestCase | ||
from django.core.management import call_command | ||
from django.utils.six import StringIO | ||
|
||
|
||
class CommandsTests(TestCase): | ||
|
||
def test_command_spiritcompilemessages(self): | ||
""" | ||
Should compile all locales under the spirit root folder | ||
""" | ||
out = StringIO() | ||
err = StringIO() | ||
call_command('spiritcompilemessages', stdout=out, stderr=err) | ||
out_put = out.getvalue().strip().splitlines() | ||
out_put_err = err.getvalue().strip().splitlines() | ||
self.assertTrue(out_put[0].startswith("processing file django.po in")) | ||
self.assertEqual(out_put[-2], "ok") | ||
self.assertEqual(out_put_err, []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
from django.conf import settings | ||
|
||
|
||
def migrate_profiles(apps, schema_editor): | ||
User = apps.get_model(settings.AUTH_USER_MODEL) | ||
UserProfile = apps.get_model('spirit_user', 'UserProfile') | ||
|
||
users = User.objects.filter(st=None) | ||
|
||
# Avoid using bulk_create coz there are things setted on save | ||
for user in users: | ||
st = UserProfile() | ||
st.user = user | ||
st.is_verified = True | ||
st.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('spirit_user', '0003_auto_20150728_0448'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate_profiles), | ||
] |