Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip useless information from gas/relic/data sites #244

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions evewspace/Map/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,29 @@ def update(self):
self.updated = True
self.save()

null_races = ["Angel", "Sansha", "Gurista", "Blood Raider"]


def abbreviate_info(self):
if self.sigtype and self.info:
type = self.sigtype.shortname
info = self.info

if type == "GAS":
self.info = info.split(' ', 1)[0]
elif (type == "DATA") or (type == "RELIC"):
new_info = ""
for race in self.null_races:
if race in info:
new_info += "NULL " + race
if ("Covert Research" in info):
new_info += " Covert Research"
self.info = new_info
return
if info.count(' ') >= 2:
self.info = info.split(' ', 3)[2]


def update_from_tsv(self, user, wascreated, row, map_system):
"""Takes a line of copied data, converts it into a signature and checks if the
import updated an existing signature on the map, and whether or not the update
Expand Down Expand Up @@ -832,11 +855,14 @@ def update_from_tsv(self, user, wascreated, row, map_system):
# if there is a signature info (site name) field, mark as scanned
if self.info != info:
self.info = info
if self.sigtype:
self.abbreviate_info()
if action != "Created":
action = "Updated"
if scan_group == "Cosmic Signature":
# only record new scanning activity for signatures
action = "Scanned"

if action != "None":
self.log_sig(user, action, map_system)

Expand Down