Permalink
Browse files

Updated some of the pylibs packages.

  • Loading branch information...
tav committed May 13, 2011
1 parent dd543dc commit 8a48383f5260e243f7d8e0cbd56d0a316a798e40
Showing with 868 additions and 59,259 deletions.
  1. +0 −2 .gitignore
  2. +19 −16 BeautifulSoup.py
  3. +0 −148 daemon.py
  4. +0 −309 exception.py
  5. +0 −20 greenlet/LICENSE.txt
  6. +0 −1,279 greenlet/greenlet.c
  7. +0 −131 greenlet/greenlet.h
  8. +0 −66 greenlet/platform/switch_amd64_unix.h
  9. +0 −50 greenlet/platform/switch_arm32_gcc.h
  10. +0 −56 greenlet/platform/switch_mips_unix.h
  11. +0 −80 greenlet/platform/switch_ppc_macosx.h
  12. +0 −80 greenlet/platform/switch_ppc_unix.h
  13. +0 −54 greenlet/platform/switch_s390_unix.h
  14. +0 −85 greenlet/platform/switch_sparc_sun_gcc.h
  15. +0 −83 greenlet/platform/switch_x86_msvc.h
  16. +0 −81 greenlet/platform/switch_x86_unix.h
  17. +0 −25 greenlet/slp_platformselect.h
  18. +130 −41 ipaddr.py
  19. +0 −202 openid/LICENSE.txt
  20. +0 −55 openid/__init__.py
  21. +0 −555 openid/association.py
  22. +0 −6 openid/consumer/__init__.py
  23. +0 −1,901 openid/consumer/consumer.py
  24. +0 −470 openid/consumer/discover.py
  25. +0 −249 openid/consumer/html_parse.py
  26. +0 −220 openid/cryptutil.py
  27. +0 −42 openid/dh.py
  28. +0 −46 openid/extension.py
  29. +0 −5 openid/extensions/__init__.py
  30. +0 −774 openid/extensions/ax.py
  31. 0 openid/extensions/draft/__init__.py
  32. +0 −277 openid/extensions/draft/pape2.py
  33. +0 −473 openid/extensions/draft/pape5.py
  34. +0 −518 openid/extensions/sreg.py
  35. +0 −423 openid/fetchers.py
  36. +0 −123 openid/kvform.py
  37. +0 −631 openid/message.py
  38. +0 −190 openid/oidutil.py
  39. +0 −6 openid/server/__init__.py
  40. +0 −1,849 openid/server/server.py
  41. +0 −454 openid/server/trustroot.py
  42. +0 −7 openid/sreg.py
  43. +0 −8 openid/store/__init__.py
  44. +0 −426 openid/store/filestore.py
  45. +0 −197 openid/store/interface.py
  46. +0 −125 openid/store/memstore.py
  47. +0 −98 openid/store/nonce.py
  48. +0 −516 openid/store/sqlstore.py
  49. +0 −202 openid/urinorm.py
  50. +0 −29 openid/yadis/__init__.py
  51. +0 −133 openid/yadis/accept.py
  52. +0 −13 openid/yadis/constants.py
  53. +0 −135 openid/yadis/discover.py
  54. +0 −300 openid/yadis/etxrd.py
  55. +0 −200 openid/yadis/filters.py
  56. +0 −194 openid/yadis/manager.py
  57. +0 −197 openid/yadis/parsehtml.py
  58. +0 −54 openid/yadis/services.py
  59. +0 −168 openid/yadis/xri.py
  60. +0 −123 openid/yadis/xrires.py
  61. +0 −476 optcomplete.py
  62. +0 −312 optimise.py
  63. +0 −19 py/LICENSE.txt
  64. +0 −178 py/__init__.py
  65. +0 −2 py/__metainfo.py
  66. +0 −203 py/_builtin.py
  67. +0 −1 py/_cmdline/__init__.py
  68. +0 −47 py/_cmdline/pycleanup.py
  69. +0 −249 py/_cmdline/pyconvert_unittest.py
  70. +0 −94 py/_cmdline/pycountloc.py
  71. +0 −83 py/_cmdline/pylookup.py
  72. +0 −55 py/_cmdline/pysvnwcrevert.py
  73. +0 −5 py/_cmdline/pytest.py
  74. +0 −23 py/_cmdline/pywhich.py
  75. +0 −1 py/_code/__init__.py
  76. +0 −337 py/_code/_assertionnew.py
  77. +0 −558 py/_code/_assertionold.py
  78. +0 −75 py/_code/assertion.py
  79. +0 −768 py/_code/code.py
  80. +0 −62 py/_code/oldmagic.py
  81. +0 −6 py/_code/oldmagic2.py
  82. +0 −347 py/_code/source.py
  83. +0 −2 py/_compat/__init__.py
  84. +0 −5 py/_compat/dep_doctest.py
  85. +0 −4 py/_compat/dep_optparse.py
  86. +0 −5 py/_compat/dep_subprocess.py
  87. +0 −5 py/_compat/dep_textwrap.py
  88. +0 −83 py/_error.py
  89. +0 −1 py/_io/__init__.py
  90. +0 −344 py/_io/capture.py
  91. +0 −264 py/_io/terminalwriter.py
  92. +0 −2 py/_log/__init__.py
  93. +0 −186 py/_log/log.py
  94. +0 −76 py/_log/warning.py
  95. +0 −1 py/_path/__init__.py
  96. +0 −114 py/_path/cacheutil.py
  97. +0 −333 py/_path/common.py
  98. +0 −799 py/_path/local.py
  99. +0 −376 py/_path/svnurl.py
  100. +0 −1,231 py/_path/svnwc.py
  101. +0 −1 py/_plugin/__init__.py
  102. +0 −179 py/_plugin/hookspec.py
  103. +0 −97 py/_plugin/pytest__pytest.py
  104. +0 −31 py/_plugin/pytest_assertion.py
  105. +0 −281 py/_plugin/pytest_capture.py
  106. +0 −107 py/_plugin/pytest_default.py
  107. +0 −100 py/_plugin/pytest_doctest.py
  108. +0 −69 py/_plugin/pytest_genscript.py
  109. +0 −159 py/_plugin/pytest_helpconfig.py
  110. +0 −33 py/_plugin/pytest_hooklog.py
  111. +0 −156 py/_plugin/pytest_junitxml.py
  112. +0 −152 py/_plugin/pytest_mark.py
  113. +0 −142 py/_plugin/pytest_monkeypatch.py
  114. +0 −98 py/_plugin/pytest_nose.py
  115. +0 −83 py/_plugin/pytest_pastebin.py
  116. +0 −104 py/_plugin/pytest_pdb.py
  117. +0 −36 py/_plugin/pytest_pylint.py
  118. +0 −490 py/_plugin/pytest_pytester.py
  119. +0 −121 py/_plugin/pytest_recwarn.py
  120. +0 −429 py/_plugin/pytest_restdoc.py
  121. +0 −98 py/_plugin/pytest_resultlog.py
  122. +0 −253 py/_plugin/pytest_runner.py
  123. +0 −231 py/_plugin/pytest_skipping.py
  124. +0 −441 py/_plugin/pytest_terminal.py
  125. +0 −22 py/_plugin/pytest_tmpdir.py
  126. +0 −79 py/_plugin/pytest_unittest.py
  127. +0 −63 py/_plugin/standalonetemplate.py
  128. +0 −1 py/_process/__init__.py
  129. +0 −46 py/_process/cmdexec.py
  130. +0 −108 py/_process/forkedfunc.py
  131. +0 −23 py/_process/killproc.py
  132. +0 −18 py/_std.py
  133. +0 −1 py/_test/__init__.py
  134. +0 −24 py/_test/cmdline.py
  135. +0 −432 py/_test/collect.py
  136. +0 −291 py/_test/config.py
  137. +0 −109 py/_test/conftesthandle.py
  138. +0 −176 py/_test/funcargs.py
  139. +0 −136 py/_test/outcome.py
  140. +0 −112 py/_test/parseopt.py
  141. +0 −333 py/_test/pluginmanager.py
  142. +0 −370 py/_test/pycollect.py
  143. +0 −118 py/_test/session.py
  144. +0 −243 py/_xmlgen.py
  145. +0 −91 py/apipkg.py
  146. +0 −56 pygevent/LICENSE.txt
  147. +0 −10 pygevent/MANIFEST.in
  148. +0 −19 pygevent/PKG-INFO
  149. +0 −82 pygevent/README.rst
  150. +0 −1 pygevent/TODO
  151. +0 −44 pygevent/gevent/__init__.py
  152. +0 −134 pygevent/gevent/backdoor.py
  153. +0 −16,667 pygevent/gevent/core.c
  154. +0 −442 pygevent/gevent/core.pyx
  155. +0 −153 pygevent/gevent/coros.py
  156. +0 −102 pygevent/gevent/dns.py
  157. +0 −73 pygevent/gevent/evbuffer.pxi
  158. +0 −133 pygevent/gevent/evdns.pxi
  159. +0 −320 pygevent/gevent/event.py
  160. +0 −525 pygevent/gevent/evhttp.pxi
  161. +0 −595 pygevent/gevent/greenlet.py
  162. +0 −143 pygevent/gevent/http.py
  163. +0 −319 pygevent/gevent/hub.py
  164. +0 −15 pygevent/gevent/libevent-internal.h
  165. +0 −52 pygevent/gevent/libevent.h
  166. +0 −153 pygevent/gevent/monkey.py
  167. +0 −245 pygevent/gevent/pool.py
  168. +0 −450 pygevent/gevent/pywsgi.py
  169. +0 −318 pygevent/gevent/queue.py
  170. +0 −84 pygevent/gevent/rawgreenlet.py
  171. +0 −64 pygevent/gevent/select.py
  172. +0 −670 pygevent/gevent/socket.py
  173. +0 −373 pygevent/gevent/ssl.py
  174. +0 −170 pygevent/gevent/sslold.py
  175. +0 −33 pygevent/gevent/thread.py
  176. +0 −199 pygevent/gevent/timeout.py
  177. +0 −62 pygevent/gevent/util.py
  178. +0 −95 pygevent/gevent/win32util.py
  179. +0 −221 pygevent/gevent/wsgi.py
  180. +0 −335 pygevent/setup.py
  181. +0 −1 setup.py
  182. +0 −1 ssl
  183. +3 −0 tornado/__init__.py
  184. +0 −882 tornado/auth.py
  185. +0 −102 tornado/autoreload.py
  186. +0 −112 tornado/epoll.c
  187. +98 −5 tornado/escape.py
  188. +0 −561 tornado/httpclient.py
  189. +0 −454 tornado/httpserver.py
  190. +0 −144 tornado/httputil.py
  191. +117 −51 tornado/ioloop.py
  192. +362 −71 tornado/iostream.py
  193. +0 −453 tornado/locale.py
  194. +0 −386 tornado/options.py
  195. +0 −255 tornado/s3server.py
  196. +139 −95 tornado/stack_context.py
  197. +0 −575 tornado/template.py
  198. +0 −314 tornado/testing.py
  199. +0 −1,524 tornado/web.py
  200. +0 −297 tornado/wsgi.py
