[Lxml-checkins] r51461 - in lxml/trunk: . src/lxml/html
scoder at codespeak.net
scoder at codespeak.net
Wed Feb 13 21:49:22 CET 2008
Author: scoder
Date: Wed Feb 13 21:49:21 2008
New Revision: 51461
Added:
lxml/trunk/src/lxml/html/_setmixin.py
- copied unchanged from r50752, lxml/trunk/src/lxml/html/setmixin.py
Removed:
lxml/trunk/src/lxml/html/setmixin.py
Modified:
lxml/trunk/ (props changed)
lxml/trunk/CHANGES.txt
lxml/trunk/src/lxml/html/__init__.py
Log:
r3472 at delle: sbehnel | 2008-02-13 20:31:51 +0100
renamed lxml.html.setmixin to _setmixin to make clear it's not a real part of lxml
Modified: lxml/trunk/CHANGES.txt
==============================================================================
--- lxml/trunk/CHANGES.txt (original)
+++ lxml/trunk/CHANGES.txt Wed Feb 13 21:49:21 2008
@@ -25,6 +25,11 @@
Other changes
-------------
+* The previously public module ``lxml.html.setmixin`` was renamed to
+ ``lxml.html._setmixin`` as it is not an official part of lxml. If
+ you want to use it, feel free to copy it over to your own source
+ base.
+
* Passing ``--with-xslt-config=/path/to/xslt-config`` to setup.py will
override the ``xslt-config`` script that is used to determine the C
compiler options.
Modified: lxml/trunk/src/lxml/html/__init__.py
==============================================================================
--- lxml/trunk/src/lxml/html/__init__.py (original)
+++ lxml/trunk/src/lxml/html/__init__.py Wed Feb 13 21:49:21 2008
@@ -8,7 +8,7 @@
from lxml import etree
from lxml.html import defs
from lxml import cssselect
-from lxml.html.setmixin import SetMixin
+from lxml.html._setmixin import SetMixin
try:
from UserDict import DictMixin
except ImportError:
Deleted: /lxml/trunk/src/lxml/html/setmixin.py
==============================================================================
--- /lxml/trunk/src/lxml/html/setmixin.py Wed Feb 13 21:49:21 2008
+++ (empty file)
@@ -1,115 +0,0 @@
-class SetMixin(object):
-
- """
- Mix-in for sets. You must define __iter__, add, remove
- """
-
- def __len__(self):
- length = 0
- for item in self:
- length += 1
- return length
-
- def __contains__(self, item):
- for has_item in self:
- if item == has_item:
- return True
- return False
-
- def issubset(self, other):
- for item in other:
- if item not in self:
- return False
- return True
-
- __le__ = issubset
-
- def issuperset(self, other):
- for item in self:
- if item not in other:
- return False
- return True
-
- __ge__ = issuperset
-
- def union(self, other):
- return self | other
-
- def __or__(self, other):
- new = self.copy()
- new |= other
- return new
-
- def intersection(self, other):
- return self & other
-
- def __and__(self, other):
- new = self.copy()
- new &= other
- return new
-
- def difference(self, other):
- return self - other
-
- def __sub__(self, other):
- new = self.copy()
- new -= other
- return new
-
- def symmetric_difference(self, other):
- return self ^ other
-
- def __xor__(self, other):
- new = self.copy()
- new ^= other
- return new
-
- def copy(self):
- return set(self)
-
- def update(self, other):
- for item in other:
- self.add(item)
-
- def __ior__(self, other):
- self.update(other)
- return self
-
- def intersection_update(self, other):
- for item in self:
- if item not in other:
- self.remove(item)
-
- def __iand__(self, other):
- self.intersection_update(other)
- return self
-
- def difference_update(self, other):
- for item in other:
- if item in self:
- self.remove(item)
-
- def __isub__(self, other):
- self.difference_update(other)
- return self
-
- def symmetric_difference_update(self, other):
- for item in other:
- if item in self:
- self.remove(item)
- else:
- self.add(item)
-
- def __ixor__(self, other):
- self.symmetric_difference_update(other)
- return self
-
- def discard(self, item):
- try:
- self.remove(item)
- except KeyError:
- pass
-
- def clear(self):
- for item in list(self):
- self.remove(item)
More information about the lxml-checkins
mailing list