[Python-modules-commits] [utidylib] 04/16: Revert "Fix handling of 64-bit pointer"
Michal Cihar
nijel at moszumanska.debian.org
Thu Jul 7 12:53:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
nijel pushed a commit to branch master
in repository utidylib.
commit caeadcc0fb120d81470ed98c5d1107babfe8c53d
Author: Michal Čihař <michal at cihar.com>
Date: Thu Jul 7 14:39:14 2016 +0200
Revert "Fix handling of 64-bit pointer"
This reverts commit 09277ef83447e9d9ec92c3296e28475cc2ed1042.
---
tidy/lib.py | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/tidy/lib.py b/tidy/lib.py
index 40f1035..67927a2 100644
--- a/tidy/lib.py
+++ b/tidy/lib.py
@@ -18,7 +18,7 @@ from cStringIO import StringIO
import weakref
from tidy.error import *
-# search the path for libtidy using the known names; try the package
+# search the path for libtidy using the known names; try the package
# directory too
thelib=None
os.environ['PATH'] = "%s%s%s" % (packagedir, os.pathsep, os.environ['PATH'])
@@ -33,7 +33,7 @@ if not thelib:
raise OSError("Couldn't find libtidy, please make sure it is installed.")
class Loader:
- """I am a trivial wrapper that eliminates the need for tidy.tidyFoo,
+ """I am a trivial wrapper that eliminates the need for tidy.tidyFoo,
so you can just access tidy.Foo
"""
def __init__(self):
@@ -46,7 +46,6 @@ class Loader:
return getattr(self.lib, name)
_tidy=Loader()
-_tidy.Create.restype = ctypes.POINTER(ctypes.c_void_p)
# define a callback to pass to Tidylib
def _putByte(handle, c):
@@ -54,7 +53,7 @@ def _putByte(handle, c):
sinkfactory[handle].putByte(c)
return 0
-PUTBYTEFUNC=ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char)
+PUTBYTEFUNC=ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char)
putByte=PUTBYTEFUNC(_putByte)
class _OutputSink(ctypes.Structure):
@@ -95,7 +94,7 @@ class ReportItem:
return "line %d col %d - %s: %s" % (self.line, self.col,
severities[self.severity],
self.message)
-
+
else:
return "%s: %s" % (severities[self.severity], self.message)
except KeyError:
@@ -104,7 +103,7 @@ class ReportItem:
def __repr__(self):
return "%s('%s')" % (self.__class__.__name__,
str(self).replace("'", "\\'"))
-
+
class FactoryDict(dict):
"""I am a dict with a create method and no __setitem__. This allows
me to control my own keys.
@@ -115,7 +114,7 @@ class FactoryDict(dict):
dict.__setitem__(self, name, value)
def __setitem__(self, name, value):
raise TypeError, "Use create() to get a new object"
-
+
class SinkFactory(FactoryDict):
"""Mapping for lookup of sinks by handle"""
@@ -162,12 +161,12 @@ errors = {'missing or malformed argument for option: ': OptionArgError,
class DocumentFactory(FactoryDict):
def _setOptions(self, doc, **options):
for k in options.keys():
-
+
# this will flush out most argument type errors...
if options[k] is None: options[k] = ''
-
- _tidy.OptParseValue(doc.cdoc,
- k.replace('_', '-'),
+
+ _tidy.OptParseValue(doc.cdoc,
+ k.replace('_', '-'),
str(options[k]))
if doc.errors:
match=filter(doc.errors[-1].message.startswith, errors.keys())
@@ -217,7 +216,7 @@ class DocumentFactory(FactoryDict):
return doc
def releaseDoc(self, ref):
_tidy.Release(self[ref])
-
+
docfactory = DocumentFactory()
parse = docfactory.parse
parseString = docfactory.parseString
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/utidylib.git
More information about the Python-modules-commits
mailing list