summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-27 18:52:09 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-27 18:58:50 +0200
commit6f091a8654ba2a6b40a9b8a7725eb78e4e284856 (patch)
tree9401f3fc8f9344e83edba56245a758ac2d5960fa
parent8864659127afd728d2ae3f10664f65bcda6f7417 (diff)
Use system-provided python*-iniparse
-rw-r--r--debian/clean1
-rw-r--r--debian/control6
-rw-r--r--debian/patches/python3.patch81
-rw-r--r--debian/patches/series2
-rw-r--r--debian/patches/system-iniparse.patch11
-rw-r--r--reconfigure/parsers/ini.py2
-rw-r--r--reconfigure/parsers/iniparse/config.py18
7 files changed, 26 insertions, 95 deletions
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..5e87f12
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1 @@
+reconfigure/parsers/iniparse/*
diff --git a/debian/control b/debian/control
index f391358..a32537b 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,7 @@ Build-Depends:
python-nose,
python3-nose,
python-iniparse,
- python-configparser,
+ python3-iniparse,
python-six,
python3-six,
debhelper (>= 9)
@@ -23,7 +23,7 @@ Homepage: http://eugeny.github.io/reconfigure
Package: python-reconfigure
Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-configparser
+Depends: ${misc:Depends}, ${python:Depends}, python-iniparse
Provides: ${python:Provides}
Description: simple config file management library (Python 2)
python-reconfigure provides easy and uniform access to various
@@ -74,7 +74,7 @@ Description: simple config file management library (documentation)
Package: python3-reconfigure
Architecture: all
-Depends: ${misc:Depends}, ${python3:Depends}
+Depends: ${misc:Depends}, ${python3:Depends}, python3-iniparse
Description: simple config file management library (Python 3)
python-reconfigure provides easy and uniform access to various
kinds of configuration files, easily extendable with custom
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
deleted file mode 100644
index 2ac23b6..0000000
--- a/debian/patches/python3.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Subject: Python3 compat
-From: Andrew Shadura <andrew@shadura.me>
-
-diff --git a/reconfigure/parsers/iniparse/config.py b/reconfigure/parsers/iniparse/config.py
-index d007f16..cc37ac4 100644
---- a/reconfigure/parsers/iniparse/config.py
-+++ b/reconfigure/parsers/iniparse/config.py
-@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
-
- >>> n.aaa = 42
- >>> del n.x
-- >>> print n
-+ >>> print(n)
- aaa = 42
- name.first = paramjit
- name.last = oberoi
-@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
-
- >>> isinstance(n.name, ConfigNamespace)
- True
-- >>> print n.name
-+ >>> print(n.name)
- first = paramjit
- last = oberoi
- >>> sorted(list(n.name))
-@@ -160,8 +160,8 @@ class BasicConfig(ConfigNamespace):
-
- Finally, values can be read from a file as follows:
-
-- >>> from StringIO import StringIO
-- >>> sio = StringIO('''
-+ >>> from io import StringIO
-+ >>> sio = StringIO(u'''
- ... # comment
- ... ui.height = 100
- ... ui.width = 150
-@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
- ... ''')
- >>> n = BasicConfig()
- >>> n._readfp(sio)
-- >>> print n
-+ >>> print(n)
- complexity = medium
- data.secret.password = goodness=gracious me
- have_python
-@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
-
- def __str__(self, prefix=''):
- lines = []
-- keys = self._data.keys()
-+ keys = list(self._data.keys())
- keys.sort()
- for name in keys:
- value = self._data[name]
-@@ -258,7 +258,7 @@ def update_config(target, source):
- >>> n.ui.display_clock = True
- >>> n.ui.display_qlength = True
- >>> n.ui.width = 150
-- >>> print n
-+ >>> print(n)
- playlist.expand_playlist = True
- ui.display_clock = True
- ui.display_qlength = True
-@@ -267,7 +267,7 @@ def update_config(target, source):
- >>> from iniparse import ini
- >>> i = ini.INIConfig()
- >>> update_config(i, n)
-- >>> print i
-+ >>> print(i)
- [playlist]
- expand_playlist = True
- <BLANKLINE>
-@@ -277,7 +277,7 @@ def update_config(target, source):
- width = 150
-
- """
-- for name in source:
-+ for name in sorted(source):
- value = source[name]
- if isinstance(value, ConfigNamespace):
- if name in target:
diff --git a/debian/patches/series b/debian/patches/series
index ad4a200..186cde1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
remove-external-images.diff
-python3.patch
+system-iniparse.patch
diff --git a/debian/patches/system-iniparse.patch b/debian/patches/system-iniparse.patch
new file mode 100644
index 0000000..eb2c391
--- /dev/null
+++ b/debian/patches/system-iniparse.patch
@@ -0,0 +1,11 @@
+--- a/reconfigure/parsers/ini.py
++++ b/reconfigure/parsers/ini.py
+@@ -2,7 +2,7 @@
+
+ from reconfigure.nodes import *
+ from reconfigure.parsers import BaseParser
+-from reconfigure.parsers.iniparse import INIConfig
++from iniparse import INIConfig
+
+ try:
+ from StringIO import StringIO
diff --git a/reconfigure/parsers/ini.py b/reconfigure/parsers/ini.py
index 2f95d33..fe91422 100644
--- a/reconfigure/parsers/ini.py
+++ b/reconfigure/parsers/ini.py
@@ -2,7 +2,7 @@ import six
from reconfigure.nodes import *
from reconfigure.parsers import BaseParser
-from reconfigure.parsers.iniparse import INIConfig
+from iniparse import INIConfig
try:
from StringIO import StringIO
diff --git a/reconfigure/parsers/iniparse/config.py b/reconfigure/parsers/iniparse/config.py
index cc37ac4..d007f16 100644
--- a/reconfigure/parsers/iniparse/config.py
+++ b/reconfigure/parsers/iniparse/config.py
@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
>>> n.aaa = 42
>>> del n.x
- >>> print(n)
+ >>> print n
aaa = 42
name.first = paramjit
name.last = oberoi
@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
>>> isinstance(n.name, ConfigNamespace)
True
- >>> print(n.name)
+ >>> print n.name
first = paramjit
last = oberoi
>>> sorted(list(n.name))
@@ -160,8 +160,8 @@ class BasicConfig(ConfigNamespace):
Finally, values can be read from a file as follows:
- >>> from io import StringIO
- >>> sio = StringIO(u'''
+ >>> from StringIO import StringIO
+ >>> sio = StringIO('''
... # comment
... ui.height = 100
... ui.width = 150
@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
... ''')
>>> n = BasicConfig()
>>> n._readfp(sio)
- >>> print(n)
+ >>> print n
complexity = medium
data.secret.password = goodness=gracious me
have_python
@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
def __str__(self, prefix=''):
lines = []
- keys = list(self._data.keys())
+ keys = self._data.keys()
keys.sort()
for name in keys:
value = self._data[name]
@@ -258,7 +258,7 @@ def update_config(target, source):
>>> n.ui.display_clock = True
>>> n.ui.display_qlength = True
>>> n.ui.width = 150
- >>> print(n)
+ >>> print n
playlist.expand_playlist = True
ui.display_clock = True
ui.display_qlength = True
@@ -267,7 +267,7 @@ def update_config(target, source):
>>> from iniparse import ini
>>> i = ini.INIConfig()
>>> update_config(i, n)
- >>> print(i)
+ >>> print i
[playlist]
expand_playlist = True
<BLANKLINE>
@@ -277,7 +277,7 @@ def update_config(target, source):
width = 150
"""
- for name in sorted(source):
+ for name in source:
value = source[name]
if isinstance(value, ConfigNamespace):
if name in target: