Skip to content
Permalink
Browse files

Remove dependency on the external meld3 package

  • Loading branch information...
mnaberez committed Sep 6, 2019
1 parent dbff619 commit d09d843493eb77cb8c3df52e1f7e636ad0e5b4dd
Showing with 3,197 additions and 24 deletions.
  1. +4 −1 CHANGES.rst
  2. +0 −3 docs/installing.rst
  3. +0 −9 setup.cfg
  4. +1 −1 setup.py
  5. +43 −4 supervisor/compat.py
  6. +1,313 −0 supervisor/templating.py
  7. +1,831 −0 supervisor/tests/test_templating.py
  8. +1 −1 supervisor/ui/status.html
  9. +1 −1 supervisor/ui/tail.html
  10. +1 −1 supervisor/version.txt
  11. +2 −2 supervisor/web.py
  12. +0 −1 tox.ini
@@ -1,9 +1,12 @@
4.0.5.dev0 (Next Release)
4.1.0.dev0 (Next Release)
-------------------------

- Fixed a Python 3.8 compatibility issue caused by the removal of
``cgi.escape()``. Patch by Mattia Procopio.

- The ``meld3`` package is no longer a dependency. A version of ``meld3``
is now included within the ``supervisor`` package itself.

4.0.4 (2019-07-15)
------------------

@@ -54,9 +54,6 @@ which is internet-connected:
- setuptools (latest) from `https://pypi.org/pypi/setuptools/
<https://pypi.org/pypi/setuptools/>`_.

- meld3 (latest) from `https://pypi.org/pypi/meld3/
<https://pypi.org/pypi/meld3/>`_.

Copy these files to removable media and put them on the target
machine. Install each onto the target machine as per its
instructions. This typically just means unpacking each file and
@@ -1,15 +1,6 @@
[easy_install]
zip_ok = false

[bdist_rpm]
;If you are building your own RPM of Supervisor, it is recommended that you
;also build your own RPM of meld3 (https://github.com/Supervisor/meld3) to
;ensure you have the most recent version. Your distribution may have a
;"python-meld3" package that you might be able substitute here, but it may
;not be compatible and may not have the most recent bug fixes.
requires =
meld3

[aliases]
dev = develop easy_install supervisor[testing]

@@ -22,7 +22,7 @@
elif (3, 0) < py_version < (3, 4):
raise RuntimeError('On Python 3, Supervisor requires Python 3.4 or later')

requires = ['meld3 >= 1.0.0']
requires = []
tests_require = []
if py_version < (3, 3):
tests_require.append('mock')
@@ -8,9 +8,20 @@
long = long
raw_input = raw_input
unicode = unicode
unichr = unichr
basestring = basestring
def as_bytes(s): return s if isinstance(s, str) else s.encode('utf-8')
def as_string(s): return s if isinstance(s, unicode) else s.decode('utf-8')

def as_bytes(s, encoding='utf-8'):
if isinstance(s, str):
return s
else:
return s.encode(encoding)

def as_string(s, encoding='utf-8'):
if isinstance(s, unicode):
return s
else:
return s.decode(encoding)

def is_text_stream(stream):
try:
@@ -25,15 +36,28 @@ def is_text_stream(stream):
except ImportError:
import io
return isinstance(stream, io.TextIOWrapper)

else: # pragma: no cover
long = int
basestring = str
raw_input = input
unichr = chr

class unicode(str):
def __init__(self, string, encoding, errors):
str.__init__(self, string)
def as_bytes(s): return s if isinstance(s,bytes) else s.encode('utf8')
def as_string(s): return s if isinstance(s,str) else s.decode('utf8')

def as_bytes(s, encoding='utf8'):
if isinstance(s, bytes):
return s
else:
return s.encode(encoding)

def as_string(s, encoding='utf8'):
if isinstance(s, str):
return s
else:
return s.decode(encoding)

def is_text_stream(stream):
import _io
@@ -106,7 +130,22 @@ def is_text_stream(stream):
except ImportError: # pragma: no cover
import _thread as thread

try: # pragma: no cover
from types import StringTypes
except ImportError: # pragma: no cover
StringTypes = (str,)

try: # pragma: no cover
from html import escape
except ImportError: # pragma: no cover
from cgi import escape

try: # pragma: no cover
import html.entities as htmlentitydefs
except ImportError: # pragma: no cover
import htmlentitydefs

try: # pragma: no cover
from html.parser import HTMLParser
except ImportError: # pragma: no cover
from HTMLParser import HTMLParser

0 comments on commit d09d843

Please sign in to comment.
You can’t perform that action at this time.