diff options
author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2022-03-25 13:32:08 +0000 |
---|---|---|
committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2022-03-25 13:38:06 +0000 |
commit | ec801b0f310772ffcc00434d23a9f1147aa86e4d (patch) | |
tree | fffabafc792b9a0b8334fdecd57937e331e76d3d /deskutils/py-pystash | |
parent | b117f7f8f7723515ea1f847cd66293719ce324bf (diff) | |
download | ports-ec801b0f310772ffcc00434d23a9f1147aa86e4d.tar.gz ports-ec801b0f310772ffcc00434d23a9f1147aa86e4d.zip |
deskutils/py-pystash: Fix build with setuptools 58.0.0+
With hat: python
Diffstat (limited to 'deskutils/py-pystash')
-rw-r--r-- | deskutils/py-pystash/files/patch-2to3 | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/deskutils/py-pystash/files/patch-2to3 b/deskutils/py-pystash/files/patch-2to3 new file mode 100644 index 000000000000..5accd5cd1def --- /dev/null +++ b/deskutils/py-pystash/files/patch-2to3 @@ -0,0 +1,50 @@ +--- pystash/common.py.orig 2014-05-17 19:30:11 UTC ++++ pystash/common.py +@@ -79,12 +79,11 @@ class StashedItem(): + return '\n'.join(items) + + +-class AbstractStorage(object): ++class AbstractStorage(object, metaclass=abc.ABCMeta): + # todo: update methods signature + """ + Here will be a docstring + """ +- __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def get_connection(self, db): +@@ -140,7 +139,7 @@ class ShelveStorage(AbstractStorage): + self.DBFILE = db_file if db_file is not None else self.DBFILE + path_to_dir = os.path.join('/', *self.DBFILE.split('/')[1:-1]) + if not os.path.exists(path_to_dir): +- os.makedirs(path_to_dir, 0755) ++ os.makedirs(path_to_dir, 0o755) + self.connection = self.get_connection(self.DBFILE) + if not 'storage' in self.connection: + self.connection['storage'] = {} +@@ -224,13 +223,13 @@ class ShelveStorage(AbstractStorage): + + def get_all(self): + result = {} +- for k, v in self.db.iteritems(): ++ for k, v in self.db.items(): + result[k] = StashedItem(v) + return result + + def tags(self, tag): + result = {} +- for k, v in self.db.iteritems(): ++ for k, v in self.db.items(): + if 'tags' in v: + if tag in v['tags']: + result[k] = StashedItem(v) +@@ -238,7 +237,7 @@ class ShelveStorage(AbstractStorage): + + def alltags(self): + result = [] +- for k, v in self.db.iteritems(): ++ for k, v in self.db.items(): + if 'tags' in v: + for tag in v['tags']: + result.append(tag) |