Compare commits
21 Commits
v1.13.1
...
preview_wx
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cf20942f1 | ||
|
|
dbb98e981a | ||
|
|
3ae39b2e7c | ||
|
|
7b43b516c9 | ||
|
|
12d6a2c5de | ||
|
|
26bba49193 | ||
|
|
4e69a2656c | ||
|
|
68d504c79d | ||
|
|
2180b1ac3b | ||
|
|
32712a8798 | ||
|
|
73c7ad55b6 | ||
|
|
a34c5ace5c | ||
|
|
fd77661f41 | ||
|
|
ad07cf25d8 | ||
|
|
4daf1b1ba3 | ||
|
|
4b189ab146 | ||
|
|
64a69e3910 | ||
|
|
9482404ca7 | ||
|
|
124d4fab9b | ||
|
|
722406f636 | ||
|
|
6d4957b148 |
25
config.py
25
config.py
@@ -29,10 +29,20 @@ staticPath = None
|
||||
saveDB = None
|
||||
gameDB = None
|
||||
|
||||
# TODO: move back to pyfa.py main loop
|
||||
# We moved it here just to avoid rebuilding windows skeleton for now (any change to pyfa.py needs it)
|
||||
import logging
|
||||
logging.basicConfig()
|
||||
|
||||
def isFrozen():
|
||||
if hasattr(sys, 'frozen'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def getPyfaRoot():
|
||||
base = sys.executable if isFrozen() else sys.argv[0]
|
||||
root = os.path.dirname(os.path.realpath(os.path.abspath(base)))
|
||||
root = unicode(root, sys.getfilesystemencoding())
|
||||
return root
|
||||
|
||||
|
||||
def defPaths():
|
||||
global pyfaPath
|
||||
@@ -45,8 +55,7 @@ def defPaths():
|
||||
# Python 2.X uses ANSI by default, so we need to convert the character encoding
|
||||
pyfaPath = getattr(configforced, "pyfaPath", pyfaPath)
|
||||
if pyfaPath is None:
|
||||
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
|
||||
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())
|
||||
pyfaPath = getPyfaRoot()
|
||||
|
||||
# Where we store the saved fits etc, default is the current users home directory
|
||||
if saveInRoot is True:
|
||||
@@ -61,6 +70,8 @@ def defPaths():
|
||||
|
||||
# Redirect stderr to file if we're requested to do so
|
||||
stderrToFile = getattr(configforced, "stderrToFile", None)
|
||||
if stderrToFile is None:
|
||||
stderrToFile = True if isFrozen() else False
|
||||
if stderrToFile is True:
|
||||
if not os.path.exists(savePath):
|
||||
os.mkdir(savePath)
|
||||
@@ -68,6 +79,8 @@ def defPaths():
|
||||
|
||||
# Same for stdout
|
||||
stdoutToFile = getattr(configforced, "stdoutToFile", None)
|
||||
if stdoutToFile is None:
|
||||
stdoutToFile = True if isFrozen() else False
|
||||
if stdoutToFile is True:
|
||||
if not os.path.exists(savePath):
|
||||
os.mkdir(savePath)
|
||||
|
||||
BIN
dist_assets/mac/pyfa.icns
Normal file
BIN
dist_assets/mac/pyfa.icns
Normal file
Binary file not shown.
BIN
dist_assets/win/pyfa.ico
Normal file
BIN
dist_assets/win/pyfa.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
7
eos/effects/entosislink.py
Normal file
7
eos/effects/entosislink.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# entosisLink
|
||||
#
|
||||
# Used by:
|
||||
# Modules from group: Entosis Link (2 of 2)
|
||||
type = "active"
|
||||
def handler(fit, module, context):
|
||||
pass
|
||||
@@ -192,7 +192,7 @@ class Character(object):
|
||||
map = {"ID": lambda val: isinstance(val, int),
|
||||
"name" : lambda val: True,
|
||||
"apiKey" : lambda val: val is None or (isinstance(val, basestring) and len(val) > 0),
|
||||
"ownerID" : lambda val: isinstance(val, int)}
|
||||
"ownerID" : lambda val: isinstance(val, int) or val is None}
|
||||
|
||||
if map[key](val) == False: raise ValueError(str(val) + " is not a valid value for " + key)
|
||||
else: return val
|
||||
|
||||
@@ -521,7 +521,7 @@ class FittingView(d.Display):
|
||||
sFit = service.Fit.getInstance()
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
ctrl = wx.GetMouseState().CmdDown() or wx.GetMouseState().MiddleDown()
|
||||
click = "ctrl" if ctrl is True else "right" if event.Button == 3 else "left"
|
||||
click = "ctrl" if ctrl is True else "right" if event.GetButton() == 3 else "left"
|
||||
sFit.toggleModulesState(fitID, self.mods[self.GetItemData(row)], mods, click)
|
||||
|
||||
# update state tooltip
|
||||
|
||||
@@ -57,8 +57,6 @@ from gui.builtinViews import *
|
||||
|
||||
from time import gmtime, strftime
|
||||
|
||||
import locale
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
#dummy panel(no paint no erasebk)
|
||||
class PFPanel(wx.Panel):
|
||||
|
||||
8
pyfa.py
8
pyfa.py
@@ -33,7 +33,7 @@ if not hasattr(sys, 'frozen'):
|
||||
except ImportError:
|
||||
print("Cannot find wxPython\nYou can download wxPython (2.8+) from http://www.wxpython.org/")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# if user wants to force 2.8, try that and go directly to ensureMinimal path if fails
|
||||
try:
|
||||
if getattr(config.configforced, "force28", False):
|
||||
@@ -51,7 +51,7 @@ if not hasattr(sys, 'frozen'):
|
||||
print "Installed wxPython version doesn't meet requirements.\nYou can download wxPython (2.8+) from http://www.wxpython.org/"
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "wxPython 2.8 not found; attempting to use newer version, expect errors"
|
||||
print "wxPython 2.8 not found; attempting to use newer version, expect errors"
|
||||
|
||||
try:
|
||||
import sqlalchemy
|
||||
@@ -87,6 +87,10 @@ if __name__ == "__main__":
|
||||
config.saveInRoot = True
|
||||
config.defPaths()
|
||||
|
||||
# Basic logging initialization
|
||||
import logging
|
||||
logging.basicConfig()
|
||||
|
||||
# Import everything
|
||||
import wx
|
||||
import os
|
||||
|
||||
@@ -7,7 +7,7 @@ item's name. The name of the file is usually arbitrary unless it's used in logic
|
||||
elsewhere (in which case can be accessed with packs[name])
|
||||
"""
|
||||
|
||||
import os
|
||||
import pkgutil
|
||||
|
||||
# init parent dict
|
||||
all = {}
|
||||
@@ -15,10 +15,10 @@ all = {}
|
||||
# init container to store the separate conversion packs in case we need them
|
||||
packs = {}
|
||||
|
||||
for filename in os.listdir(os.path.dirname(__file__)):
|
||||
basename, extension = filename.rsplit('.', 1)
|
||||
|
||||
if extension == "py" and basename not in ("__init__",):
|
||||
conversionPack = __import__("%s.%s"%(__name__, basename), fromlist=True)
|
||||
all.update(conversionPack.CONVERSIONS)
|
||||
packs[basename] = conversionPack.CONVERSIONS
|
||||
prefix = __name__ + "."
|
||||
for importer, modname, ispkg in pkgutil.iter_modules(__path__, prefix):
|
||||
conversionPack = __import__(modname, fromlist="dummy")
|
||||
all.update(conversionPack.CONVERSIONS)
|
||||
modname_tail = modname.rsplit('.', 1)[-1]
|
||||
packs[modname_tail] = conversionPack.CONVERSIONS
|
||||
|
||||
79
setup.py
Normal file
79
setup.py
Normal file
@@ -0,0 +1,79 @@
|
||||
"""
|
||||
Distribution builder for pyfa.
|
||||
|
||||
Windows executable: python setup.py build
|
||||
Windows executable + installer: python setup.py bdist_msi
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from cx_Freeze import setup, Executable
|
||||
|
||||
import config
|
||||
|
||||
|
||||
app_name = 'pyfa'
|
||||
app_version = '{}'.format(config.version)
|
||||
app_description = 'Python fitting assistant'
|
||||
|
||||
|
||||
packages = ['eos', 'gui', 'service', 'utils']
|
||||
include_files = ['icons', 'staticdata', 'gpl.txt']
|
||||
includes = []
|
||||
excludes = ['Tkinter']
|
||||
|
||||
|
||||
# Windows-specific options
|
||||
build_options_winexe = {
|
||||
'packages': packages,
|
||||
'include_files': include_files,
|
||||
'includes': includes,
|
||||
'excludes': excludes,
|
||||
'compressed': True,
|
||||
'optimize': 2,
|
||||
'include_msvcr': True,
|
||||
}
|
||||
|
||||
build_options_winmsi = {
|
||||
'upgrade_code': '{E80885AC-31BA-4D9A-A04F-9E5915608A6C}',
|
||||
'add_to_path': False,
|
||||
'initial_target_dir': r'[ProgramFilesFolder]\{}'.format(app_name),
|
||||
}
|
||||
|
||||
|
||||
# Mac-specific options (untested)
|
||||
build_options_macapp = {
|
||||
'iconfile': 'dist_assets/mac/pyfa.icns',
|
||||
'bundle_name': app_name,
|
||||
}
|
||||
|
||||
build_options_macdmg = {
|
||||
'volume_label': app_name,
|
||||
'applications-shortcut': True,
|
||||
}
|
||||
|
||||
|
||||
# Generic executable options
|
||||
executable_options = {
|
||||
'script': 'pyfa.py',
|
||||
# Following are windows-specific options, they are stored
|
||||
# on a per-executable basis
|
||||
'base': 'Win32GUI' if sys.platform=='win32' else None,
|
||||
'icon': 'dist_assets/win/pyfa.ico',
|
||||
'shortcutDir': 'DesktopFolder',
|
||||
'shortcutName': app_name,
|
||||
}
|
||||
|
||||
|
||||
setup(
|
||||
name=app_name,
|
||||
version=app_version,
|
||||
description=app_description,
|
||||
options = {
|
||||
'build_exe': build_options_winexe,
|
||||
'bdist_msi': build_options_winmsi,
|
||||
'bdist_mac': build_options_macapp,
|
||||
'bdist_dmg': build_options_macdmg,
|
||||
},
|
||||
executables=[Executable(**executable_options)]
|
||||
)
|
||||
@@ -1,25 +0,0 @@
|
||||
Generating a new sqlite dump HOWTO
|
||||
|
||||
You'll need pyfa itself (git://dev.evefit.org/pyfa.git)
|
||||
as well as phobos (git://dev.evefit.org/phobos.git)
|
||||
|
||||
Phobos can dump the whole of the eve cache to json, after installing it (=python setup.py install) just do python dumpToJson.py -e /path/to/eve -c /path/to/eve/cache -s serverName -o /output/folder
|
||||
|
||||
Arguments explained: -e and -c should be pretty self explanitory, they're the path to the eve install and the eve cache respectivly
|
||||
|
||||
-s is the serverName, its used to figure out which subfolder in the machonet folder we're intrested in. (possible values: tranquility, singularity, duality).
|
||||
This is passed directly to reverence which keeps a serverName to IP address mapping. You could probably add more servers with their IPs in the reverence sourcecode (cache.py file, around like 150 in the CacheMgr class) if you need another one.
|
||||
|
||||
-o is the output folder to dump all json files to, it should already exist or you'll get errors.
|
||||
|
||||
|
||||
|
||||
After thats done, you'll have all json files you need, and you can use a script within pyfa to generate a dump from that.
|
||||
|
||||
After you checked out pyfa, don't forget to update submodules (git submodule update --init).
|
||||
|
||||
and then browse to eos/utils/scripts/jsonToSql.py, which can generate the sqlite dump pyfa needs.
|
||||
|
||||
python jsonToSql.py -d eve.db -j /output/folder
|
||||
|
||||
Once thats done, you should have a nice little sqlite database, you can replace the one in the staticdata folder with yours and it should run right away.
|
||||
Reference in New Issue
Block a user