Skip to content

Commit 17eba77

Browse files
Jan-PaulJan-Paul
authored andcommitted
v0.1 commit
1 parent 9820718 commit 17eba77

22 files changed

+1039
-0
lines changed

LICENSE.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
MIT License
2+
3+
Copyright (c) 2018 - White Russsian (https://github.com/WhiteRusssian)
4+
5+
All rights reserved.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!--- // cSpell:words killboard, blops, hics, killboard's, cynos, ccp's, pyspy, psf's, pyperclip, pyinstaller, executables, jojo, unported --->
2+
3+
# PySpy - A simple EVE Online character intel tool using CCP's ESI API
4+
5+
## Background
6+
7+
PySpy was born out of frustration over the *death* of [Pirate's Little Helper](http://eve-plh.com/#/home),
8+
a great [EVE Online](https://www.eveonline.com/) third-party tool for gathering useful information on character names from the in-game *local chat* window.
9+
10+
PySpy connects to [CCP's ESI API](https://esi.evetech.net/ui/) and the
11+
[zKillboard API](https://github.com/zKillboard/zKillboard/wiki) and is available on Windows and macOS.
12+
13+
## How to use PySpy
14+
15+
1. Open PySpy.
16+
2. In your EVE client, select a list of characters and copy them to the clipboard (`CTRL+C` on Windows *or* `⌘+C` on macOS).
17+
3. Wait until PySpy is done and inspect the results.
18+
4. Double-click a name to open the respective zKillboard in your browser.
19+
20+
**Note**: PySpy will save its window location, size, column sizes and transparency (slider on bottom right) settings automatically and restore them the next time you launch it. PySpy will stay on top of the EVE client so long as the game runs in *window mode*.
21+
22+
## Information Provided by PySpy
23+
24+
<p align="center">
25+
<img alt="PySpy in action" src="https://github.com/WhiteRusssian/PySpy/blob/master/assets/v0.1_screenshot.png?raw=true">
26+
</p>
27+
28+
* **Character**: Character name.
29+
* **Corporation**: Corporation of character.
30+
* **Alliance**: Alliance of Character's Corporation, if any.
31+
* **K**: Total number of kills.
32+
* **B**: Number of Black Ops Battleships (BLOPS) killed.
33+
* **H**: Number of lost Heavy Interdiction Cruisers (HIC).
34+
35+
**Note**: Characters that have killed BLOPS or have lost HICs are high-lighted *orange*.
36+
37+
**Current Limitations**: To avoid undue strain on zKillboard's API, PySpy will run the *K-B-H* analysis only for the first 20 characters in the list.
38+
39+
## Installation
40+
41+
You can download the latest release for your operating system [here](https://github.com/WhiteRusssian/PySpy/tree/master/download).
42+
43+
PySpy comes as a single-file executable both in Windows and macOS. On both platforms, you can run PySpy from any folder location you like.
44+
45+
**Note**: PySpy automatically checks for updates on launch.
46+
47+
## Uninstalling PySpy
48+
49+
Delete the PySpy executable and remove the following files manually:
50+
51+
* **Windows**: PySpy saves preference and log files in a folder called `PySpy` located at `%LocalAppData%`.
52+
* **macOS**: PySpy creates `pyspy.log` under `~/Library/Logs` and `pyspy.cfg` under `~/Library/Preferences`.
53+
54+
## Future Features
55+
56+
Below is a non-exhaustive list of additional features I plan to add to PySpy as and when the ESI and zKillboard APIs support them:
57+
58+
* **Standings**: Only show characters that are non-blue, i.e. neutral or hostile.
59+
* **Cynos**: Indicate if a character has in the past lost ships fitted with regular or covert cynos.
60+
* **Improved GUI**: The current GUI is very basic and while it works, I do appreciate that it is not ideal for people who cannot use it on a second screen but actually have to overlay it on-top of their EVE client.
61+
62+
## Bug Reporting
63+
64+
Despite PySpy's simplicity and extensive testing, you may encounter the odd bug. If so, please check if an existing [issue](https://github.com/WhiteRusssian/PySpy/issues) already describes your bug. If not, feel free to [create a new issue](https://github.com/WhiteRusssian/PySpy/issues/new?template=bug_report.md) for your bug.
65+
66+
## Dependencies & Acknowledgements
67+
68+
* PySpy is written in [Python 3](https://www.python.org/) (v3.6.5), licensed under [PSF's License Agreement](https://docs.python.org/3/license.html#psf-license-agreement-for-python-release).
69+
* For API connectivity, PySpy relies on [Requests](http://docs.python-requests.org/) (v2.19.1), licensed under the [Apache License, Version 2.0](http://docs.python-requests.org/en/master/user/intro/#requests-license).
70+
* Clipboard monitoring is implemented with the help of [pyperclip](https://github.com/asweigart/pyperclip) (v1.6.2), licensed under the [3-Clause BSD License](https://github.com/asweigart/pyperclip/blob/master/LICENSE.txt).
71+
* The GUI is powered by [wxPython](https://www.wxpython.org/) (v4.0.3), licensed under the [wxWindows Library Licence](https://wxpython.org/pages/license/index.html).
72+
* The Windows and macOS executables are built using [pyinstaller](https://www.pyinstaller.org/), licensed under [its own modified GPL license](https://raw.githubusercontent.com/pyinstaller/pyinstaller/develop/COPYING.txt).
73+
* PySpy's icon was created by Jojo Mendoza and is licensed under [Creative Commons (Attribution-Noncommercial 3.0 Unported)](https://creativecommons.org/licenses/by-nc/3.0/). It is available on https://www.iconfinder.com/icons/1218719/cyber_hat_spy_undercover_user_icon.
74+
75+
## License
76+
77+
PySpy is licensed under the [MIT](LICENSE.txt) License.
78+
79+
## CCP Copyright Notice
80+
81+
EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf. CCP is in no way responsible for the content on or functioning of this website, nor can it be liable for any damage arising from the use of this website.

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1

__main__.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# !/usr/local/bin/python3.6
2+
# MIT licensed
3+
# Copyright (c) 2018 White Russsian
4+
# Github: <https://github.com/WhiteRusssian/PySpy>**********************
5+
''' This is the primary module responsible for launching a background
6+
thread that watches for changes in the clipboard and if it detects a
7+
list of strings that could be EVE Online character strings, sends them
8+
to the analyze.py module to gather specific information from CCP's ESI
9+
API and zKIllboard's API. This information then gets sent to the GUI for
10+
output.
11+
'''
12+
# **********************************************************************
13+
import logging
14+
import re
15+
import threading
16+
import time
17+
18+
import wx
19+
import pyperclip
20+
21+
import analyze
22+
import chkversion
23+
import config
24+
import gui
25+
import statusmsg
26+
# cSpell Checker - Correct Words****************************************
27+
# // cSpell:words russsian, ccp's, pyperclip, chkversion, clpbd, gui
28+
# **********************************************************************
29+
Logger = logging.getLogger(__name__)
30+
# Example call: Logger.info("Something badhappened", exc_info=True) ****
31+
32+
33+
def watch_clpbd():
34+
recent_value = None
35+
while True:
36+
clipboard = pyperclip.paste()
37+
if clipboard != recent_value:
38+
char_names = clipboard.splitlines()
39+
for name in char_names:
40+
valid = check_name_validity(name)
41+
if valid is False:
42+
break
43+
if valid:
44+
statusmsg.push_status("Clipboard change detected...")
45+
recent_value = clipboard
46+
analyze_chars(clipboard.splitlines())
47+
time.sleep(0.5) # Short sleep between loops to reduce CPU load
48+
49+
50+
def check_name_validity(char_name):
51+
if len(char_name) < 3:
52+
return False
53+
regex = r"[^ 'a-zA-Z0-9-]" # Valid EVE Online character names
54+
if re.search(regex, char_name):
55+
return False
56+
return True
57+
58+
59+
def analyze_chars(char_names):
60+
start_time = time.time()
61+
wx.CallAfter(app.PySpy.list.DeleteAllItems)
62+
try:
63+
outlist = analyze.main(char_names)
64+
if outlist is not None:
65+
wx.CallAfter(app.PySpy.update_list, outlist, start_time)
66+
else:
67+
statusmsg.push_status(
68+
"No valid character names found. Please try again..."
69+
)
70+
except Exception:
71+
Logger.error(
72+
"Failed to collect character information. Clipboard "
73+
"content was: " + str(char_names), exc_info=True
74+
)
75+
76+
77+
app = gui.App(0) # Has to be defined before background thread starts.
78+
79+
background_thread = threading.Thread(
80+
target=watch_clpbd,
81+
daemon=True
82+
)
83+
background_thread.start()
84+
85+
update_checker = threading.Thread(
86+
target=chkversion.chk_github_update,
87+
daemon=True
88+
)
89+
update_checker.start()
90+
91+
app.MainLoop()

__main__.spec

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# -*- mode: python -*-
2+
'''Cross-platform (MacOSX and Windows 10) Spec file for pyinstaller.
3+
Be sure to not use python 3.7 until pyinstaller supports it.'''
4+
# cSpell Checker - Correct Words****************************************
5+
# // cSpell:words pyinstaller, pyspy, posix, icns, getcwd, datas,
6+
# // cSpell:words tkinter, noconsole
7+
# **********************************************************************
8+
import os
9+
10+
if os.name == "nt":
11+
ICON_FILE = os.path.join("assets", "pyspy.ico")
12+
elif os.name == "posix":
13+
ICON_FILE = os.path.join("assets", "pyspy.png")
14+
15+
MAC_ICON = os.path.join("assets", "pyspy.icns")
16+
ABOUT_ICON = os.path.join("assets", "pyspy_mid.png")
17+
18+
block_cipher = None
19+
20+
a = Analysis(
21+
["__main__.py"],
22+
pathex=[os.getcwd()],
23+
binaries=[],
24+
datas=[
25+
(ICON_FILE, ""),
26+
(ABOUT_ICON, ""),
27+
("VERSION", ""),
28+
("LICENSE.txt", ""),
29+
],
30+
hiddenimports=[],
31+
hookspath=[],
32+
runtime_hooks=[],
33+
excludes=["Tkinter"],
34+
win_no_prefer_redirects=False,
35+
win_private_assemblies=False,
36+
cipher=block_cipher
37+
)
38+
39+
pyz = PYZ(
40+
a.pure,
41+
a.zipped_data,
42+
cipher=block_cipher
43+
)
44+
45+
exe = EXE(
46+
pyz,
47+
a.scripts,
48+
a.binaries,
49+
a.zipfiles,
50+
a.datas,
51+
name="PySpy",
52+
icon=ICON_FILE,
53+
debug=False,
54+
strip=False,
55+
upx=True,
56+
runtime_tmpdir=None,
57+
console=False,
58+
noconsole=True,
59+
onefile=True,
60+
windowed=True
61+
)
62+
63+
app = BUNDLE(
64+
exe,
65+
name="PySpy.app",
66+
icon=MAC_ICON,
67+
bundle_identifier=None
68+
)

aboutdialog.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# !/usr/local/bin/python3.6
2+
# MIT licensed
3+
# Copyright (c) 2018 White Russsian
4+
# Github: <https://github.com/WhiteRusssian/PySpy>**********************
5+
'''The About Dialog for PySpy's GUI. OnAboutBox() gets called by the GUI
6+
module.'''
7+
# **********************************************************************
8+
import logging
9+
import time
10+
11+
import wx
12+
import wx.adv
13+
14+
import __main__
15+
import config
16+
# cSpell Checker - Correct Words****************************************
17+
# // cSpell:words russsian, wxpython, ccp's
18+
# // cSpell:words
19+
# **********************************************************************
20+
Logger = logging.getLogger(__name__)
21+
# Example call: Logger.info("Something badhappened", exc_info=True) ****
22+
23+
24+
def OnAboutBox(e):
25+
# __main__.app.PySpy.ToggleWindowStyle(wx.STAY_ON_TOP)
26+
27+
description = """
28+
PySpy is a a simple EVE Online character intel tool
29+
using CCP's ESI API.
30+
31+
If you enjoy PySpy and want to show your appreciation
32+
to its author, you are welcome to send an ISK donation
33+
in-game to White Russsian (with 3 "s").
34+
35+
Thank you."""
36+
37+
try:
38+
with open(config.resource_path('LICENSE.txt'), 'r') as lic_file:
39+
license = lic_file.read()
40+
except:
41+
license = "PySpy is licensed under the MIT License."
42+
43+
info = wx.adv.AboutDialogInfo()
44+
45+
info.SetIcon(wx.Icon(config.ABOUT_ICON, wx.BITMAP_TYPE_PNG))
46+
info.SetName('PySpy')
47+
info.SetVersion(config.CURRENT_VER)
48+
info.SetDescription(description)
49+
info.SetCopyright('(C) 2018 White Russsian')
50+
info.SetWebSite('https://github.com/WhiteRusssian/PySpy')
51+
info.SetLicence(license)
52+
53+
wx.adv.AboutBox(info)
54+
55+
# __main__.app.PySpy.SetWindowStyle(wx.STAY_ON_TOP)

0 commit comments

Comments
 (0)