eve-bookmark-convert/eve-scanning.py

77 lines
1.6 KiB
Python
Raw Permalink Normal View History

2024-01-10 12:33:23 -05:00
import datetime
import pyperclip
def instructions():
2024-01-10 13:03:56 -05:00
helpText ='''
2024-01-10 12:33:23 -05:00
1. == To home wormhole
2. == Wormhole away from home
3. == Combat Site Data or Relic site.
4. == Anons of interest
L == Low Sec
H == High Sec
N == Null Sec
J == Jspace (wormholes)
2024-01-10 13:03:56 -05:00
'''
2024-01-10 12:33:23 -05:00
today = datetime.date.today()
2024-01-10 13:03:56 -05:00
helpText += "\t"
helpText += (today.strftime('%d-%b-%y'))
helpText += "\n"
return helpText
2024-01-10 12:33:23 -05:00
contents = []
line = ' '
splitContents = []
#grab input
while True:
try:
line = input()
if line == '':
break
else:
contents.append(line)
except EOFError:
break
#Split the lines by tab
for line in contents:
splitContents.append(line.split('\t'))
#put system name to frot of list
for line in range(len(splitContents)):
try:
splitContents[line].insert(0, splitContents[line].pop(3))
except:
break
#Alphabetize
splitContents.sort()
#print out
2024-01-10 12:51:35 -05:00
prettyPrint = ""
2024-01-10 12:33:23 -05:00
print ("```")
2024-01-10 12:51:35 -05:00
prettyPrint += "```\n"
2024-01-10 13:03:56 -05:00
print(instructions())
2024-01-10 12:51:35 -05:00
prettyPrint += instructions()
2024-01-10 12:33:23 -05:00
last = "nullnope"
for line in range(len(splitContents)):
try:
if last != splitContents[line][0]:
print(splitContents[line][0])
2024-01-10 12:51:35 -05:00
prettyPrint += str(splitContents[line][0])
prettyPrint += "\n"
2024-01-10 12:33:23 -05:00
last = splitContents[line][0]
2024-01-10 12:51:35 -05:00
print("\t", splitContents[line][1])
prettyPrint += "\t"
prettyPrint += str(splitContents[line][1])
prettyPrint += "\n"
2024-01-10 12:33:23 -05:00
except:
break
print ("```")
2024-01-10 12:51:35 -05:00
prettyPrint += ("```")
2024-01-10 13:03:56 -05:00
pyperclip.copy(prettyPrint)
print("printing pretty print", prettyPrint)