summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/debian')
-rw-r--r--debian/patches/debian/0001-google-analytics.patch18
-rw-r--r--debian/patches/debian/0002-html-output.patch20
-rw-r--r--debian/patches/debian/0003-python-shebang.patch30
-rw-r--r--debian/patches/debian/0004-quiet-stdout.patch21
4 files changed, 89 insertions, 0 deletions
diff --git a/debian/patches/debian/0001-google-analytics.patch b/debian/patches/debian/0001-google-analytics.patch
new file mode 100644
index 0000000..9efaacd
--- /dev/null
+++ b/debian/patches/debian/0001-google-analytics.patch
@@ -0,0 +1,18 @@
+Author: Carl Suster <carl@contraflo.ws>
+Description: Disable Google Analytics extension for building the documentation with Sphinx.
+
+diff -Naurp terminaltables.orig/docs/conf.py terminaltables/docs/conf.py
+--- terminaltables.orig/docs/conf.py
++++ terminaltables/docs/conf.py
+@@ -42,11 +42,6 @@ extensions.append('sphinx.ext.extlinks')
+ extlinks = {'github': ('https://github.com/robpol86/{0}/blob/v{1}/%s'.format(project, version), '')}
+
+
+-# google analytics
+-extensions.append('sphinxcontrib.googleanalytics')
+-googleanalytics_id = 'UA-82627369-1'
+-
+-
+ # SCVersioning.
+ scv_banner_greatest_tag = True
+ scv_grm_exclude = ('.gitignore', '.nojekyll', 'README.rst')
diff --git a/debian/patches/debian/0002-html-output.patch b/debian/patches/debian/0002-html-output.patch
new file mode 100644
index 0000000..e703d32
--- /dev/null
+++ b/debian/patches/debian/0002-html-output.patch
@@ -0,0 +1,20 @@
+Author: Carl Suster <carl@contraflo.ws>
+Description:
+ We would like for the HTML source files to be installed, and they are
+ needed for the search page. In theory this could be done by passing an
+ argument `-Dhtml_copy_source=1` in debian/rules, however this causes
+ HAS_SOURCE to be equal to 1 instead of True so dh_sphinxdoc fails with a
+ "doesn't look like a Sphinc search page" error.
+
+diff -Naurp terminaltables.orig/docs/conf.py terminaltables/docs/conf.py
+--- terminaltables.orig/docs/conf.py
++++ terminaltables/docs/conf.py
+@@ -27,7 +27,7 @@ html_context = dict(
+ github_version=os.environ.get('TRAVIS_BRANCH', 'master'),
+ source_suffix='.rst',
+ )
+-html_copy_source = False
++html_copy_source = True
+ html_favicon = 'favicon.ico'
+ html_theme = 'sphinx_rtd_theme'
+ html_title = project
diff --git a/debian/patches/debian/0003-python-shebang.patch b/debian/patches/debian/0003-python-shebang.patch
new file mode 100644
index 0000000..8805031
--- /dev/null
+++ b/debian/patches/debian/0003-python-shebang.patch
@@ -0,0 +1,30 @@
+Author: Carl Suster <carl@contraflo.ws>
+Description: Use python3 shebang on examples.
+
+diff -Naurp terminaltables.orig/example1.py terminaltables/example1.py
+--- terminaltables.orig/example1.py
++++ terminaltables/example1.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """Simple example usage of terminaltables without any other dependencies.
+
+ Just prints sample text and exits.
+diff -Naurp terminaltables.orig/example2.py terminaltables/example2.py
+--- terminaltables.orig/example2.py
++++ terminaltables/example2.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """Example usage of terminaltables with colorclass.
+
+ Just prints sample text and exits.
+diff -Naurp terminaltables.orig/example3.py terminaltables/example3.py
+--- terminaltables.orig/example3.py
++++ terminaltables/example3.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """Simple example usage of terminaltables and column_max_width().
+
+ Just prints sample text and exits.
diff --git a/debian/patches/debian/0004-quiet-stdout.patch b/debian/patches/debian/0004-quiet-stdout.patch
new file mode 100644
index 0000000..cf36463
--- /dev/null
+++ b/debian/patches/debian/0004-quiet-stdout.patch
@@ -0,0 +1,21 @@
+Author: Carl Suster <carl@contraflo.ws>
+Description: Avoid writing bytes to stdout
+ In Python 3, bytes should be written to the underlying buffer object
+ rather than directly to stdout. This was causing legitimate test
+ failures.
+
+diff -Naurp terminaltables.orig/terminaltables/terminal_io.py terminaltables/terminaltables/terminal_io.py
+--- terminaltables.orig/terminaltables/terminal_io.py
++++ terminaltables/terminaltables/terminal_io.py
+@@ -94,5 +94,10 @@ def set_terminal_title(title, kernel32=N
+ return kernel32.SetConsoleTitleW(title) != 0
+
+ # Linux/OSX.
+- sys.stdout.write(b'\033]0;' + title_bytes + b'\007')
++ set_title = b'\033]0;' + title_bytes + b'\007'
++ if hasattr(sys.stdout, 'buffer'):
++ sys.stdout.buffer.write(set_title)
++ else:
++ text = set_title.decode(sys.stdout.encoding, 'strict')
++ sys.stdout.write(text)
+ return True