Self hosted FLOSS fitness/workout, nutrition and weight tracker
Fix formatting errors for new pep8 version 1.4.6
Roland Geidercf3fdf874ecf
diff --git a/wger/exercises/models.py b/wger/exercises/models.pyindex 6e35ff5fe..488cf0736 100644--- a/wger/exercises/models.py+++ b/wger/exercises/models.py@@ -206,7 +206,7 @@ class Exercise(models.Model):"added to workouts. You can access it on this address:\n""{1}\n\n").format(self.name, url) +ugettext("Thank you for contributing and making this site better!\n"- " the wger.de team"))+ " the wger.de team"))mail.send_mail(subject,message,EMAIL_FROM,diff --git a/wger/exercises/tests/exercise.py b/wger/exercises/tests/exercise.pyindex 3789b64b7..c4f24eeb2 100644--- a/wger/exercises/tests/exercise.py+++ b/wger/exercises/tests/exercise.py@@ -202,8 +202,8 @@ class ExercisesTestCase(WorkoutManagerTestCase):count_before = Exercise.objects.count()response = self.client.post(reverse('exercise-add'),{'category': 2,- 'name': 'my test exercise',- 'muscles': [1, 2]})+ 'name': 'my test exercise',+ 'muscles': [1, 2]})count_after = Exercise.objects.count()# Exercise was not added@@ -235,9 +235,9 @@ class ExercisesTestCase(WorkoutManagerTestCase):count_before = Exercise.objects.count()response = self.client.post(reverse('exercise-add'),{'category': 2,- 'name': 'my test exercise',- 'description': 'a nice, long and accurate description',- 'muscles': [1, 2]})+ 'name': 'my test exercise',+ 'description': 'a nice, long and accurate description',+ 'muscles': [1, 2]})count_after = Exercise.objects.count()self.assertEqual(response.status_code, 302)new_location = response['Location']@@ -268,15 +268,15 @@ class ExercisesTestCase(WorkoutManagerTestCase):# Wrong category - addingresponse = self.client.post(reverse('exercise-add'),{'category': 111,- 'name': 'my test exercise',- 'muscles': [1, 2]})+ 'name': 'my test exercise',+ 'muscles': [1, 2]})self.assertTrue(response.context['form'].errors['category'])# Wrong category - editingresponse = self.client.post(reverse('exercise-edit', kwargs={'pk': '1'}),{'category': 111,- 'name': 'my test exercise',- 'muscles': [1, 2]})+ 'name': 'my test exercise',+ 'muscles': [1, 2]})if admin:self.assertTrue(response.context['form'].errors['category'])else:@@ -285,15 +285,15 @@ class ExercisesTestCase(WorkoutManagerTestCase):# No muscles - addingresponse = self.client.post(reverse('exercise-add'),{'category': 1,- 'name': 'my test exercise',- 'muscles': []})+ 'name': 'my test exercise',+ 'muscles': []})self.assertTrue(response.context['form'].errors['muscles'])# No muscles - editingresponse = self.client.post(reverse('exercise-edit', kwargs={'pk': '1'}),{'category': 1,- 'name': 'my test exercise',- 'muscles': []})+ 'name': 'my test exercise',+ 'muscles': []})if admin:self.assertTrue(response.context['form'].errors['muscles'])else:diff --git a/wger/manager/pdf.py b/wger/manager/pdf.pyindex d7259e00e..5887f7792 100644--- a/wger/manager/pdf.py+++ b/wger/manager/pdf.py@@ -26,14 +26,9 @@ from django.utils.translation import ugettext as _from wger.manager.models import Workoutfrom wger.utils.pdf import styleSheet-from reportlab.lib.styles import getSampleStyleSheet-from reportlab.lib.styles import ParagraphStyle-from reportlab.lib.styles import StyleSheet1from reportlab.lib.pagesizes import A4, cm, landscape, portraitfrom reportlab.platypus import Paragraph, SimpleDocTemplate, Tablefrom reportlab.lib import colors-from reportlab.pdfbase.ttfonts import TTFont-from reportlab.pdfbase import pdfmetricsfrom wger import get_version@@ -113,7 +108,7 @@ def workout_log(request, id):P = Paragraph('<para align="center">%(days)s: %(description)s</para>' %{'days': ', '.join(days_of_week),- 'description': day.description},+ 'description': day.description},styleSheet["Bold"])data.append([P])@@ -291,9 +286,9 @@ def workout_log(request, id):%(version)s</para>''' %{'date': _("Created on the <b>%s</b>") % created,- 'created': "wger Workout Manager",- 'version': get_version(),- 'url': request.build_absolute_uri(url), },+ 'created': "wger Workout Manager",+ 'version': get_version(),+ 'url': request.build_absolute_uri(url), },styleSheet["Normal"])elements.append(P)diff --git a/wger/manager/tests/index.py b/wger/manager/tests/index.pyindex d97336064..d548e6cc4 100644--- a/wger/manager/tests/index.py+++ b/wger/manager/tests/index.py@@ -79,7 +79,7 @@ class DashboardTestCase(WorkoutManagerTestCase):#self.client.post(reverse('weight-add'),{'weight': 100,- 'creation_date': '2012-01-01'},)+ 'creation_date': '2012-01-01'},)response = self.client.get(reverse('dashboard'))self.assertEqual(response.status_code, 200)diff --git a/wger/manager/tests/preferences.py b/wger/manager/tests/preferences.pyindex 98055e400..bee9b72e2 100644--- a/wger/manager/tests/preferences.py+++ b/wger/manager/tests/preferences.py@@ -40,8 +40,8 @@ class PreferencesTestCase(WorkoutManagerTestCase):# Change some preferencesresponse = self.client.post(reverse('preferences'),{'show_comments': 'on',- 'show_english_ingredients': 'on',- 'email': '[email protected]'})+ 'show_english_ingredients': 'on',+ 'email': '[email protected]'})self.assertEqual(response.status_code, 302)response = self.client.get(reverse('preferences'))@@ -53,7 +53,7 @@ class PreferencesTestCase(WorkoutManagerTestCase):# Change some preferencesresponse = self.client.post(reverse('preferences'),{'show_english_ingredients': 'on',- 'email': ''})+ 'email': ''})self.assertEqual(response.status_code, 302)response = self.client.get(reverse('preferences'))@@ -84,7 +84,7 @@ class AjaxPreferencesTestCase(WorkoutManagerTestCase):# Set the 'show comments' optionresponse = self.client.get(reverse('wger.manager.views.user.api_user_preferences'),{'do': 'set_show-comments',- 'show': '1'},+ 'show': '1'},HTTP_X_REQUESTED_WITH='XMLHttpRequest')self.assertEqual('Success', response.content)@@ -99,7 +99,7 @@ class AjaxPreferencesTestCase(WorkoutManagerTestCase):# Set the 'english ingredients' optionresponse = self.client.get(reverse('wger.manager.views.user.api_user_preferences'),{'do': 'set_english-ingredients',- 'show': '1'},+ 'show': '1'},HTTP_X_REQUESTED_WITH='XMLHttpRequest')self.assertEqual('Success', response.content)diff --git a/wger/nutrition/models.py b/wger/nutrition/models.pyindex 190c1c9c5..baf18205b 100644--- a/wger/nutrition/models.py+++ b/wger/nutrition/models.py@@ -60,7 +60,7 @@ class NutritionPlan(models.Model):blank=True,verbose_name=_('Description'),help_text=_('A description of the goal of the plan, e.g. '- '"Gain mass" or "Prepare for summer"'))+ '"Gain mass" or "Prepare for summer"'))def __unicode__(self):'''@@ -277,7 +277,7 @@ class Ingredient(models.Model):"added to nutrition plans. You can access it on this address:\n""{1}\n\n").format(self.name, url) +ugettext("Thank you for contributing and making this site better!\n"- " the wger.de team"))+ " the wger.de team"))mail.send_mail(subject,message,EMAIL_FROM,diff --git a/wger/nutrition/views/plan.py b/wger/nutrition/views/plan.pyindex 5c5ef824e..5a5c51af4 100644--- a/wger/nutrition/views/plan.py+++ b/wger/nutrition/views/plan.py@@ -222,7 +222,7 @@ def export_pdf(request, id):P = Paragraph('<para align="center"><strong>%(meal_nr)s - ''%(meal_time)s</strong></para>' %{'meal_nr': i,- 'meal_time': meal.time.strftime("%H:%M")},+ 'meal_time': meal.time.strftime("%H:%M")},styleSheet["Normal"])data.append([P])@@ -294,9 +294,9 @@ def export_pdf(request, id):%(version)s</para>''' %{'date': _("Created on the <b>%s</b>") % created,- 'created': "wger Workout Manager",- 'version': get_version(),- 'url': request.build_absolute_uri(url), },+ 'created': "wger Workout Manager",+ 'version': get_version(),+ 'url': request.build_absolute_uri(url), },styleSheet["Normal"])elements.append(P)doc.build(elements)diff --git a/wger/settings_global.py b/wger/settings_global.pyindex 2d30cf745..d1586beca 100644--- a/wger/settings_global.py+++ b/wger/settings_global.py@@ -34,9 +34,8 @@ MANAGERS = ADMINS# Restrict the available languagesugettext = lambda s: sLANGUAGES = (- ('en', ugettext('English')),- ('de', ugettext('German')),-# ('os', ugettext('Ossetian')),+ ('en', ugettext('English')),+ ('de', ugettext('German')),)# Default language code for this installation. All choices can be found here:diff --git a/wger/weight/views.py b/wger/weight/views.pyindex 2bcd194ab..154892a04 100644--- a/wger/weight/views.py+++ b/wger/weight/views.py@@ -141,13 +141,13 @@ def overview(request):if min_date:template_data['min_date'] = 'new Date(%(year)s, %(month)s, %(day)s)' % \{'year': min_date.year,- 'month': min_date.month,- 'day': min_date.day}+ 'month': min_date.month,+ 'day': min_date.day}if max_date:template_data['max_date'] = 'new Date(%(year)s, %(month)s, %(day)s)' % \{'year': max_date.year,- 'month': max_date.month,- 'day': max_date.day}+ 'month': max_date.month,+ 'day': max_date.day}return render_to_response('weight_overview.html',template_data,context_instance=RequestContext(request))