From 16c4728b1efb96f919329bfafe62b5cffac4c261 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 8 Sep 2011 22:13:52 -0300 Subject: fixed a bug in SE importer --- .../importers/stackexchange/management/commands/load_stackexchange.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/importers/stackexchange/management/commands/load_stackexchange.py b/askbot/importers/stackexchange/management/commands/load_stackexchange.py index 20155e36..1f6b2042 100644 --- a/askbot/importers/stackexchange/management/commands/load_stackexchange.py +++ b/askbot/importers/stackexchange/management/commands/load_stackexchange.py @@ -890,7 +890,7 @@ class Command(BaseCommand): u_openid.save() except AssertionError: print u'User %s (id=%d) does not have openid' % \ - (se_u.display_name, se_u.id) + (unidecode(se_u.display_name), se_u.id) sys.stdout.flush() except IntegrityError: print "Warning: have duplicate openid: %s" % se_u.open_id -- cgit v1.2.3-1-g7c22 From c33ccf0b6f3af41930571504bdd10c8abed39eed Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Fri, 9 Sep 2011 09:35:43 -0300 Subject: fixed o ptyo --- askbot/deps/django_authopenid/backends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/deps/django_authopenid/backends.py b/askbot/deps/django_authopenid/backends.py index 18e42586..9f8f1dfd 100644 --- a/askbot/deps/django_authopenid/backends.py +++ b/askbot/deps/django_authopenid/backends.py @@ -60,7 +60,7 @@ class AuthBackend(object): logging.critical( ('have more than one user with email %s ' + 'he/she will not be able to authenticate with ' + - 'the email addres in the place of user name') % email_address + 'the email address in the place of user name') % email_address ) return None else: -- cgit v1.2.3-1-g7c22 From 7c0184a5e7e2cb11b4a96fc41b28b14585b4ecf1 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 11 Sep 2011 09:44:38 -0300 Subject: added unidecode to logging printout in migration 6 --- .../0006_add_subscription_setting_for_comments_and_mentions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/askbot/migrations/0006_add_subscription_setting_for_comments_and_mentions.py b/askbot/migrations/0006_add_subscription_setting_for_comments_and_mentions.py index cf348c22..5d077ebb 100644 --- a/askbot/migrations/0006_add_subscription_setting_for_comments_and_mentions.py +++ b/askbot/migrations/0006_add_subscription_setting_for_comments_and_mentions.py @@ -4,6 +4,7 @@ import datetime from south.db import db from south.v2 import DataMigration from django.db import models +from unidecode import unidecode try: from forum import const email_feed_setting_model = 'forum.EmailFeedSetting' @@ -45,7 +46,7 @@ class Migration(DataMigration): verbose_frequency = dict(const.NOTIFICATION_DELIVERY_SCHEDULE_CHOICES)[frequency] print 'added \'%s\' subscription for %s (%d)' % ( verbose_frequency, - user.username, + unidecode(user.username), user.id ) -- cgit v1.2.3-1-g7c22 From c5a4a9d9b0ec47bcfa0646bdfc238a4cb7d45631 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 11 Sep 2011 10:00:41 -0300 Subject: updated documentation about skins --- askbot/doc/source/customizing-skin-in-askbot.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/askbot/doc/source/customizing-skin-in-askbot.rst b/askbot/doc/source/customizing-skin-in-askbot.rst index 8be21ebd..686fc3ed 100644 --- a/askbot/doc/source/customizing-skin-in-askbot.rst +++ b/askbot/doc/source/customizing-skin-in-askbot.rst @@ -120,13 +120,29 @@ by from the root account. Create a custom skin in a new directory --------------------------------------- This is technically possible, but not advisable -because a redesign of default skin is expected. +because a redesign of default skin is pending. +After the redesign your custom skins may be difficult +to update. If you still wish to follow this option, name all directories and files the same way as in the "default" skin, as some template file names are hard-coded in the askbot's python code. +Add setting ``ASKBOT_EXTRA_SKINS_DIR`` to your ``settings.py`` file +and set its value to the directory with your additional skins. + +For example:: + + ASKBOT_EXTRA_SKINS_DIR = '/home/myname/my_askbot_themes' + +And your directory structure might be:: + + /home/myname/my_askbot_themes/ + /my_theme + /templates + /media + If you are planning to seriously recode the skin - it will be worthwhile learning the ``git`` system and just follow the recipe described in the previous section - -- cgit v1.2.3-1-g7c22 From 22eef1594f23569313227badad639e60c37b6cee Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 11 Sep 2011 10:11:58 -0300 Subject: added unidecode to log printing in migrations --- askbot/migrations/0005_install_badges.py | 9 +++++---- askbot/migrations/0009_calculate_html_field_for_comments.py | 2 -- ...recipients_m2m_to_activity_and_denorm_question_on_activity.py | 3 ++- askbot/migrations/0044_migrate_has_custom_avatar_field.py | 8 ++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/askbot/migrations/0005_install_badges.py b/askbot/migrations/0005_install_badges.py index 278f1ce1..f3c33fe5 100644 --- a/askbot/migrations/0005_install_badges.py +++ b/askbot/migrations/0005_install_badges.py @@ -4,6 +4,7 @@ import datetime from south.db import db from south.v2 import DataMigration from django.db import models +from unidecode import unidecode INITIAL_BADGE_DATA = ( ('Disciplined', 3, 'disciplined', 'Deleted own post with score of 3 or higher', True, 0), @@ -58,9 +59,9 @@ class Migration(DataMigration): try: badge = orm.Badge.objects.get(name=name) - print 'already have badge %s' % name + print 'already have badge %s' % unidecode(name) except orm.Badge.DoesNotExist: - print 'adding new badge %s' % name + print 'adding new badge %s' % unidecode(name) badge = orm.Badge() badge.name = name @@ -79,9 +80,9 @@ class Migration(DataMigration): badge = orm.Badge.objects.get(name = name) badge.award_badge.clear() badge.delete() - print 'deleted badge %s' % name + print 'deleted badge %s' % unidecode(name) except orm.Badge.DoesNotExist: - print 'no such badge %s - so skipping' % name + print 'no such badge %s - so skipping' % unidecode(name) pass forum_app_name = os.path.basename(os.path.dirname(os.path.dirname(__file__))) diff --git a/askbot/migrations/0009_calculate_html_field_for_comments.py b/askbot/migrations/0009_calculate_html_field_for_comments.py index 53de1832..41535dd6 100644 --- a/askbot/migrations/0009_calculate_html_field_for_comments.py +++ b/askbot/migrations/0009_calculate_html_field_for_comments.py @@ -159,8 +159,6 @@ class Migration(DataMigration): all_users = all_users, orm = orm ) - #print 'was %s' % comment.comment - #print 'now %s' % comment.html comment.save() def backwards(self, orm): diff --git a/askbot/migrations/0024_add_recipients_m2m_to_activity_and_denorm_question_on_activity.py b/askbot/migrations/0024_add_recipients_m2m_to_activity_and_denorm_question_on_activity.py index c5213526..5371d7b1 100644 --- a/askbot/migrations/0024_add_recipients_m2m_to_activity_and_denorm_question_on_activity.py +++ b/askbot/migrations/0024_add_recipients_m2m_to_activity_and_denorm_question_on_activity.py @@ -5,6 +5,7 @@ from south.v2 import DataMigration from django.db import models from askbot import const from askbot.migrations_api.version1 import API +from unidecode import unidecode #some of activities are not related to question, so they are not processed here APPROPRIATE_ACTIVITIES = ( @@ -51,7 +52,7 @@ class Migration(DataMigration): if have_problems: print 'Migration is now complete, but there were some errors:' - print '\n'.join(errors) + print unidecode('\n'.join(errors)) print 'problematic activity objects are: ' + ','.join(bad_ids) print 'This is most likely not a big issue, but if you save this error message' print 'and email to admin@askbot.org, that would help. Thanks.' diff --git a/askbot/migrations/0044_migrate_has_custom_avatar_field.py b/askbot/migrations/0044_migrate_has_custom_avatar_field.py index a9b9bc75..2222e871 100644 --- a/askbot/migrations/0044_migrate_has_custom_avatar_field.py +++ b/askbot/migrations/0044_migrate_has_custom_avatar_field.py @@ -4,6 +4,7 @@ from south.db import db from south.v2 import DataMigration from django.db import models from askbot.utils.console import print_action +from unidecode import unidecode class Migration(DataMigration): @@ -11,13 +12,16 @@ class Migration(DataMigration): "Write your forwards methods here." print 'Migrating users to new avatar field' for user in orm['auth.user'].objects.all(): - print_action('migrating user: %s' % user.username) + print_action('migrating user: %s' % unidecode(user.username)) if user.has_custom_avatar == True: user.avatar_type = 'a' else: user.avatar_type = 'n' user.save() - print_action('user %s migrated avatar_type: %s' % (user.username, user.avatar_type)) + print_action( + 'user %s migrated avatar_type: %s' % \ + (unidecode(user.username), user.avatar_type) + ) def backwards(self, orm): -- cgit v1.2.3-1-g7c22 From d17ebb325698b028e28d49e345352c7275de1d8e Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 11 Sep 2011 21:56:57 -0300 Subject: made askbot-setup work in python2.5 (hopefully) and pylinted a file --- askbot/deployment/path_utils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/askbot/deployment/path_utils.py b/askbot/deployment/path_utils.py index 7a1197de..6ad9fc99 100644 --- a/askbot/deployment/path_utils.py +++ b/askbot/deployment/path_utils.py @@ -101,6 +101,7 @@ def path_is_clean_for_django(directory): def create_path(directory): + """equivalent to mkdir -p""" if os.path.isdir(directory): return elif os.path.exists(directory): @@ -109,12 +110,17 @@ def create_path(directory): os.makedirs(directory) def touch(file_path, times = None): + """implementation of unix ``touch`` in python""" #http://stackoverflow.com/questions/1158076/implement-touch-using-python - with file(file_path, 'a'): - os.utime(file_path, times) + fhandle = file(file_path, 'a') + try: + os.utime(file_path, times) + finally: + fhandle.close() SOURCE_DIR = os.path.dirname(os.path.dirname(__file__)) def get_path_to_help_file(): + """returns path to the main plain text help file""" return os.path.join(SOURCE_DIR, 'doc', 'INSTALL') def deploy_into(directory, new_project = None): @@ -145,7 +151,7 @@ def deploy_into(directory, new_project = None): print '' app_dir = os.path.join(directory, 'askbot') - copy_dirs = ('doc','cron','upfiles') + copy_dirs = ('doc', 'cron', 'upfiles') dirs_copied = 0 for dir_name in copy_dirs: src = os.path.join(SOURCE_DIR, dir_name) @@ -165,6 +171,7 @@ def deploy_into(directory, new_project = None): print '' def dir_name_acceptable(directory): + """True if directory is not taken by another python module""" dir_name = os.path.basename(directory) try: imp.find_module(dir_name) -- cgit v1.2.3-1-g7c22