Hello community,

here is the log from the commit of package python-colorama for openSUSE:Factory 
checked in at 2020-10-22 14:20:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-colorama (Old)
 and      /work/SRC/openSUSE:Factory/.python-colorama.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-colorama"

Thu Oct 22 14:20:58 2020 rev:16 rq:842476 version:0.4.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-colorama/python-colorama.changes  
2020-04-05 20:52:11.353104780 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-colorama.new.3463/python-colorama.changes    
    2020-10-22 14:22:04.446739028 +0200
@@ -1,0 +2,6 @@
+Mon Oct 19 06:43:42 UTC 2020 - Dirk Mueller <dmuel...@suse.com>
+
+- update to 0.4.4:
+  * Fixes 
+
+-------------------------------------------------------------------

Old:
----
  0.4.3.tar.gz

New:
----
  0.4.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-colorama.spec ++++++
--- /var/tmp/diff_new_pack.2OrzVA/_old  2020-10-22 14:22:05.918740348 +0200
+++ /var/tmp/diff_new_pack.2OrzVA/_new  2020-10-22 14:22:05.922740353 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-colorama
-Version:        0.4.3
+Version:        0.4.4
 Release:        0
 Summary:        Cross-platform colored terminal text
 License:        BSD-3-Clause

++++++ 0.4.3.tar.gz -> 0.4.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/.github/FUNDING.yml 
new/colorama-0.4.4/.github/FUNDING.yml
--- old/colorama-0.4.3/.github/FUNDING.yml      2019-12-06 21:48:20.000000000 
+0100
+++ new/colorama-0.4.4/.github/FUNDING.yml      2020-10-13 06:46:33.000000000 
+0200
@@ -9,4 +9,6 @@
 # open_collective: # Replace with a single Open Collective username
 # otechie: # Replace with a single Otechie username
 # patreon: # Replace with a single Patreon username
+custom: 
["https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2MZ9D2GMLYCUJ&item_name=Colorama&currency_code=USD";]
 tidelift: "pypi/colorama"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/.gitignore 
new/colorama-0.4.4/.gitignore
--- old/colorama-0.4.3/.gitignore       2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/.gitignore       2020-10-13 06:46:33.000000000 +0200
@@ -2,11 +2,12 @@
 *.egg-info
 .coverage
 .tox/
-MANIFEST
-dist
-tags
+/MANIFEST
+/build/
+/dist/
+/sandbox/
+/tags
 virtualenv
-build
 
 # PyCharm
 .idea
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/.travis.yml 
new/colorama-0.4.4/.travis.yml
--- old/colorama-0.4.3/.travis.yml      2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/.travis.yml      2020-10-13 06:46:33.000000000 +0200
@@ -1,12 +1,16 @@
 language: python
 cache: pip
-python:
-  - "2.7"
-  - "3.8"
-  - "3.7"
-  - "3.6"
-  - "3.5"
-  - "pypy"
+matrix:
+  include:
+    - python: 2.7
+    - python: 3.8
+    - arch: arm64
+      python: 3.7
+    - arch: amd64
+      python: 3.7
+    - python: 3.6
+    - python: 3.5
+    - python: pypy
 install:
   - "pip install mock"
 script: "python -m unittest discover -p *_test.py"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/CHANGELOG.rst 
new/colorama-0.4.4/CHANGELOG.rst
--- old/colorama-0.4.3/CHANGELOG.rst    2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/CHANGELOG.rst    2020-10-13 06:46:33.000000000 +0200
@@ -1,3 +1,10 @@
+0.4.3
+  * Fix release 0.4.2 which was uploaded with missing files.
+0.4.2
+  * #228: Drop support for EOL Python 3.4, and add 3.7 and 3.8.
+    Thanks to hugovk.
+  * Several additions and fixes to documentation and metadata.
+  * Added Tidelift subscription information.
 0.4.1
   * Fix issue #196: prevent exponential number of calls when calling 'init'
     multiple times. Reported by bbayles and fixed by Delgan.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/Makefile new/colorama-0.4.4/Makefile
