mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-18 19:49:40 +00:00
Update to 0.6.0
- Add LICENSE_FILE Changes: https://github.com/dmulyalin/ttp/releases
This commit is contained in:
parent
548b924c66
commit
443ce17a12
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=560145
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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'))
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user