Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 glue (0.13-7) unstable; urgency=medium
 .
   * Use python3 -m sphinx insteat of setuptools helper. (Closes: #1042631)
Author: Angel Abad <angel@debian.org>
Bug-Debian: https://bugs.debian.org/1042631

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2023-11-01

--- glue-0.13.orig/glue/algorithms/__init__.py
+++ glue-0.13/glue/algorithms/__init__.py
@@ -1,9 +1,9 @@
-from .diagonal import DiagonalAlgorithm
-from .horizontal import HorizontalAlgorithm
-from .horizontal_bottom import HorizontalBottomAlgorithm
-from .square import SquareAlgorithm
-from .vertical import VerticalAlgorithm
-from .vertical_right import VerticalRightAlgorithm
+from diagonal import DiagonalAlgorithm
+from horizontal import HorizontalAlgorithm
+from horizontal_bottom import HorizontalBottomAlgorithm
+from square import SquareAlgorithm
+from vertical import VerticalAlgorithm
+from vertical_right import VerticalRightAlgorithm
 
 algorithms = {'diagonal': DiagonalAlgorithm,
               'horizontal': HorizontalAlgorithm,
--- glue-0.13.orig/glue/bin.py
+++ glue-0.13/glue/bin.py
@@ -20,13 +20,13 @@ def main(argv=None):
 
     parser.add_argument("--source", "-s",
                         dest="source",
-                        type=str,
+                        type=unicode,
                         default=os.environ.get('GLUE_SOURCE', None),
                         help="Source path")
 
     parser.add_argument("--output", "-o",
                         dest="output",
-                        type=str,
+                        type=unicode,
                         default=os.environ.get('GLUE_OUTPUT', None),
                         help="Output path")
 
@@ -80,7 +80,7 @@ def main(argv=None):
     group.add_argument("-a", "--algorithm",
                        dest="algorithm",
                        metavar='NAME',
-                       type=str,
+                       type=unicode,
                        default=os.environ.get('GLUE_ALGORITHM', 'square'),
                        choices=['square', 'vertical', 'horizontal',
                                 'vertical-right', 'horizontal-bottom',
@@ -92,7 +92,7 @@ def main(argv=None):
     group.add_argument("--ordering",
                        dest="algorithm_ordering",
                        metavar='NAME',
-                       type=str,
+                       type=unicode,
                        default=os.environ.get('GLUE_ORDERING', 'maxside'),
                        choices=['maxside', 'width', 'height', 'area', 'filename',
                                 '-maxside', '-width', '-height', '-area', '-filename'],
@@ -100,7 +100,7 @@ def main(argv=None):
                              "filename (default: maxside)"))
 
     # Populate the parser with options required by other formats
-    for format in formats.values():
+    for format in formats.itervalues():
         format.populate_argument_parser(parser)
 
     #
@@ -146,7 +146,7 @@ def main(argv=None):
         options.enabled_formats.remove('img')
 
     # Fail if any of the deprecated arguments is used
-    for argument in deprecated_arguments.keys():
+    for argument in deprecated_arguments.iterkeys():
         if getattr(options, argument, None):
             parser.error(("{0} argument is deprectated "
                           "since v0.3").format(deprecated_arguments[argument]))
@@ -233,16 +233,16 @@ def main(argv=None):
                 manager.process()
         else:
             manager.process()
-    except exceptions.ValidationError as e:
+    except exceptions.ValidationError, e:
         sys.stderr.write(e.args[0])
         return e.error_code
-    except exceptions.SourceImagesNotFoundError as e:
+    except exceptions.SourceImagesNotFoundError, e:
         sys.stderr.write("Error: No images found in %s.\n" % e.args[0])
         return e.error_code
-    except exceptions.NoSpritesFoldersFoundError as e:
+    except exceptions.NoSpritesFoldersFoundError, e:
         sys.stderr.write("Error: No sprites folders found in %s.\n" % e.args[0])
         return e.error_code
-    except exceptions.PILUnavailableError as e:
+    except exceptions.PILUnavailableError, e:
         sys.stderr.write(("Error: PIL {0} decoder is unavailable"
                           "Please read the documentation and "
                           "install it before spriting this kind of "
--- glue-0.13.orig/glue/core.py
+++ glue-0.13/glue/core.py
@@ -3,8 +3,8 @@ import os
 import sys
 import copy
 import hashlib
-import io
-import configparser
+import StringIO
+import ConfigParser
 
 from PIL import Image as PILImage
 
@@ -23,11 +23,11 @@ class ConfigurableFromFile(object):
         def clean(value):
             return {'true': True, 'false': False}.get(value.lower(), value)
 
-        config = configparser.RawConfigParser()
+        config = ConfigParser.RawConfigParser()
         config.read(os.path.join(self.config_path, filename))
         try:
             keys = config.options(section)
-        except configparser.NoSectionError:
+        except ConfigParser.NoSectionError:
             return {}
         return dict([[k, clean(config.get(section, k))] for k in keys])
 
@@ -48,16 +48,16 @@ class Image(ConfigurableFromFile):
         with open(self.path, "rb") as img:
             self._image_data = img.read()
 
-        print("\t{0} added to sprite".format(self.filename))
+        print "\t{0} added to sprite".format(self.filename)
 
     @cached_property
     def image(self):
         """Return a Pil representation of this image """
 
         if sys.version < '3':
-            imageio = io.StringIO(self._image_data)
+            imageio = StringIO.StringIO(self._image_data)
         else:
-            imageio = io.BytesIO(self._image_data)
+            imageio = StringIO.BytesIO(self._image_data)
 
         try:
             source_image = PILImage.open(imageio)
@@ -70,7 +70,7 @@ class Image(ConfigurableFromFile):
                 img.paste(source_image, (0, 0), mask=mask)
             else:
                 img.paste(source_image, (0, 0))
-        except IOError as e:
+        except IOError, e:
             raise PILUnavailableError(e.args[0].split()[1])
         finally:
             imageio.close()
@@ -119,7 +119,7 @@ class Image(ConfigurableFromFile):
         else:
             data = [0] * 4
 
-        return list(map(int, data))
+        return map(int, data)
 
     @cached_property
     def horizontal_spacing(self):
@@ -196,7 +196,7 @@ class Sprite(ConfigurableFromFile):
             if ratio_output_key not in self.config:
                 self.config[ratio_output_key] = img_format.output_path(ratio)
 
-        print("Processing '{0}':".format(self.name))
+        print "Processing '{0}':".format(self.name)
 
         # Generate sprite map
         self.process()
@@ -220,7 +220,7 @@ class Sprite(ConfigurableFromFile):
             hash_list.append(os.path.relpath(image.path))
             hash_list.append(image._image_data)
 
-        for key, value in self.config.items():
+        for key, value in self.config.iteritems():
             hash_list.append(key)
             hash_list.append(value)
 
--- glue-0.13.orig/glue/formats/base.py
+++ glue-0.13/glue/formats/base.py
@@ -54,7 +54,7 @@ class BaseFormat(object):
     @property
     def format_label(self):
         from glue.formats import formats
-        return dict((v,k) for k, v in formats.items())[self.__class__]
+        return dict((v,k) for k, v in formats.iteritems())[self.__class__]
 
     @classmethod
     def populate_argument_parser(cls, parser):
--- glue-0.13.orig/glue/formats/caat.py
+++ glue-0.13/glue/formats/caat.py
@@ -1,6 +1,6 @@
 import os
 
-from .base import BaseJSONFormat
+from base import BaseJSONFormat
 
 
 class CAATFormat(BaseJSONFormat):
--- glue-0.13.orig/glue/formats/cocos2d.py
+++ glue-0.13/glue/formats/cocos2d.py
@@ -1,6 +1,6 @@
 import os
 
-from .base import BasePlistFormat
+from base import BasePlistFormat
 
 
 class Cocos2dFormat(BasePlistFormat):
--- glue-0.13.orig/glue/formats/css.py
+++ glue-0.13/glue/formats/css.py
@@ -3,7 +3,7 @@ import os
 import codecs
 
 from glue import __version__
-from .base import JinjaTextFormat
+from base import JinjaTextFormat
 
 from ..exceptions import ValidationError
 
@@ -16,7 +16,7 @@ class CssFormat(JinjaTextFormat):
                               'first-letter', 'first-line', 'first-child',
                               'before', 'after'])
 
-    template = """
+    template = u"""
         /* glue: {{ version }} hash: {{ hash }} */
         {% for image in images %}.{{ image.label }}{{ image.pseudo }}{%- if not image.last %},{{"\n"}}{%- endif %}{%- endfor %} {
             background-image: url('{{ sprite_path }}');
@@ -54,20 +54,20 @@ class CssFormat(JinjaTextFormat):
 
         group.add_argument("--namespace",
                            dest="css_namespace",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_CSS_NAMESPACE', 'sprite'),
                            help="Namespace for all css classes (default: sprite)")
 
         group.add_argument("--sprite-namespace",
                            dest="css_sprite_namespace",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_CSS_SPRITE_NAMESPACE',
                                                   '{sprite_name}'),
                            help="Namespace for all sprites (default: {sprite_name})")
 
         group.add_argument("-u", "--url",
                            dest="css_url",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_CSS_URL', ''),
                            help="Prepend this string to the sprites path")
 
@@ -94,7 +94,7 @@ class CssFormat(JinjaTextFormat):
 
         group.add_argument("--separator",
                            dest="css_separator",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_CSS_SEPARATOR', '-'),
                            metavar='SEPARATOR',
                            help=("Customize the separator used to join CSS class "
@@ -103,7 +103,7 @@ class CssFormat(JinjaTextFormat):
 
         group.add_argument("--pseudo-class-separator",
                            dest="css_pseudo_class_separator",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_CSS_PSEUDO_CLASS_SEPARATOR', '__'),
                            metavar='SEPARATOR',
                            help=("Customize the separator glue will use in order "
@@ -163,7 +163,7 @@ class CssFormat(JinjaTextFormat):
         if self.sprite.config['css_url']:
             context['sprite_path'] = '{0}{1}'.format(self.sprite.config['css_url'], context['sprite_filename'])
 
-            for r, ratio in context['ratios'].items():
+            for r, ratio in context['ratios'].iteritems():
                 ratio['sprite_path'] = '{0}{1}'.format(self.sprite.config['css_url'], ratio['sprite_filename'])
 
         # Add cachebuster if required
@@ -174,7 +174,7 @@ class CssFormat(JinjaTextFormat):
 
             context['sprite_path'] = apply_cachebuster(context['sprite_path'])
 
-            for r, ratio in context['ratios'].items():
+            for r, ratio in context['ratios'].iteritems():
                 ratio['sprite_path'] = apply_cachebuster(ratio['sprite_path'])
 
         return context
@@ -213,6 +213,6 @@ class CssFormat(JinjaTextFormat):
             if pseudo_classes:
                 for p in pseudo_classes:
                     label = label.replace('{0}{1}'.format(css_pseudo_class_separator, p), "")
-                pseudo = ''.join([':{0}'.format(x) for x in pseudo_classes])
+                pseudo = ''.join(map(lambda x: ':{0}'.format(x), pseudo_classes))
 
         return label, pseudo
--- glue-0.13.orig/glue/formats/html.py
+++ glue-0.13/glue/formats/html.py
@@ -5,7 +5,7 @@ from .css import CssFormat
 class HtmlFormat(CssFormat):
 
     extension = 'html'
-    template = """
+    template = u"""
         <html>
             <head><title>Glue Sprite Test Html</title>
             <link rel="stylesheet" type="text/css" href="{{ css_path }}"></head>
--- glue-0.13.orig/glue/formats/img.py
+++ glue-0.13/glue/formats/img.py
@@ -19,7 +19,7 @@ class ImageFormat(BaseFormat):
 
         group.add_argument("--img",
                            dest="img_dir",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_IMG', True),
                            metavar='DIR',
                            help="Output directory for img files")
@@ -38,13 +38,13 @@ class ImageFormat(BaseFormat):
 
         group.add_argument("-p", "--padding",
                            dest="padding",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_PADDING', '0'),
                            help="Force this padding in all images")
 
         group.add_argument("--margin",
                            dest="margin",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_MARGIN', '0'),
                            help="Force this margin in all images")
 
@@ -57,7 +57,7 @@ class ImageFormat(BaseFormat):
 
         group.add_argument("--ratios",
                            dest="ratios",
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_RATIOS', '1'),
                            help="Create sprites based on these ratios")
 
--- glue-0.13.orig/glue/formats/jsonformat.py
+++ glue-0.13/glue/formats/jsonformat.py
@@ -6,7 +6,7 @@ try:
 except ImportError:
     from ordereddict import OrderedDict
 
-from .base import BaseJSONFormat
+from base import BaseJSONFormat
 
 
 class JSONFormat(BaseJSONFormat):
@@ -29,7 +29,7 @@ class JSONFormat(BaseJSONFormat):
         group.add_argument("--json-format",
                            dest="json_format",
                            metavar='NAME',
-                           type=str,
+                           type=unicode,
                            default=os.environ.get('GLUE_JSON_FORMAT', 'array'),
                            choices=['array', 'hash'],
                            help=("JSON structure format (array, hash)"))
@@ -60,7 +60,7 @@ class JSONFormat(BaseJSONFormat):
                                        'height': context['height']})
 
         if self.sprite.config['json_format'] == 'array':
-            data['frames'] = list(frames.values())
+            data['frames'] = frames.values()
         else:
             data['frames'] = frames
 
--- glue-0.13.orig/glue/formats/less.py
+++ glue-0.13/glue/formats/less.py
@@ -1,12 +1,12 @@
 import os
 
-from .css import CssFormat
+from css import CssFormat
 
 
 class LessFormat(CssFormat):
 
     extension = 'less'
-    template = """
+    template = u"""
         /* glue: {{ version }} hash: {{ hash }} */
         {% for image in images %}.{{ image.label }}{{ image.pseudo }}{%- if not image.last %}, {%- endif %}{%- endfor %}{
             background-image:url('{{ sprite_path }}');
--- glue-0.13.orig/glue/formats/scss.py
+++ glue-0.13/glue/formats/scss.py
@@ -1,6 +1,6 @@
 import os
 
-from .css import CssFormat
+from css import CssFormat
 
 
 class ScssFormat(CssFormat):
--- glue-0.13.orig/glue/helpers.py
+++ glue-0.13/glue/helpers.py
@@ -1,7 +1,7 @@
 import os
 import sys
 import contextlib
-from io import StringIO
+from StringIO import StringIO
 
 
 def round_up(value):
--- glue-0.13.orig/glue/managers/base.py
+++ glue-0.13/glue/managers/base.py
@@ -41,7 +41,7 @@ class BaseManager(object):
                 format = format_cls(sprite=sprite)
                 format.validate()
                 if format.needs_rebuild() or sprite.config['force']:
-                    print("Format '{0}' for sprite '{1}' needs rebuild...".format(format_name, sprite.name))
+                    print "Format '{0}' for sprite '{1}' needs rebuild...".format(format_name, sprite.name)
                     format.build()
                 else:
-                    print("Format '{0}'' for sprite '{1}' already exists...".format(format_name, sprite.name))
+                    print "Format '{0}'' for sprite '{1}' already exists...".format(format_name, sprite.name)
--- glue-0.13.orig/glue/managers/watch.py
+++ glue-0.13/glue/managers/watch.py
@@ -39,5 +39,5 @@ class WatchManager(object):
 
     def signal_handler(self, signal, frame):
         """ Gracefully close the app if Ctrl+C is pressed."""
-        print('You pressed Ctrl+C!')
+        print 'You pressed Ctrl+C!'
         sys.exit(0)
--- glue-0.13.orig/setup.py
+++ glue-0.13/setup.py
@@ -57,4 +57,5 @@ setup(
         ]
     },
     zip_safe = False,
+#    use_2to3=True
 )