View
@@ -1,8 +1,6 @@
# specific files/directories
build
-keyspace.py
-keyspace_client.py
# hidden files/directories
View
@@ -42,7 +42,7 @@
Here, have some legalese:
-Copyright (c) 2004-2009, Leonard Richardson
+Copyright (c) 2004-2010, Leonard Richardson
All rights reserved.
@@ -79,8 +79,8 @@
from __future__ import generators
__author__ = "Leonard Richardson (leonardr@segfault.org)"
-__version__ = "3.0.8"
-__copyright__ = "Copyright (c) 2004-2009 Leonard Richardson"
+__version__ = "3.2.0"
+__copyright__ = "Copyright (c) 2004-2010 Leonard Richardson"
__license__ = "New-style BSD"
from sgmllib import SGMLParser, SGMLParseError
@@ -335,18 +335,19 @@ def _findAll(self, name, attrs, text, limit, generator, **kwargs):
if isinstance(name, SoupStrainer):
strainer = name
- # Special case some findAll* searches
- # findAll*(True)
- elif not limit and name is True and not attrs and not kwargs:
- return [element for element in generator()
- if isinstance(element, Tag)]
-
- # findAll*('tag-name')
- elif not limit and isinstance(name, basestring) and not attrs \
- and not kwargs:
- return [element for element in generator()
- if isinstance(element, Tag) and element.name == name]
-
+ # (Possibly) special case some findAll*(...) searches
+ elif text is None and not limit and not attrs and not kwargs:
+ # findAll*(True)
+ if name is True:
+ return [element for element in generator()
+ if isinstance(element, Tag)]
+ # findAll*('tag-name')
+ elif isinstance(name, basestring):
+ return [element for element in generator()
+ if isinstance(element, Tag) and
+ element.name == name]
+ else:
+ strainer = SoupStrainer(name, attrs, text, **kwargs)
# Build a SoupStrainer
else:
strainer = SoupStrainer(name, attrs, text, **kwargs)
@@ -530,6 +531,8 @@ def __init__(self, parser, name, attrs=None, parent=None,
self.name = name
if attrs is None:
attrs = []
+ elif isinstance(attrs, dict):
+ attrs = attrs.items()
self.attrs = attrs
self.contents = []
self.setup(parent, previous)
@@ -1647,7 +1650,7 @@ class ICantBelieveItsBeautifulSoup(BeautifulSoup):
'cite', 'code', 'dfn', 'kbd', 'samp', 'strong', 'var', 'b',
'big')
- I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGS = ('noscript')
+ I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGS = ('noscript',)
NESTABLE_TAGS = buildTagMap([], BeautifulSoup.NESTABLE_TAGS,
I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGS,
View
148 daemon.py
@@ -1,148 +0,0 @@
-# Changes to this file by The Ampify Authors are in the Public Domain.
-# See the Ampify UNLICENSE file for details.
-
-# Released into the Public Domain by Sander Marechal
-# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
-
-import atexit
-import os
-import sys
-import time
-
-from os.path import isabs
-from signal import SIGTERM
-
-class Daemon(object):
- """
- A generic daemon class.
-
- Usage: subclass the Daemon class and override the run() method
- """
-
- def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
- self.stdin = stdin
- self.stdout = stdout
- self.stderr = stderr
- if not isabs(pidfile):
- raise RuntimeError("The pidfile path is not absolute: %s" % pidfile)
- self.pidfile = pidfile
-
- def daemonize(self):
- """
- do the UNIX double-fork magic, see Stevens' "Advanced
- Programming in the UNIX Environment" for details (ISBN 0201563177)
- http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
- """
- try:
- pid = os.fork()
- if pid > 0:
- # exit first parent
- sys.exit(0)
- except OSError, e:
- sys.stderr.write("ERROR: fork #1 failed: %d (%s)\n" % (e.errno, e.strerror))
- sys.exit(1)
-
- # decouple from parent environment
- os.chdir("/")
- os.setsid()
- os.umask(0)
-
- # do second fork
- try:
- pid = os.fork()
- if pid > 0:
- # exit from second parent
- sys.exit(0)
- except OSError, e:
- sys.stderr.write("ERROR: fork #2 failed: %d (%s)\n" % (e.errno, e.strerror))
- sys.exit(1)
-
- # redirect standard file descriptors
- sys.stdout.flush()
- sys.stderr.flush()
- si = file(self.stdin, 'r')
- so = file(self.stdout, 'a+')
- se = file(self.stderr, 'a+', 0)
- os.dup2(si.fileno(), sys.stdin.fileno())
- os.dup2(so.fileno(), sys.stdout.fileno())
- os.dup2(se.fileno(), sys.stderr.fileno())
-
- # write pidfile
- atexit.register(self.exithook)
- pid = str(os.getpid())
- file(self.pidfile,'w+').write("%s\n" % pid)
-
- def delpid(self):
- os.remove(self.pidfile)
-
- def start(self):
- """
- Start the daemon
- """
- # Check for a pidfile to see if the daemon already runs
- try:
- pf = file(self.pidfile,'r')
- pid = int(pf.read().strip())
- pf.close()
- except IOError:
- pid = None
-
- if pid:
- message = (
- "ERROR: PID file %s already exists.\n"
- "ERROR: The daemon might be already running.\n"
- )
- sys.stderr.write(message % self.pidfile)
- sys.exit(1)
-
- # Start the daemon
- self.daemonize()
- self.run()
-
- def stop(self):
- """
- Stop the daemon
- """
- # Get the pid from the pidfile
- try:
- pf = file(self.pidfile,'r')
- pid = int(pf.read().strip())
- pf.close()
- except IOError:
- pid = None
-
- if not pid:
- return
-
- # Try killing the daemon process
- try:
- while 1:
- os.kill(pid, SIGTERM)
- time.sleep(0.1)
- except OSError, err:
- err = str(err)
- if err.find("No such process") > 0:
- if os.path.exists(self.pidfile):
- os.remove(self.pidfile)
- else:
- print str(err)
- sys.exit(1)
-
- def restart(self):
- """
- Restart the daemon
- """
- self.stop()
- self.start()
-
- def run(self):
- """
- You should override this method when you subclass Daemon. It will be
- called after the process has been daemonized by start() or restart().
- """
-
- def exithook(self):
- """
- Override this method to add additional exit hooks in your subclass.
- """
- self.delpid()
Oops, something went wrong.

0 comments on commit 8a48383

Please sign in to comment.