Compare commits

...

21 Commits

Author SHA1 Message Date
DarkPhoenix
9cf20942f1 Change validator requirement for owner ID
This fixes bug related to sqlalch 1.0
2015-05-01 20:15:08 +03:00
DarkPhoenix
dbb98e981a Merge branch 'wx3' of github.com:DarkFenX/Pyfa into wx3 2015-05-01 19:03:04 +03:00
DarkPhoenix
3ae39b2e7c Remove unused import 2015-05-01 19:02:13 +03:00
DarkPhoenix
7b43b516c9 Add effect i should've added for mosaic release 2015-05-01 18:50:11 +03:00
DarkPhoenix
12d6a2c5de Bundle runtime libs with windows executable 2015-05-01 16:37:13 +03:00
DarkPhoenix
26bba49193 Work around bug in wxpython
Button is specified as property in wx docs, but it returns bound method instead of actually being a property
2015-05-01 16:00:26 +03:00
DarkPhoenix
4e69a2656c Add some options for Mac binary generation
Can't test it atm, but whatever
2015-05-01 15:37:09 +03:00
DarkPhoenix
68d504c79d Force writing errors/output to file in case of frozen distributive 2015-05-01 15:08:14 +03:00
DarkPhoenix
2180b1ac3b Add folder with assets used for distributives 2015-05-01 14:50:09 +03:00
DarkPhoenix
32712a8798 Fetch app version from config file 2015-05-01 14:20:01 +03:00
DarkPhoenix
73c7ad55b6 Add comment which shows how to use script 2015-05-01 14:00:31 +03:00
DarkPhoenix
a34c5ace5c Change setup file to make sure msi installer can be built 2015-05-01 13:54:40 +03:00
DarkPhoenix
fd77661f41 Tune setup file a bit more 2015-05-01 04:02:10 +03:00
DarkPhoenix
ad07cf25d8 Settle on just Tkinter in excludes 2015-05-01 03:23:57 +03:00
DarkPhoenix
4daf1b1ba3 Merge branch 'wx3' of github.com:DarkFenX/Pyfa into wx3 2015-05-01 01:28:18 +03:00
DarkPhoenix
4b189ab146 Remove obsolete readme 2015-05-01 01:27:54 +03:00
DarkPhoenix
64a69e3910 Remove tcl/tk from distributive 2015-05-01 01:27:07 +03:00
DarkPhoenix
9482404ca7 Remove setting locale
Who knows what it may cause, i'm not an wx expert, but wx3 bundled with xc_freeze keeps bitching about it...
2015-05-01 00:04:35 +03:00
DarkPhoenix
124d4fab9b Change the way we fetch conversions from package to make it compatible with frozen and packed builds 2015-04-30 23:59:56 +03:00
DarkPhoenix
722406f636 Change the way we detect root
This is needed for executable freeze to work correctly
2015-04-30 23:08:42 +03:00
DarkPhoenix
6d4957b148 Add setup.py for building binary distributives with wx3 2015-04-30 22:24:27 +03:00
11 changed files with 120 additions and 44 deletions

View File

@@ -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

Binary file not shown.

BIN
dist_assets/win/pyfa.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -0,0 +1,7 @@
# entosisLink
#
# Used by:
# Modules from group: Entosis Link (2 of 2)
type = "active"
def handler(fit, module, context):
pass

View File

@@ -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

View File

@@ -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

View File

@@ -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):

View File

@@ -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

View File

@@ -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
View 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)]
)

View File

@@ -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.