Skip to content

Commit

Permalink
v0.3.1 bug fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteRusssian committed Aug 2, 2018
1 parent 218bb2b commit 0260ef4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 18 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ PySpy connects to [CCP's ESI API](https://esi.evetech.net/ui/) and the

**Current Limitations**: To avoid undue strain on zKillboard's API, PySpy will run the *Kills*, *Losses*, *Last Wk*, *Solo*, *BLOPS* and *HICs* analyses only for the first 30 characters in the list.

## Ignore Certain Entities

PySpy allows you to specify a list of ignored characters, corporations and alliances. To add entities to that list, right click on a search result. You can remove entities from this list under _Options_->_Review Ignored Entities_

## Ignore all Members of your NPSI Fleet

For anyone using PySpy in no-purple-shoot-it (NPSI) fleets, you can tell PySpy to temporarily ignore your fleet mates by first running PySpy on all characters in your fleet chat and the selecting _Options_->_Set NPSI Ignore List_. Once the fleet is over, you can clear the list under _Options_->_Clear NPSI List_. Your custom ignore list described above will not be affected by this action.

## Installation

You can download the latest release for your operating system [here](https://github.com/WhiteRusssian/PySpy/releases/latest).
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.3
v0.3.1
55 changes: 53 additions & 2 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# cSpell Checker - Correct Words****************************************
# // cSpell:words wrusssian, wxpython, HRULES, VRULES, ELLIPSIZE, zkill,
# // cSpell:words blops, Unregister, russsian, chkversion, posix,
# // cSpell:words Gallente, Minmatar, Amarr, Caldari, ontop, hics
# // cSpell:words Gallente, Minmatar, Amarr, Caldari, ontop, hics, npsi
# **********************************************************************
Logger = logging.getLogger(__name__)
# Example call: Logger.info("Something badhappened", exc_info=True) ****
Expand Down Expand Up @@ -148,6 +148,22 @@ def __init__(self, *args, **kwds):
self.review_ignore
)

self.opt_menu.AppendSeparator()

self.ignore_all = self.opt_menu.Append(wx.ID_ANY, "&Set NPSI Ignore List\tCTRL+SHIFT+S")
self.opt_menu.Bind(
wx.EVT_MENU,
self._showNpsiDialog,
self.ignore_all
)

self.clear_ignore = self.opt_menu.Append(wx.ID_ANY, "&Clear NPSI Ignore List\tCTRL+SHIFT+C")
self.opt_menu.Bind(
wx.EVT_MENU,
self._clearNpsiList,
self.clear_ignore
)

self.menubar.Append(self.opt_menu, 'Options')

# Set the grid object
Expand Down Expand Up @@ -412,9 +428,12 @@ def updateList(self, outlist, duration=None):
# If updateList() gets called before outlist has been provided, do nothing
if outlist is None:
return
# Clean up grid
if self.grid.GetNumberRows() > 0:
self.grid.DeleteRows(numRows=self.grid.GetNumberRows())
self.grid.AppendRows(len(outlist))
# Add any NPSI fleet related characters to ignored_list
npsi_list = self.options.Get("NPSIList", default=[])
ignored_list = self.options.Get("ignoredList", default=[])
hl_blops = self.options.Get("HlBlops", True)
ignore_count = 0
Expand All @@ -425,6 +444,9 @@ def updateList(self, outlist, duration=None):
for rec in ignored_list:
if r[0] == rec[0] or r[3] == rec[0] or r[5] == rec[0]:
ignore = True
for rec in npsi_list:
if r[0] == rec[0]:
ignore = True
if ignore:
self.grid.HideRow(rowidx)
ignore_count += 1
Expand Down Expand Up @@ -713,6 +735,34 @@ def _openIgnoreDialog(self, evt=None):
return
ignoredialog.showIgnoreDialog(self)

def _showNpsiDialog(self, evt=None):
dialog = wx.MessageBox(
"Do you want to ignore all currently shown characters? " +
"You can undo this under `Options > Clear NPSI Ignore List`.",
"NPSI Ignore List",
wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION
)
if dialog == 2: # Yes
npsi_list = []
outlist = self.options.Get("outlist", None)
if outlist is None:
return
for r in outlist:
character_id = [r[0]] # Needs to be list to append to ignored_list
npsi_list.append(character_id)
self.options.Set("NPSIList", npsi_list)
self.updateList(outlist)

def _clearNpsiList(self, evt=None):
dialog = wx.MessageBox(
"Would you like to clear the current NPSI fleet ignore list?",
"NPSI Ignore List",
wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION
)
if dialog == 2: # Yes
self.options.Set("NPSIList", [])
self.updateList(self.options.Get("outlist", None))

def _restoreColWidth(self):
'''
Restores column width either to default or value stored from
Expand Down Expand Up @@ -769,8 +819,9 @@ def OnClose(self, event=None):
self.options.Set("HlNone", self.ignore_none.IsChecked())
self.options.Set("StayOnTop", self.stay_ontop.IsChecked())
self.options.Set("DarkMode", self.dark_mode.IsChecked())
# Delete last outlist
# Delete last outlist and NPSIList
self.options.Set("outlist", None)
self.options.Set("NPSIList", [])
# Write pickle container to disk
self.options.Save()
event.Skip() if event else False
Expand Down
15 changes: 0 additions & 15 deletions sortarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ def __init__(self, prim_col, sort_array):
super(SortArrayError, self).__init__(msg)


class NothingToSortError(SortArrayError):
'''
Gets raised when there are less than two sortable objects.
'''
def __init__(self):
msg = (
"The unsorted input array does not contain sufficient sortable values."
)
super(SortArrayError, self).__init__(msg)


def _determineApproach(array, sort_col):
'''
Takes an array (list of lists/tuples) and determines whether values
Expand Down Expand Up @@ -92,10 +81,6 @@ def _determineApproach(array, sort_col):
else:
sort_as_str = False

# If there is nothing to sort, raise error.
if (is_num + is_str + is_none) < 2:
raise NothingToSortError

return sort_as_str


Expand Down

0 comments on commit 0260ef4

Please sign in to comment.