diff options
author | Matthew Gamble | 2016-03-19 14:39:07 +1100 |
---|---|---|
committer | Matthew Gamble | 2016-03-19 14:39:07 +1100 |
commit | 62c248325f5ef3e71f4a448860a8dfe8be870275 (patch) | |
tree | 4d641a06006a5519648e44b8c7c8ed265918bf53 | |
download | aur-62c248325f5ef3e71f4a448860a8dfe8be870275.tar.gz |
Initial commit of v1.0.7 of python usersettings package
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | python3-compat.patch | 51 |
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ccf5d9021d5f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = python-usersettings + pkgdesc = Python module for easily managing persistent settings using an editable format and stored in an OS-appropriate location. + pkgver = 1.0.7 + pkgrel = 1 + url = https://pypi.python.org/pypi/usersettings/1.0.7 + arch = any + license = BSD + makedepends = python-setuptools + depends = python + depends = python-appdirs + source = https://pypi.python.org/packages/source/u/usersettings/usersettings-1.0.7.tar.gz + sha256sums = c48c48f7bc1f00facc74da5ecfb6e1d95c66fc46d9e054c774958570f780d535 + +pkgname = python-usersettings + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..bab2b88dbc65 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,26 @@ +# Maintainer: Matthew Gamble + +pkgname=python-usersettings +pkgver=1.0.7 +pkgrel=1 +pkgdesc="Python module for easily managing persistent settings using an editable format and stored in an OS-appropriate location." +arch=('any') +url="https://pypi.python.org/pypi/usersettings/${pkgver}" +license=('BSD') +depends=('python' 'python-appdirs') +makedepends=('python-setuptools') +source=( + "https://pypi.python.org/packages/source/u/usersettings/usersettings-${pkgver}.tar.gz" +) +sha256sums=('c48c48f7bc1f00facc74da5ecfb6e1d95c66fc46d9e054c774958570f780d535') + +prepare() { + cd "usersettings-${pkgver}" + patch < ../../python3-compat.patch +} + +package() { + cd "usersettings-${pkgver}" + python setup.py install --root="${pkgdir}" + install -Dm644 docs/LICENSE.txt "${pkgdir}/usr/share/licenses/python-usersettings/LICENSE.txt" +} diff --git a/python3-compat.patch b/python3-compat.patch new file mode 100644 index 000000000000..dac8e9be665f --- /dev/null +++ b/python3-compat.patch @@ -0,0 +1,51 @@ +From c2bd739181bed34c8b6a916d5ee849568fd2301f Mon Sep 17 00:00:00 2001 +From: Matt Russell <mgrbyte@users.noreply.github.com> +Date: Sun, 27 Sep 2015 14:55:58 +0100 +Subject: [PATCH] Python3 compat + +--- + usersettings.py | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/usersettings.py b/usersettings.py +index bf46267..7b55c29 100644 +--- a/usersettings.py ++++ b/usersettings.py +@@ -2,9 +2,15 @@ + """ + Provide interface for persistent portable editable user settings + """ +-import os +-import ConfigParser + import ast ++import os ++import sys ++ ++PY3 = sys.version_info[0] == 3 ++if PY3: ++ import configparser ++else: ++ import ConfigParser as configparser + + import appdirs + +@@ -44,7 +50,7 @@ def load_settings(self): + super(Settings, self).__setitem__(key, value) + + # Load the stored values +- parser = ConfigParser.RawConfigParser() ++ parser = configparser.RawConfigParser() + try: + with open(self.settings_file, 'r') as settings_fp: + parser.readfp(settings_fp) +@@ -75,8 +81,8 @@ def load_settings(self): + def save_settings(self): + """ Write the settings data to disk """ + if not os.path.exists(self.settings_directory): +- os.makedirs(self.settings_directory, 0755) +- parser = ConfigParser.RawConfigParser() ++ os.makedirs(self.settings_directory, 0o755) ++ parser = configparser.RawConfigParser() + parser.add_section('settings') + for key, value in self.items(): + parser.set('settings', key, value) |