Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Jan 21, 2020
2 parents 31cbab2 + a41d48b commit 78866b2
Show file tree
Hide file tree
Showing 26 changed files with 167 additions and 246 deletions.
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changes
=======

0.4.0 -- 2020-01-21
-------------------
* Removed deprecated functions, modules etc. See #56, #57, #59, #61, #67.
* Deprecated usage of keywords "color" and "background". Replacements: "dark"
and "light". See #60. The deprecated keywords will be removed in 1.0.0.
* Minor performance improvements for writing SVG (at least for Py 3.7, YMMV).
* Documentation improvements


0.3.9 -- 2020-01-19
-------------------
* Fixed #71: Dark / light modules of the finder pattern may be interpreted
Expand Down
6 changes: 3 additions & 3 deletions docs/_static/chart_create_1m.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_create_30h.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_create_7q.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_png.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/_static/chart_svg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_static/cli/black-magic-woman.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_static/cli/boom-boom.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/cli/diamond.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_static/cli/dontgiveup.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/cli/excited.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/cli/hotel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/_static/contact/my-mecard.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/_static/contact/my-vcard.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions docs/command-line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,22 @@ The generated QR Codes will have a recommended quiet zone / border around the
symbol. To change the size of the border, :option:`--border <segno --border>`
can be utilized::

$ segno --border=0 --output=black-magic-woman.svg "Black Magic Woman"
$ segno --border 0 --scale 4 --output=black-magic-woman.svg "Black Magic Woman"

.. image:: _static/cli/black-magic-woman.svg
:alt: QR Code "Black Magic Woman" using quiet zone of zero.

::

$ segno --border=10 --output=diamond.png "Shine On You Crazy Diamond"
$ segno --border 10 --scale 4 --output diamond.png "Shine On You Crazy Diamond"

.. image:: _static/cli/diamond.png
:alt: QR Code "Shine On You Crazy Diamond" using quiet zone of ten.


::

$ segno -b=30 --output=boom-boom.svg Boom Boom
$ segno -b 30 --scale 4 --output=boom-boom.svg Boom Boom

.. image:: _static/cli/boom-boom.svg
:alt: QR Code "Boom Boom" using quiet zone of 30.
Expand All @@ -166,23 +166,24 @@ Usually, all QR Codes are serialized in black and white. Use

Change the foreground color to darkblue::

$ segno --dark=darkblue --output=excited.png "So Excited"
$ segno --dark=darkblue --scale 4 --output=excited.png "So Excited"

.. image:: _static/cli/excited.png
:alt: QR Code "So Excited" with foreground color "darkblue"


Change the background color to transparent::

$ segno --light=transparent --output=hotel.png "Hotel California"
$ segno --light=transparent --scale 4 --output=hotel.png "Hotel California"

.. image:: _static/cli/hotel.png
:alt: QR Code "Hotel California" with background color "transparent"


Change the foreground color to darkblue and background to yellow::
Change the color of the dark modules to darkblue and the color of the light
modules to yellow::

$ segno --dark=darkblue --light=yellow --output=dontgiveup.svg "Don't Give Up"
$ segno --dark=darkblue --light=yellow --scale 4 --output=dontgiveup.svg "Don't Give Up"

.. image:: _static/cli/dontgiveup.svg
:alt: QR Code "Don't Give Up" with foreground color "transparent"
Expand Down
10 changes: 8 additions & 2 deletions docs/contact-information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ contact information as MeCard.
'3-L'
>>> # Some params accept multiple values, like email, phone, url
>>> qr = helpers.make_mecard(name='Doe,John', email=('me@example.org', 'another@example.org'), url=['http://www.example.org', 'https://example.org/~joe'])
>>> qr.save('my-mecard.svg')
>>> qr.save('my-mecard.svg', scale=4)
.. image:: _static/contact/my-mecard.svg
:alt: QR Code encoding a MeCard

A factory function which returns the MeCard as string is available as well.

Expand Down Expand Up @@ -45,7 +48,10 @@ contact information as vCard version 3.0.
'5-L'
>>> # Some params accept multiple values, like email, phone, url
>>> qr = helpers.make_vcard(name='Doe;John', displayname='John Doe', email=('me@example.org', 'another@example.org'), url=['http://www.example.org', 'https://example.org/~joe'])
>>> qr.save('my-vcard.svg')
>>> qr.save('my-vcard.svg', scale=4)
.. image:: _static/contact/my-vcard.svg
:alt: QR Code encoding a vCard

A factory function which returns the vCard as string is available as well.

Expand Down
8 changes: 7 additions & 1 deletion docs/svg-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ encoding
String (default: "utf--8").

Sets the encoding of the XML document. If set to ``None``, the encoding
parameter is omitted.
parameter of the XML declaration is omitted but the XML default encoding "UTF-8"
is used.

