[Python-modules-commits] [pynliner] 01/04: Import pynliner_0.8.0.orig.tar.gz
Sandro Tosi
morph at moszumanska.debian.org
Sun Jan 22 21:35:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
morph pushed a commit to branch master
in repository pynliner.
commit 0967c85d2fb41d1916c880c6b73f3c3220a30e6f
Author: Sandro Tosi <morph at debian.org>
Date: Sun Jan 22 16:20:53 2017 -0500
Import pynliner_0.8.0.orig.tar.gz
---
PKG-INFO | 2 +-
pynliner.egg-info/PKG-INFO | 2 +-
pynliner/__init__.py | 4 ++--
pynliner/soupselect.py | 9 +++++++++
setup.py | 2 +-
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index be79e72..a81cc47 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pynliner
-Version: 0.7.2
+Version: 0.8.0
Summary: Python CSS-to-inline-styles conversion tool for HTML using BeautifulSoup and cssutils
Home-page: UNKNOWN
Author: Tanner Netterville
diff --git a/pynliner.egg-info/PKG-INFO b/pynliner.egg-info/PKG-INFO
index be79e72..a81cc47 100644
--- a/pynliner.egg-info/PKG-INFO
+++ b/pynliner.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pynliner
-Version: 0.7.2
+Version: 0.8.0
Summary: Python CSS-to-inline-styles conversion tool for HTML using BeautifulSoup and cssutils
Home-page: UNKNOWN
Author: Tanner Netterville
diff --git a/pynliner/__init__.py b/pynliner/__init__.py
index 76c552e..873d0a8 100644
--- a/pynliner/__init__.py
+++ b/pynliner/__init__.py
@@ -45,7 +45,7 @@ except ImportError:
from urlparse import urljoin
from urllib2 import urlopen
-__version__ = "0.7.2"
+__version__ = "0.8.0"
# this pattern may be too aggressive
@@ -153,7 +153,7 @@ class Pynliner(object):
def _get_url(self, url):
"""Returns the response content from the given url
"""
- return urlopen(url).read()
+ return urlopen(url).read().decode()
def _substitute_entities(self):
"""
diff --git a/pynliner/soupselect.py b/pynliner/soupselect.py
index 4a081e2..d58cf1b 100644
--- a/pynliner/soupselect.py
+++ b/pynliner/soupselect.py
@@ -84,6 +84,14 @@ def get_pseudo_class_checker(psuedo_class):
}.get(psuedo_class, lambda el: False)
+def contains_all_classes_checker(required_classes, el):
+ if not el:
+ return False
+ actual_classes = el.get('class', [])
+ test_has_class = partial(operator_.contains, actual_classes)
+ return all(map(test_has_class, required_classes))
+
+
def get_checker(functions):
def checker(el):
for func in functions:
@@ -149,6 +157,7 @@ def select(soup, selector):
# Get classes
#
classes = re.findall('\.([a-zA-Z0-9_-]+)', token)
+ checker_functions.append(partial(contains_all_classes_checker, classes))
#
# Search contexts for matches
diff --git a/setup.py b/setup.py
index 711aeed..70bc3ac 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@
from setuptools import setup
setup(name='pynliner',
- version='0.7.2',
+ version='0.8.0',
description='Python CSS-to-inline-styles conversion tool for HTML using'
' BeautifulSoup and cssutils',
author='Tanner Netterville',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pynliner.git
More information about the Python-modules-commits
mailing list