Skip to content

Commit 727466a

Browse files
committed
Removed verbosity from shuffle tools
1 parent cec44a9 commit 727466a

File tree

2 files changed

+3
-38
lines changed

2 files changed

+3
-38
lines changed

shuffle-tools/1.2.0/api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
app_version: 1.2.0
33
name: Shuffle Tools
4-
description: A tool app for Shuffle. Gives access to most missing features along with Liquid.
4+
description: A tool app for Shuffle. Gives access to most missing features along with Liquid.
55
tags:
66
- Testing
77
- Shuffle

shuffle-tools/1.2.0/src/app.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,6 @@ def filter_list(self, input_list, field, check, value, opposite):
684684
new_list.append(item)
685685
found = True
686686
break
687-
else:
688-
print("Nothing matching")
689687

690688
if not found:
691689
failed_list.append(item)
@@ -1533,7 +1531,7 @@ def fix_json(self, json_data):
15331531
del json_data[key]
15341532

15351533
except Exception as e:
1536-
print("[DEBUG] Problem in JSON (fix_json): %s" % e)
1534+
pass
15371535

15381536
return json_data
15391537

@@ -1587,8 +1585,6 @@ def compare_relative_date(
15871585
):
15881586
if timestamp== "None":
15891587
return False
1590-
1591-
print("Converting input date.")
15921588

15931589
if date_format == "autodetect":
15941590
input_dt = dateutil_parser(timestamp).replace(tzinfo=None)
@@ -1632,12 +1628,7 @@ def compare_relative_date(
16321628
comparison_dt = formatted_dt + delta
16331629
#comparison_dt = datetime.datetime.utcnow()
16341630

1635-
print("{} {} {} is {}. Delta: {}".format(offset, units, direction, comparison_dt, delta))
1636-
16371631
diff = int((input_dt - comparison_dt).total_seconds())
1638-
print(
1639-
"\nDifference between {} and {} is {} seconds ({} days)\n".format(timestamp, comparison_dt, diff, int(diff/86400))
1640-
)
16411632

16421633
if units == "seconds":
16431634
diff = diff
@@ -1675,19 +1666,6 @@ def compare_relative_date(
16751666
if direction == "ahead" and diff != 0:
16761667
result = not (result)
16771668

1678-
print(
1679-
"At {}, is {} {} to {} {} {}? {}. Diff {}".format(
1680-
formatted_dt,
1681-
timestamp,
1682-
equality_test,
1683-
offset,
1684-
units,
1685-
direction,
1686-
result,
1687-
diff,
1688-
)
1689-
)
1690-
16911669
parsed_string = "%s %s %s %s" % (equality_test, offset, units, direction)
16921670
newdiff = diff
16931671
if newdiff < 0:
@@ -1804,11 +1782,8 @@ def check_cache_contains(self, key, value, append):
18041782
except json.decoder.JSONDecodeError as e:
18051783
parsedvalue = [str(allvalues["value"])]
18061784
except Exception as e:
1807-
print("Error parsing JSON - overriding: %s" % e)
18081785
parsedvalue = [str(allvalues["value"])]
18091786

1810-
print("In ELSE2: '%s'" % parsedvalue)
1811-
18121787
try:
18131788
for item in parsedvalue:
18141789
#return "%s %s" % (item, value)
@@ -1835,7 +1810,6 @@ def check_cache_contains(self, key, value, append):
18351810
# Lol
18361811
break
18371812
except Exception as e:
1838-
print("Error in check_cache_contains: %s" % e)
18391813
parsedvalue = [str(parsedvalue)]
18401814
append = True
18411815

@@ -1888,7 +1862,6 @@ def check_cache_contains(self, key, value, append):
18881862
#return allvalues
18891863

18901864
except Exception as e:
1891-
print("[ERROR] Failed to handle cache contains: %s" % e)
18921865
return {
18931866
"success": False,
18941867
"key": key,
@@ -2197,7 +2170,6 @@ def get_jwt(sa_keyfile,
21972170
#signer = crypt.RSASigner.from_service_account_file(sa_keyfile)
21982171
signer = crypt.RSASigner.from_string(sa_keyfile)
21992172
jwt_token = jwt.encode(signer, payload)
2200-
# print(jwt_token.decode('utf-8'))
22012173
return jwt_token
22022174

22032175

@@ -2435,7 +2407,6 @@ def run_ssh_command(self, host, port, user_name, private_key_file_id, password,
24352407
except Exception as e:
24362408
return {"success":"false","message":str(e)}
24372409
else:
2438-
#print("AUTH WITH PASSWORD")
24392410
try:
24402411
ssh_client.connect(hostname=host,username=user_name,port=port, password=str(password))
24412412
except Exception as e:
@@ -2540,14 +2511,10 @@ def _format_result(self, result):
25402511
for i in val:
25412512
final_result[key].append(i)
25422513
elif isinstance(val, dict):
2543-
#print(key,":::",val)
25442514
if key in final_result:
25452515
if isinstance(val, dict):
25462516
for k,v in val.items():
2547-
#print("k:",k,"v:",v)
25482517
val[k].append(v)
2549-
#print(val)
2550-
#final_result[key].append([i for i in val if len(val) > 0])
25512518
else:
25522519
final_result[key] = val
25532520

@@ -2560,7 +2527,6 @@ def _with_concurency(self, array_of_strings, ioc_types):
25602527

25612528
# Workers dont matter..?
25622529
# What can we use instead?
2563-
print("Strings:", len(array_of_strings))
25642530

25652531
workers = 4
25662532
with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor:
@@ -2577,7 +2543,6 @@ def _with_concurency(self, array_of_strings, ioc_types):
25772543
# Retrieve the results if needed
25782544
results = [future.result() for future in futures]
25792545

2580-
#print("Total time taken:", time.perf_counter()-start)
25812546
return self._format_result(results)
25822547

25832548
# FIXME: Make this good and actually faster than normal
@@ -2646,7 +2611,7 @@ def parse_ioc_new(self, input_string, input_type="all"):
26462611
try:
26472612
newarray[i]["is_private_ip"] = ipaddress.ip_address(item["data"]).is_private
26482613
except Exception as e:
2649-
print("Error parsing %s: %s" % (item["data"], e))
2614+
pass
26502615

26512616
try:
26522617
newarray = json.dumps(newarray)

0 commit comments

Comments
 (0)