aboutsummaryrefslogtreecommitdiff
path: root/textproc/py-ttp
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2021-01-03 20:16:40 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2021-01-03 20:16:40 +0000
commit443ce17a129bb7536d2d64310dd75440079f4feb (patch)
treeb00f2d3454f9ebdbac62613ce262c8a4241b7cfa /textproc/py-ttp
parent548b924c66c2fcb72ca34adab3c5b7cfef382188 (diff)
downloadports-443ce17a129bb7536d2d64310dd75440079f4feb.tar.gz
ports-443ce17a129bb7536d2d64310dd75440079f4feb.zip
Update to 0.6.0
- Add LICENSE_FILE Changes: https://github.com/dmulyalin/ttp/releases
Notes
Notes: svn path=/head/; revision=560145
Diffstat (limited to 'textproc/py-ttp')
-rw-r--r--textproc/py-ttp/Makefile3
-rw-r--r--textproc/py-ttp/distinfo6
-rw-r--r--textproc/py-ttp/files/patch-ttp-match-ip.py56
-rw-r--r--textproc/py-ttp/files/patch-ttp-returners-terminal_returner.py9
-rw-r--r--textproc/py-ttp/files/patch-ttp-utils-loaders.py49
5 files changed, 8 insertions, 115 deletions
diff --git a/textproc/py-ttp/Makefile b/textproc/py-ttp/Makefile
index 7ec0782d7e99..a6f76b846223 100644
--- a/textproc/py-ttp/Makefile
+++ b/textproc/py-ttp/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= ttp
-PORTVERSION= 0.5.0
+PORTVERSION= 0.6.0
CATEGORIES= textproc python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -11,6 +11,7 @@ MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Template Text Parser
LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
USES= dos2unix python:3.6+
USE_PYTHON= autoplist concurrent distutils
diff --git a/textproc/py-ttp/distinfo b/textproc/py-ttp/distinfo
index 246b9a1c1238..999b095182b2 100644
--- a/textproc/py-ttp/distinfo
+++ b/textproc/py-ttp/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1602780720
-SHA256 (ttp-0.5.0.tar.gz) = bc5fc277f052b1c5f18faf10f4a944a55e12b4730556d916ac43578476d2ae11
-SIZE (ttp-0.5.0.tar.gz) = 59510
+TIMESTAMP = 1609598925
+SHA256 (ttp-0.6.0.tar.gz) = 727308fa93d1a0fc60aa1474a22fd39df323a03379ab6c33ef451d8f9075c877
+SIZE (ttp-0.6.0.tar.gz) = 62581
diff --git a/textproc/py-ttp/files/patch-ttp-match-ip.py b/textproc/py-ttp/files/patch-ttp-match-ip.py
deleted file mode 100644
index 44304aebc6ea..000000000000
--- a/textproc/py-ttp/files/patch-ttp-match-ip.py
+++ /dev/null
@@ -1,56 +0,0 @@
---- ttp/match/ip.py.orig 2020-08-16 22:06:01 UTC
-+++ ttp/match/ip.py
-@@ -5,9 +5,9 @@ log = logging.getLogger(__name__)
-
- def to_ip(data, *args):
- # for py2 support need to convert data to unicode:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- ipaddr_data = unicode(data)
-- elif _ttp_["python_major_version"] is 3:
-+ elif _ttp_["python_major_version"] == 3:
- ipaddr_data = data
- if "ipv4" in args:
- if "/" in ipaddr_data or " " in ipaddr_data:
-@@ -33,9 +33,9 @@ def is_ip(data, *args):
-
- def to_net(data, *args):
- # for py2 support need to convert data to unicode:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- ipaddr_data = unicode(data)
-- elif _ttp_["python_major_version"] is 3:
-+ elif _ttp_["python_major_version"] == 3:
- ipaddr_data = data
- if "ipv4" in args:
- return ipaddress.IPv4Network(ipaddr_data), None
-@@ -124,21 +124,21 @@ def cidr_match(data, prefix):
- check = ip_obj.network.overlaps(ip_net)
- elif isinstance(ip_obj, ipaddress.IPv4Address) or isinstance(ip_obj, ipaddress.IPv6Address):
- # if object is ipaddress, need to convert it into ipinterface with /32 mask:
-- if ip_obj.version is 4:
-+ if ip_obj.version == 4:
- # for py2 support need to convert data to unicode:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- ipaddr_data = unicode("{}/32".format(str(ip_obj)))
-- elif _ttp_["python_major_version"] is 3:
-+ elif _ttp_["python_major_version"] == 3:
- ipaddr_data = "{}/32".format(str(ip_obj))
- ip_obj = ipaddress.IPv4Interface(ipaddr_data)
-- elif ip_obj.version is 6:
-+ elif ip_obj.version == 6:
- # for py2 support need to convert data to unicode:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- ipaddr_data = unicode("{}/128".format(str(ip_obj)))
-- elif _ttp_["python_major_version"] is 3:
-+ elif _ttp_["python_major_version"] == 3:
- ipaddr_data = "{}/128".format(str(ip_obj))
- ip_obj = ipaddress.IPv6Interface(ipaddr_data)
- check = ip_obj.network.overlaps(ip_net)
- else:
- check = None
-- return data, check
-\ No newline at end of file
-+ return data, check
diff --git a/textproc/py-ttp/files/patch-ttp-returners-terminal_returner.py b/textproc/py-ttp/files/patch-ttp-returners-terminal_returner.py
index f33776e60154..e84d1192ed78 100644
--- a/textproc/py-ttp/files/patch-ttp-returners-terminal_returner.py
+++ b/textproc/py-ttp/files/patch-ttp-returners-terminal_returner.py
@@ -1,6 +1,6 @@
---- ttp/returners/terminal_returner.py.orig 2020-09-03 21:58:49 UTC
+--- ttp/returners/terminal_returner.py.orig 2020-12-24 20:13:53 UTC
+++ ttp/returners/terminal_returner.py
-@@ -31,13 +31,13 @@ def terminal_returner(data, **kwargs):
+@@ -33,12 +33,12 @@ def terminal_returner(data, **kwargs):
for yeallow_word in yeallow_words:
data = data.replace(yeallow_word, fttr.format(Y, yeallow_word, N))
# print output
@@ -9,12 +9,9 @@
if isinstance(data, str) or isinstance(data, unicode):
print(data)
else:
- print(str(data).replace('\\n', '\n'))
+ print(str(data).replace("\\n", "\n"))
- elif _ttp_["python_major_version"] is 3:
+ elif _ttp_["python_major_version"] == 3:
if isinstance(data, str):
print(data)
else:
-- print(str(data).replace('\\n', '\n'))
-\ No newline at end of file
-+ print(str(data).replace('\\n', '\n'))
diff --git a/textproc/py-ttp/files/patch-ttp-utils-loaders.py b/textproc/py-ttp/files/patch-ttp-utils-loaders.py
deleted file mode 100644
index 750de2ebb732..000000000000
--- a/textproc/py-ttp/files/patch-ttp-utils-loaders.py
+++ /dev/null
@@ -1,49 +0,0 @@
---- ttp/utils/loaders.py.orig 2020-09-14 21:20:38 UTC
-+++ ttp/utils/loaders.py
-@@ -33,7 +33,7 @@ def load_files(path, extensions=[], filters=[], read=F
- if os.path.isfile(path[:5000]):
- if read:
- try:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- with open(path, 'r') as file_obj:
- return [('text_data', file_obj.read(),)]
- with open(path, 'r', encoding='utf-8') as file_obj:
-@@ -53,10 +53,10 @@ def load_files(path, extensions=[], filters=[], read=F
- if read:
- ret = []
- for f in files:
-- if _ttp_["python_major_version"] is 2:
-+ if _ttp_["python_major_version"] == 2:
- with open((path + f), 'r') as file_obj:
- ret.append(('text_data', file_obj.read(),))
-- elif _ttp_["python_major_version"] is 3:
-+ elif _ttp_["python_major_version"] == 3:
- with open((path + f), 'r', encoding='utf-8') as file_obj:
- ret.append(('text_data', file_obj.read(),))
- return ret
-@@ -111,7 +111,7 @@ def _get_include_data(text_data, include):
- return text_data
-
- def load_ini(text_data, include=None, **kwargs):
-- if _ttp_["python_major_version"] is 3:
-+ if _ttp_["python_major_version"] == 3:
- import configparser
- cfgparser = configparser.ConfigParser()
- # to make cfgparser keep the case, e.g. VlaN222 will not become vlan222:
-@@ -132,7 +132,7 @@ def load_ini(text_data, include=None, **kwargs):
- log.error("ttp_utils.load_struct: Python3, Unable to load ini formatted data\n'{}'".format(text_data))
- # convert configparser object into dictionary
- result = {k: dict(cfgparser.items(k)) for k in list(cfgparser.keys())}
-- elif _ttp_["python_major_version"] is 2:
-+ elif _ttp_["python_major_version"] == 2:
- import ConfigParser
- import StringIO
- cfgparser = ConfigParser.ConfigParser()
-@@ -217,4 +217,4 @@ def load_csv(text_data, include=None, **kwargs):
- continue
- temp = {headers[index]: i for index, i in enumerate(row)}
- data[temp.pop(key)] = temp
-- return data
-\ No newline at end of file
-+ return data