Permalink
Browse files

flake fixes

  • Loading branch information...
areski committed Oct 2, 2012
1 parent 5152592 commit c6b1f64024311d91f080bb1db9320dbb8a3f3333
@@ -1,3 +1 @@
-from django import forms
# place form definition here
-
@@ -15,8 +15,8 @@ def handle(self, *args, **options):
Load country dialcode
"""
script_directory = os.path.dirname(
- inspect.getfile(inspect.currentframe()))
+ inspect.getfile(inspect.currentframe()))
fixture_file = script_directory + \
- '/../../fixtures/country_dialcode.json'
+ '/../../fixtures/country_dialcode.json'
print "This fixture is going to be loaded : " + fixture_file
call_command('loaddata', fixture_file)
@@ -4,17 +4,18 @@
register = template.Library()
+
@stringfilter
def iso_flag(country_id, flag_path=u''):
"""
Returns a full path to the ISO 3166-1 alpha-2 country code flag image.
-
+
Example usage::
-
+
{{ user_profile.country_dialcode.country_id|iso_flag }}
-
+
{{ user_profile.country_dialcode.country_id|iso_flag:"appmedia/flags/%s.png" }}
-
+
"""
try:
obj_country = Country.objects.get(id=country_id)
@@ -12,7 +12,6 @@
#
from django.core.management import call_command
-from django.contrib.auth.models import User
from django.test import TestCase
from common.utils import BaseAuthenticatedClient
from country_dialcode.models import Country, Prefix
@@ -39,7 +38,6 @@ def test_admin_country_view_add(self):
}, follow=True)
self.assertEqual(response.status_code, 200)
-
def test_admin_prefix_view_list(self):
"""Test Function to check admin prefix list"""
response = self.client.get("/admin/country_dialcode/prefix/")
@@ -95,5 +93,3 @@ def teardown(self):
def test_mgt_command(self):
# Test mgt command
call_command('load_country_dialcode')
-
-
View
@@ -1,4 +1,3 @@
from django.conf.urls.defaults import patterns
-urlpatterns = patterns('',
-)
+urlpatterns = patterns('')
@@ -4,15 +4,15 @@
def iso_flag(iso, flag_path=u''):
"""
Returns a full path to the ISO 3166-1 alpha-2 country code flag image.
-
+
``flag_path`` is given in the form
``'<path relative to media root>/%s.gif'``
- and is appended to ``settings.MEDIA_URL``
-
- if a valid flag_path is not given trys to use
+ and is appended to ``settings.MEDIA_URL``
+
+ if a valid flag_path is not given trys to use
``settings.COUNTRIES_FLAG_PATH``
defaults to ``'flags/%s.gif'``
-
+
"""
default = u'-'
if not iso:
View
@@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+#import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -178,8 +178,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'django-country-dialcode.tex', u'django-country-dialcode Documentation',
- u'Arezqui Belaid', 'manual'),
+ ('index', 'django-country-dialcode.tex', u'django-country-dialcode Documentation',
+ u'Arezqui Belaid', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
View
@@ -34,7 +34,7 @@ def parse_dependency_links(file_name, install_flag=False):
if re.match(r'\s*-e\s+', line):
dependency_links.append(re.sub(r'\s*-e\s+', '', line))
if re.match(r'(\s*git)|(\s*hg)', line):
- if install_flag == True:
+ if install_flag:
line_arr = line.split('/')
line_arr_length = len(line.split('/'))
pck_name = line_arr[line_arr_length - 1].split('.git')
@@ -75,7 +75,7 @@ def parse_dependency_links(file_name, install_flag=False):
entry_points={'django.apps': 'country_dialcode = country_dialcode'},
install_requires=parse_requirements('requirements.txt'),
dependency_links=parse_dependency_links('requirements.txt',
- install_flag),
+ install_flag),
license='MIT License',
classifiers=[
'Development Status :: 4 - Beta',

0 comments on commit c6b1f64

Please sign in to comment.