Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix cosmetics, add missing deps to setup

Patryk Zawadzkie3e06a1b272f
diff --git a/product/models.py b/product/models.py
index cc02b8ef18..20b201adeb 100644
--- a/product/models.py
+++ b/product/models.py
@@ -22,7 +22,7 @@ class SubtypedQuerySet(QuerySet):
if isinstance(attr, SingleRelatedObjectDescriptor):
child = attr.related.model
if (issubclass(child, root) and
- child is not root):
+ child is not root):
yield a
for s in self.find_subclasses(child):
yield '%s__%s' % (a, s)
@@ -40,7 +40,7 @@ class SubtypedQuerySet(QuerySet):
if isinstance(attr, SingleRelatedObjectDescriptor):
child = attr.related.model
if (issubclass(child, root) and
- child is not root):
+ child is not root):
try:
next_type = getattr(subtype, a)
except models.ObjectDoesNotExist:
@@ -110,8 +110,9 @@ class Product(models.Model, Item):
@models.permalink
def get_absolute_url(self):
- return ('product:details', (), {'slug':self.get_slug(),
- 'product_id':self.id})
+ return ('product:details',
+ (),
+ {'slug': self.get_slug(), 'product_id': self.id})
def get_price_per_item(self, **kwargs):
return self.price
@@ -121,4 +122,3 @@ class Product(models.Model, Item):
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
return mark_safe(re.sub(r'[-\s]+', '-', value))
-
diff --git a/saleor/middleware.py b/saleor/middleware.py
index c8a4a98495..9b3558e269 100644
--- a/saleor/middleware.py
+++ b/saleor/middleware.py
@@ -8,11 +8,9 @@ logger = logging.getLogger('saleor')
class CheckHTML(object):
def process_response(self, _request, response):
- if (
- settings.DEBUG
- and settings.WARN_ABOUT_INVALID_HTML5_OUTPUT
- and 200 <= response.status_code < 300
- ):
+ if (settings.DEBUG and
+ settings.WARN_ABOUT_INVALID_HTML5_OUTPUT and
+ 200 <= response.status_code < 300):
proc = Popen(["tidy"], stdout=PIPE, stderr=PIPE, stdin=PIPE)
_out, err = proc.communicate(response.content)
for l in err.split('\n\n')[0].split('\n')[:-2]:
diff --git a/setup.py b/setup.py
index 125ea00296..f751634992 100755
--- a/setup.py
+++ b/setup.py
@@ -24,41 +24,35 @@ class Lint(Command):
import lint
lint.run()
-
-setup(name='saleor',
- author='Mirumee Software',
- author_email='[email protected]',
- description="A fork'n'play e-commerence in Django",
- license='BSD',
- version='dev',
- url='http://getsaleor.com/',
- packages=find_packages(),
- include_package_data=True,
- install_requires=[
- 'Django==1.5c1',
- 'South>=0.7.6',
- 'satchless',
- 'unidecode',
- ],
- extras_require={
- 'lint': ['pylint==0.26.0', 'django-lint==dev']
- },
- dependency_links=[
- 'http://github.com/django/django/tarball/1.5c1#egg=Django-1.5c1',
- 'http://github.com/mirumee/satchless/tarball/django-removal#egg=satchless',
- 'http://github.com/lamby/django-lint/tarball/master#egg=django-lint-dev',
- ],
- entry_points={
- 'console_scripts': [
- 'saleor = saleor:manage'
- ]
- },
- cmdclass={
- 'lint': Lint,
- 'test': Test
- },
- tests_require=[
- 'coverage==3.6',
- 'mock==1.0.1',
- 'nose==1.2.1'],
- test_suite='nose.collector')
+setup(
+ name='saleor',
+ author='Mirumee Software',
+ author_email='[email protected]',
+ description="A fork'n'play e-commerence in Django",
+ license='BSD',
+ version='dev',
+ url='http://getsaleor.com/',
+ packages=find_packages(),
+ include_package_data=True,
+ install_requires=[
+ 'Django>=1.5',
+ 'django-mptt>=0.5',
+ 'django-prices>=2013.1',
+ 'satchless>=2013.2a',
+ 'South>=0.7.6',
+ 'unidecode'],
+ extras_require={
+ 'lint': ['pylint==0.26.0', 'django-lint==dev']},
+ dependency_links=[
+ 'http://github.com/mirumee/satchless/tarball/django-removal#egg=satchless-2013.2a',
+ 'http://github.com/lamby/django-lint/tarball/master#egg=django-lint-dev'],
+ entry_points={
+ 'console_scripts': ['saleor = saleor:manage']},
+ cmdclass={
+ 'lint': Lint,
+ 'test': Test},
+ tests_require=[
+ 'coverage==3.6',
+ 'mock==1.0.1',
+ 'nose==1.2.1'],
+ test_suite='nose.collector')