.. note::
It is not recommended to set the encoding to another value than "utf-8"
if ``xmldecl`` is set to ``False``.


svgversion
~~~~~~~~~~
Expand Down
44 changes: 22 additions & 22 deletions sandbox/out/results.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PyQRCode create 1-M,8.01
PyQRCodeNG create 1-M,6.05
qrcodegen create 1-M,5.14
qrcode create 1-M,3.68
Segno create 1-M,2.01
PyQRCode create 7-Q,36.63
PyQRCodeNG create 7-Q,28.64
qrcodegen create 7-Q,23.53
qrcode create 7-Q,16.92
Segno create 7-Q,10.16
PyQRCode create 30-H,354.63
PyQRCodeNG create 30-H,277.11
qrcodegen create 30-H,226.25
qrcode create 30-H,162.53
Segno create 30-H,100.68
PyQRCode create 1-M,8.03
PyQRCodeNG create 1-M,5.96
qrcodegen create 1-M,5.11
qrcode create 1-M,3.65
Segno create 1-M,1.99
PyQRCode create 7-Q,36.56
PyQRCodeNG create 7-Q,28.73
qrcodegen create 7-Q,23.16
qrcode create 7-Q,16.63
Segno create 7-Q,9.99
PyQRCode create 30-H,348.89
PyQRCodeNG create 30-H,279.39
qrcodegen create 30-H,225.12
qrcode create 30-H,161.19
Segno create 30-H,99.93
PyQRCode SVG,8.42
PyQRCodeNG SVG,6.41
qrcodegen SVG,5.59
qrcode SVG path,4.66
PyQRCodeNG SVG,6.40
qrcodegen SVG,5.58
qrcode SVG path,4.64
qrcode SVG rects,5.70
Segno SVG,2.31
PyQRCode PNG 1-M,15.64
Segno SVG,2.34
PyQRCode PNG 1-M,15.57
PyQRCodeNG PNG 1-M,7.88
qrcode PNG 1-M,4.62
Segno PNG 1-M,3.48
qrcode PNG 1-M,4.61
Segno PNG 1-M,3.49
32 changes: 3 additions & 29 deletions segno/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
import sys
from . import encoder
import warnings
from .encoder import QRCodeError, ErrorLevelError, ModeError, MaskError, \
VersionError, DataOverflowError
from . import writers, utils
try: # pragma: no cover
str_type = basestring
except NameError: # pragma: no cover
str_type = str

__version__ = '0.3.9'
__version__ = '0.4.0'

__all__ = ('make', 'make_qr', 'make_micro', 'make_sequence', 'QRCode',
'QRCodeSequence')
Expand Down Expand Up @@ -875,36 +873,12 @@ def save(self, out, kind=None, **kw):
# Segno <= 0.3.6
try:
kw['dark'] = kw.pop('color')
warnings.warn('"color" is deprecated, use "dark". Support will be removed in 1.0.0', DeprecationWarning)
except KeyError:
pass
try:
kw['light'] = kw.pop('background')
except KeyError:
pass
# Segno 0.3.4 and 0.3.5
try:
cm = kw.pop('colormap')
warnings.warn('"colormap" is deprecated, use the keywords for QRCode.save(). Support will be removed in 0.4.0', DeprecationWarning)
from segno import consts
mt2name = {
consts.TYPE_FINDER_PATTERN_DARK: 'finder_dark',
consts.TYPE_FINDER_PATTERN_LIGHT: 'finder_light',
consts.TYPE_DATA_DARK: 'data_dark',
consts.TYPE_DATA_LIGHT: 'data_light',
consts.TYPE_VERSION_DARK: 'version_dark',
consts.TYPE_VERSION_LIGHT: 'version_light',
consts.TYPE_ALIGNMENT_PATTERN_DARK: 'alignment_dark',
consts.TYPE_ALIGNMENT_PATTERN_LIGHT: 'alignment_light',
consts.TYPE_TIMING_DARK: 'timing_dark',
consts.TYPE_TIMING_LIGHT: 'timing_light',
consts.TYPE_FORMAT_DARK: 'format_dark',
consts.TYPE_FORMAT_LIGHT: 'format_light',
consts.TYPE_SEPARATOR: 'separator',
consts.TYPE_DARKMODULE: 'dark_module',
consts.TYPE_QUIET_ZONE: 'quiet_zone'
}
for mt, clr in cm.items():
kw[mt2name[mt]] = clr
warnings.warn('"background" is deprecated, use "light". Support will be removed in 1.0.0', DeprecationWarning)
except KeyError:
pass
writers.save(self.matrix, self._version, out, kind, **kw)
Expand Down

0 comments on commit 78866b2

Please sign in to comment.