--- old/colorama-0.4.3/Makefile 2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/Makefile 2020-10-13 06:46:33.000000000 +0200
@@ -10,24 +10,56 @@
        @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
                awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-7s\033[0m 
%s\n", $$1, $$2}'
 
-clean: ## Remove build artifacts and .pyc files
-       -rm -rf build dist MANIFEST colorama.egg-info
+
+# bootstrap environment
+
+virtualenv=~/.virtualenvs/colorama
+pip=$(virtualenv)/bin/pip
+syspython=python3.8
+python=$(virtualenv)/bin/python
+twine=$(virtualenv)/bin/twine
+version=$(shell $(python) setup.py --version)
+
+clean: ## Remove build artifacts, .pyc files, virtualenv
+       -rm -rf build dist MANIFEST colorama.egg-info $(virtualenv)
        -find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ 
-delete
 .PHONY: clean
 
-build: clean ## Build an sdist and wheel
-       python setup.py sdist bdist_wheel
-.PHONY: sdist
+$(virtualenv):
+       $(syspython) -m venv --clear $(virtualenv)
+       $(pip) install --upgrade pip
 
-upload: ## Upload our sdist and wheel
-       twine upload dist/*
-.PHONY: release
+venv: $(virtualenv) ## Create or clear a virtualenv
+.PHONY: venv
+
+bootstrap: venv ## Populate the virtualenv
+       $(pip) install -r requirements.txt -r requirements-dev.txt
+.PHONY: bootstrap
 
-test: ## Run tests
-       python -m unittest discover -p *_test.py
-.PHONY: test
+
+# development
 
 tags: ## Create tags file
        ctags -R ${NAME}
 .PHONY: tags
 
+test: ## Run tests
+       $(python) -m unittest discover -p *_test.py
+.PHONY: test
+
+
+# build packages
+
+build: ## Build an sdist and wheel
+       $(python) -m pip install --upgrade setuptools wheel
+       $(python) setup.py sdist bdist_wheel
+.PHONY: sdist
+
+test-release: build
+       ./test-release
+.PHONY: test-release
+
+release: ## Upload our sdist and wheel
+       $(twine) upload dist/colorama-$(version)-*
+.PHONY: release
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/README.rst 
new/colorama-0.4.4/README.rst
--- old/colorama-0.4.3/README.rst       2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/README.rst       2020-10-13 06:46:33.000000000 +0200
@@ -10,19 +10,36 @@
     :target: https://travis-ci.org/tartley/colorama
     :alt: Build Status
 
-Download and docs:
-    https://pypi.org/project/colorama/
-Source code & Development:
-    https://github.com/tartley/colorama
-Colorama for Enterprise:
-    https://github.com/tartley/colorama/blob/master/ENTERPRISE.md
-
-Description
-===========
+Colorama
+========
 
 Makes ANSI escape character sequences (for producing colored terminal text and
 cursor positioning) work under MS Windows.
 
+.. |donate| image:: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif
+  :target: 
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2MZ9D2GMLYCUJ&item_name=Colorama&currency_code=USD
+  :alt: Donate with Paypal
+
+`PyPI for releases <https://pypi.org/project/colorama/>`_ ·
+`Github for source <https://github.com/tartley/colorama>`_ ·
+`Colorama for enterprise on Tidelift 
<https://github.com/tartley/colorama/blob/master/ENTERPRISE.md>`_
+
+If you find Colorama useful, please |donate| to the authors. Thank you!
+
+
+Installation
+------------
+
+.. code-block:: bash
+
+    pip install colorama
+    # or
+    conda install -c anaconda colorama
+
+
+Description
+-----------
+
 ANSI escape character sequences have long been used to produce colored terminal
 text and cursor positioning on Unix and Macs. Colorama makes this work on
 Windows, too, by wrapping ``stdout``, stripping ANSI sequences it finds (which
@@ -30,11 +47,6 @@
 appropriate win32 calls to modify the state of the terminal. On other 
platforms,
 Colorama does nothing.
 
-Colorama also provides some shortcuts to help generate ANSI sequences
-but works fine in conjunction with any other ANSI sequence generation library,
-such as the venerable Termcolor (https://pypi.org/project/termcolor/)
-or the fabulous Blessings (https://pypi.org/project/blessings/).
-
 This has the upshot of providing a simple cross-platform API for printing
 colored terminal text from Python, and has the happy side-effect that existing
 applications or libraries which use ANSI sequences to produce colored output on
@@ -60,26 +72,14 @@
     :height: 325
     :alt: Same ANSI sequences on Windows, using Colorama.
 
-These screengrabs show that, on Windows, Colorama does not support ANSI 'dim
+These screenshots show that, on Windows, Colorama does not support ANSI 'dim
 text'; it looks the same as 'normal text'.
 
-
-License
-=======
-
-Copyright Jonathan Hartley & Arnon Yaari, 2013. BSD 3-Clause license; see 
LICENSE file.
-
-
-Dependencies
-============
-
-None, other than Python. Tested on Python 2.7, 3.5, 3.6, 3.7 and 3.8.
-
 Usage
-=====
+-----
 
 Initialisation
---------------
+..............
 
 Applications should initialise Colorama using:
 
@@ -97,14 +97,14 @@
 applications to call ``init()`` unconditionally on all platforms, after which
 ANSI output should just work.
 
-To stop using colorama before your program exits, simply call ``deinit()``.
+To stop using Colorama before your program exits, simply call ``deinit()``.
 This will restore ``stdout`` and ``stderr`` to their original values, so that
 Colorama is disabled. To resume using Colorama again, call ``reinit()``; it is
-cheaper to calling ``init()`` again (but does the same thing).
+cheaper than calling ``init()`` again (but does the same thing).
 
 
 Colored Output
---------------
+..............
 
 Cross-platform printing of colored text can then be done using Colorama's
 constant shorthand for ANSI escape sequences:
@@ -125,8 +125,10 @@
     print('\033[31m' + 'some red text')
     print('\033[39m') # and reset to default color
 
-...or, Colorama can be used happily in conjunction with existing ANSI libraries
-such as Termcolor:
+...or, Colorama can be used in conjunction with existing ANSI libraries
+such as the venerable `Termcolor <https://pypi.org/project/termcolor/>`_
+or the fabulous `Blessings <https://pypi.org/project/blessings/>`_.
+This is highly recommended for anything more than trivial coloring:
 
 .. code-block:: python
 
@@ -150,14 +152,14 @@
 
 
 Cursor Positioning
-------------------
+..................
 
 ANSI codes to reposition the cursor are supported. See ``demos/demo06.py`` for
 an example of how to generate them.
 
 
 Init Keyword Args
------------------
+.................
 
 ``init()`` accepts some ``**kwargs`` to override default behaviour.
 
@@ -174,7 +176,7 @@
         print('automatically back to default color again')
 
 init(strip=None):
-    Pass ``True`` or ``False`` to override whether ansi codes should be
+    Pass ``True`` or ``False`` to override whether ANSI codes should be
     stripped from the output. The default behaviour is to strip if on Windows
     or if output is redirected (not a tty).
 
@@ -184,7 +186,7 @@
     and output is to a tty (terminal).
 
 init(wrap=True):
-    On Windows, colorama works by replacing ``sys.stdout`` and ``sys.stderr``
+    On Windows, Colorama works by replacing ``sys.stdout`` and ``sys.stderr``
     with proxy objects, which override the ``.write()`` method to do their 
work.
     If this wrapping causes you problems, then this can be disabled by passing
     ``init(wrap=False)``. The default behaviour is to wrap if ``autoreset`` or
@@ -208,39 +210,10 @@
         print(Fore.BLUE + 'blue text on stderr', file=stream)
 
 
-Installation
-=======================
-colorama is currently installable from PyPI:
-
-    pip install colorama
-    
-colorama also can be installed by the conda package manager:
-
-    conda install -c anaconda colorama 
-
-
-Status & Known Problems
-=======================
-
-I've personally only tested it on Windows XP (CMD, Console2), Ubuntu
-(gnome-terminal, xterm), and OS X.
-
-Some presumably valid ANSI sequences aren't recognised (see details below),
-but to my knowledge nobody has yet complained about this. Puzzling.
-
-See outstanding issues and wishlist:
-https://github.com/tartley/colorama/issues
-
-If anything doesn't work for you, or doesn't do what you expected or hoped for,
-I'd love to hear about it on that issues list, would be delighted by patches,
-and would be happy to grant commit access to anyone who submits a working patch
-or two.
-
-
 Recognised ANSI Sequences
-=========================
+.........................
 
-ANSI sequences generally take the form:
+ANSI sequences generally take the form::
 
     ESC [ <param> ; <param> ... <command>
 
@@ -249,7 +222,7 @@
 generally synonymous with passing a single zero. No spaces exist in the
 sequence; they have been inserted here simply to read more easily.
 
-The only ANSI sequences that colorama converts into win32 calls are::
+The only ANSI sequences that Colorama converts into win32 calls are::
 
     ESC [ 0 m       # reset all (colors and brightness)
     ESC [ 1 m       # bright
@@ -306,29 +279,78 @@
 GitHub.
 
 
+Status & Known Problems
+-----------------------
+
+I've personally only tested it on Windows XP (CMD, Console2), Ubuntu
+(gnome-terminal, xterm), and OS X.
+
+Some presumably valid ANSI sequences aren't recognised (see details below),
+but to my knowledge nobody has yet complained about this. Puzzling.
+
+See outstanding issues and wish-list:
+https://github.com/tartley/colorama/issues
+
+If anything doesn't work for you, or doesn't do what you expected or hoped for,
+I'd love to hear about it on that issues list, would be delighted by patches,
+and would be happy to grant commit access to anyone who submits a working patch
+or two.
+
+
+License
+-------
+
+Copyright Jonathan Hartley & Arnon Yaari, 2013-2020. BSD 3-Clause license; see
+LICENSE file.
+
+
 Development
-===========
+-----------
 
 Help and fixes welcome!
 
-Running tests requires:
+Tested on CPython 2.7, 3.5, 3.6, 3.7 and 3.8.
 
-- Michael Foord's ``mock`` module to be installed.
-- Tests are written using 2010-era updates to ``unittest``
+No requirements other than the standard library.
+Development requirements are captured in requirements-dev.txt.
 
-To run tests::
+To create and populate a virtual environment::
 
-   python -m unittest discover -p *_test.py
+    ./bootstrap.ps1 # Windows
+    make bootstrap # Linux
 
-This, like a few other handy commands, is captured in a ``Makefile``.
+To run tests::
+
+   ./test.ps1 # Windows
+   make test # Linux
 
 If you use nose to run the tests, you must pass the ``-s`` flag; otherwise,
 ``nosetests`` applies its own proxy to ``stdout``, which confuses the unit
 tests.
 
+To build a local wheel file::
+
+    ./build.ps1 # Windows
+    make build # Linux
+
+To test the wheel, (upload to test PyPI, then 'pip install' & use it)::
+
+    ./test-release.ps1 # Windows
+    make test-release # Linux
+
+To upload the wheel to PyPI::
+
+    ./release.ps1 # Windows
+    make release # Linux
+
+To clean all generated files, builds, virtualenv::
+
+    ./clean.ps1 # Windows
+    make clean # Linux
+
 
 Professional support
-====================
+--------------------
 
 .. |tideliftlogo| image:: 
https://cdn2.hubspot.net/hubfs/4008838/website/logos/logos_for_download/Tidelift_primary-shorthand-logo.png
    :alt: Tidelift
@@ -349,7 +371,8 @@
 
 
 Thanks
-======
+------
+
 * Marc Schlaich (schlamar) for a ``setup.py`` fix for Python2.5.
 * Marc Abramowitz, reported & fixed a crash on exit with closed ``stdout``,
   providing a solution to issue #7's setuptools/distutils debate,
@@ -378,3 +401,4 @@
   to include Python 3.3 and 3.4
 * Andy Neff for fixing RESET of LIGHT_EX colors.
 * Jonathan Hartley for the initial idea and implementation.
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/bootstrap.ps1 
new/colorama-0.4.4/bootstrap.ps1
--- old/colorama-0.4.3/bootstrap.ps1    1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/bootstrap.ps1    2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,9 @@
+$syspython="python3.8.exe"
+$ve="$HOME\.virtualenvs\colorama"
+$bin="$ve\Scripts"
+
+echo "Create $syspython virtualenv $ve"
+& $syspython -m venv --clear "$ve"
+& $bin\python.exe -m pip install --upgrade pip
+& $bin\python.exe -m pip install -r requirements.txt -r requirements-dev.txt
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/build.ps1 new/colorama-0.4.4/build.ps1
--- old/colorama-0.4.3/build.ps1        1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/build.ps1        2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,6 @@
+$ve="$HOME\.virtualenvs\colorama"
+$bin="$ve\Scripts"
+
+& $bin\python.exe -m pip install --upgrade setuptools wheel
+& $bin\python.exe setup.py sdist bdist_wheel
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/clean.ps1 new/colorama-0.4.4/clean.ps1
--- old/colorama-0.4.3/clean.ps1        1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/clean.ps1        2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,6 @@
+$syspython="python3.8.exe"
+$ve="$HOME\.virtualenvs\colorama"
+
+remove-item -r -fo * -I build,dist,MANIFEST,colorama.egg-info,$ve,sandbox
+& $syspython -Bc "import pathlib, shutil; [shutil.rmtree(p) for p in 
pathlib.Path('.').rglob('__pycache__')]"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/__init__.py 
new/colorama-0.4.4/colorama/__init__.py
--- old/colorama-0.4.3/colorama/__init__.py     2019-12-06 21:48:20.000000000 
+0100
+++ new/colorama-0.4.4/colorama/__init__.py     2020-10-13 06:46:33.000000000 
+0200
@@ -3,4 +3,4 @@
 from .ansi import Fore, Back, Style, Cursor
 from .ansitowin32 import AnsiToWin32
 
-__version__ = '0.4.3'
+__version__ = '0.4.4'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/ansi.py 
new/colorama-0.4.4/colorama/ansi.py
--- old/colorama-0.4.3/colorama/ansi.py 2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/colorama/ansi.py 2020-10-13 06:46:33.000000000 +0200
@@ -6,7 +6,7 @@
 
 CSI = '\033['
 OSC = '\033]'
-BEL = '\007'
+BEL = '\a'
 
 
 def code_to_chars(code):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/ansitowin32.py 
new/colorama-0.4.4/colorama/ansitowin32.py
--- old/colorama-0.4.3/colorama/ansitowin32.py  2019-12-06 21:48:20.000000000 
+0100
+++ new/colorama-0.4.4/colorama/ansitowin32.py  2020-10-13 06:46:33.000000000 
+0200
@@ -3,7 +3,7 @@
 import sys
 import os
 
-from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
+from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
 from .winterm import WinTerm, WinColor, WinStyle
 from .win32 import windll, winapi_test
 
@@ -68,7 +68,7 @@
     win32 function calls.
     '''
     ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?')   # 
Control Sequence Introducer
-    ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?')        # 
Operating System Command
+    ANSI_OSC_RE = re.compile('\001?\033\\]([^\a]*)(\a)\002?')             # 
Operating System Command
 
     def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
         # The wrapped stream (normally sys.stdout or sys.stderr)
@@ -247,11 +247,12 @@
             start, end = match.span()
             text = text[:start] + text[end:]
             paramstring, command = match.groups()
-            if command in '\x07':       # \x07 = BEL
-                params = paramstring.split(";")
-                # 0 - change title and icon (we will only change title)
-                # 1 - change icon (we don't support this)
-                # 2 - change title
-                if params[0] in '02':
-                    winterm.set_title(params[1])
+            if command == BEL:
+                if paramstring.count(";") == 1:
+                    params = paramstring.split(";")
+                    # 0 - change title and icon (we will only change title)
+                    # 1 - change icon (we don't support this)
+                    # 2 - change title
+                    if params[0] in '02':
+                        winterm.set_title(params[1])
         return text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/tests/ansitowin32_test.py 
new/colorama-0.4.4/colorama/tests/ansitowin32_test.py
--- old/colorama-0.4.3/colorama/tests/ansitowin32_test.py       2019-12-06 
21:48:20.000000000 +0100
+++ new/colorama-0.4.4/colorama/tests/ansitowin32_test.py       2020-10-13 
06:46:33.000000000 +0200
@@ -2,7 +2,10 @@
 from io import StringIO
 from unittest import TestCase, main
 
-from mock import MagicMock, Mock, patch
+try:
+    from unittest.mock import MagicMock, Mock, patch
+except ImportError:
+    from mock import MagicMock, Mock, patch
 
 from ..ansitowin32 import AnsiToWin32, StreamWrapper
 from .utils import osname
@@ -203,6 +206,21 @@
             [a[0][0] for a in listener.call_args_list],
             [33, 11, 22] )
 
+    def test_osc_codes(self):
+        mockStdout = Mock()
+        stream = AnsiToWin32(mockStdout, convert=True)
+        with patch('colorama.ansitowin32.winterm') as winterm:
+            data = [
+                '\033]0\x07',                      # missing arguments
+                '\033]0;foo\x08',                  # wrong OSC command
+                '\033]0;colorama_test_title\x07',  # should work
+                '\033]1;colorama_test_title\x07',  # wrong set command
+                '\033]2;colorama_test_title\x07',  # should work
+                '\033]' + ';' * 64 + '\x08',       # see issue #247
+            ]
+            for code in data:
+                stream.write(code)
+            self.assertEqual(winterm.set_title.call_count, 2)
 
 if __name__ == '__main__':
     main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/tests/initialise_test.py 
new/colorama-0.4.4/colorama/tests/initialise_test.py
--- old/colorama-0.4.3/colorama/tests/initialise_test.py        2019-12-06 
21:48:20.000000000 +0100
+++ new/colorama-0.4.4/colorama/tests/initialise_test.py        2020-10-13 
06:46:33.000000000 +0200
@@ -1,9 +1,12 @@
 # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
 import os
 import sys
-from unittest import TestCase, main
+from unittest import TestCase, main, skipUnless
 
-from mock import patch
+try:
+    from unittest.mock import patch
+except ImportError:
+    from mock import patch
 
 from ..ansitowin32 import StreamWrapper
 from ..initialise import init
@@ -15,6 +18,7 @@
 
 class InitTest(TestCase):
 
+    @skipUnless(sys.stdout.isatty(), "sys.stdout is not a tty")
     def setUp(self):
         # sanity check
         self.assertNotWrapped()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/tests/utils.py 
new/colorama-0.4.4/colorama/tests/utils.py
--- old/colorama-0.4.3/colorama/tests/utils.py  2019-12-06 21:48:20.000000000 
+0100
+++ new/colorama-0.4.4/colorama/tests/utils.py  2020-10-13 06:46:33.000000000 
+0200
@@ -4,7 +4,10 @@
 import sys
 import os
 
-from mock import Mock
+try:
+    from unittest.mock import Mock
+except ImportError:
+    from mock import Mock
 
 class StreamTTY(StringIO):
     def isatty(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/colorama/tests/winterm_test.py 
new/colorama-0.4.4/colorama/tests/winterm_test.py
--- old/colorama-0.4.3/colorama/tests/winterm_test.py   2019-12-06 
21:48:20.000000000 +0100
+++ new/colorama-0.4.4/colorama/tests/winterm_test.py   2020-10-13 
06:46:33.000000000 +0200
@@ -2,7 +2,10 @@
 import sys
 from unittest import TestCase, main, skipUnless
 
-from mock import Mock, patch
+try:
+    from unittest.mock import Mock, patch
+except ImportError:
+    from mock import Mock, patch
 
 from ..winterm import WinColor, WinStyle, WinTerm
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/demos/demo06.py 
new/colorama-0.4.4/demos/demo06.py
--- old/colorama-0.4.3/demos/demo06.py  2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/demos/demo06.py  2020-10-13 06:46:33.000000000 +0200
@@ -2,7 +2,7 @@
 from __future__ import print_function
 import fixpath
 import colorama
-from colorama import Fore, Back, Style
+from colorama import Fore, Back, Style, Cursor
 from random import randint, choice
 from string import printable
 
@@ -25,8 +25,7 @@
 
 def main():
     colorama.init()
-    # gratuitous use of lambda.
-    pos = lambda y, x: '\x1b[%d;%dH' % (y, x)
+    pos = lambda y, x: Cursor.POS(x, y)
     # draw a white border.
     print(Back.WHITE, end='')
     print('%s%s' % (pos(MINY, MINX), ' '*MAXX), end='')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/release.ps1 
new/colorama-0.4.4/release.ps1
--- old/colorama-0.4.3/release.ps1      1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/release.ps1      2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,7 @@
+$ve="$HOME\.virtualenvs\colorama"
+$bin="$ve\Scripts"
+$version="$(& $bin\python.exe setup.py --version)"
+
+# Upload to PyPI.
+& $bin\twine.exe upload dist\colorama-$version-*
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/requirements-dev.txt 
new/colorama-0.4.4/requirements-dev.txt
--- old/colorama-0.4.3/requirements-dev.txt     2019-12-06 21:48:20.000000000 
+0100
+++ new/colorama-0.4.4/requirements-dev.txt     2020-10-13 06:46:33.000000000 
+0200
@@ -1,3 +1,3 @@
-mock>=1.0.1
+mock>=1.0.1;python_version<"3.3"
 twine>=3.1.1
 -e .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/test-release 
new/colorama-0.4.4/test-release
--- old/colorama-0.4.3/test-release     1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/test-release     2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+# Test the currently built release of Colorama from the dist/ dir.
+# Run this before making a release.
+#
+# This should be run on Windows, because Colorama is mostly a no-op elsewhere.
+# Hmmm, this script should probably be a .bat file then? Nah, WSL FTW.
+#
+# Uploads package from the dist/ directory to the *test* PyPI.
+# Create a fresh virtualenvironment and install colorama from test PyPI.
+# Import Colorama and make trivial use of it.
+
+# Exit on error
+set -eu -o pipefail
+
+syspython=python3.8
+bin="$HOME/.virtualenvs/colorama/bin"
+version=$($bin/python setup.py --version)
+sandbox=test-release-playground
+
+# Upload to the test PyPI.
+$bin/twine upload --repository testpypi dist/colorama-$version-* \
+    || echo "  > Expect a 400 if package was already uploaded."
+
+# cd elsewhere so we cannot import from local source.
+mkdir -p $sandbox
+(
+    cd $sandbox
+
+    # Create a temporary disposable virtualenv.
+    $syspython -m venv --clear venv
+
+    # Install the package we just uploaded.
+    venv/bin/python -m pip --quiet install --index-url 
https://test.pypi.org/simple colorama==$version
+
+    # Import and use Colorama from the temp virtualenv.
+    venv/bin/python -c "import colorama; colorama.init(); 
print(colorama.Fore.GREEN + \"OK: Colorama\", colorama.__version__, \"from test 
pypi install.\")"
+)
+
+# Tidy up
+rm -rf $sandbox
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/test-release.ps1 
new/colorama-0.4.4/test-release.ps1
--- old/colorama-0.4.3/test-release.ps1 1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/test-release.ps1 2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,29 @@
+$syspython="python3.8.exe"
+$ve="$HOME\.virtualenvs\colorama"
+$bin="$ve\Scripts"
+$version="$(& $bin\python.exe setup.py --version)"
+
+# Upload to the test PyPI.
+& $bin\twine.exe upload --repository testpypi dist\colorama-$version-*
+if(!$?) {
+    write-host "  > Expect a 400 if package was already uploaded"
+}
+
+# cd elsewhere so we cannot import from local source.
+mkdir -force sandbox | out-null
+cd sandbox
+
+# Create a temporary disposable virtualenv.
+& $syspython -m venv --clear venv
+
+# Install the package we just uploaded.
+venv\Scripts\python -m pip --quiet install --index-url 
https://test.pypi.org/simple colorama==$version
+# Import and use colorama from the temp virtualenv.
+venv\Scripts\python.exe -c @"
+import colorama;
+colorama.init();
+print(colorama.Fore.GREEN + ""OK Colorama "" + colorama.__version__ + "" from 
test pypi install."")
+"@
+
+cd ..
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/test.ps1 new/colorama-0.4.4/test.ps1
--- old/colorama-0.4.3/test.ps1 1970-01-01 01:00:00.000000000 +0100
+++ new/colorama-0.4.4/test.ps1 2020-10-13 06:46:33.000000000 +0200
@@ -0,0 +1,5 @@
+$ve="$HOME\.virtualenvs\colorama"
+$bin="$ve\Scripts"
+
+& $bin\python.exe -m unittest discover -p *_test.py
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/colorama-0.4.3/tox.ini new/colorama-0.4.4/tox.ini
--- old/colorama-0.4.3/tox.ini  2019-12-06 21:48:20.000000000 +0100
+++ new/colorama-0.4.4/tox.ini  2020-10-13 06:46:33.000000000 +0200
@@ -2,5 +2,5 @@
 envlist = py27, py35, py36, py37, py38, pypy
 
 [testenv]
-deps = mock
+deps = py27,pypy: mock
 commands = python -m unittest discover -p *_test.py


Reply via email to