py2to3 automatic conversion. Woot!
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
import cStringIO
|
||||
import io
|
||||
import os.path
|
||||
import zipfile
|
||||
|
||||
@@ -32,7 +32,7 @@ logging = Logger(__name__)
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except ImportError:
|
||||
from utils.compat import OrderedDict
|
||||
from .utils.compat import OrderedDict
|
||||
|
||||
|
||||
class BitmapLoader(object):
|
||||
@@ -88,14 +88,14 @@ class BitmapLoader(object):
|
||||
|
||||
try:
|
||||
img_data = cls.archive.read(path)
|
||||
sbuf = cStringIO.StringIO(img_data)
|
||||
sbuf = io.StringIO(img_data)
|
||||
return wx.ImageFromStream(sbuf)
|
||||
except KeyError:
|
||||
print("Missing icon file from zip: {0}".format(path))
|
||||
print(("Missing icon file from zip: {0}".format(path)))
|
||||
else:
|
||||
path = os.path.join(config.pyfaPath, 'imgs' + os.sep + location + os.sep + filename)
|
||||
|
||||
if os.path.exists(path):
|
||||
return wx.Image(path)
|
||||
else:
|
||||
print("Missing icon file: {0}".format(path))
|
||||
print(("Missing icon file: {0}".format(path)))
|
||||
|
||||
@@ -46,7 +46,7 @@ class AmountChanger(wx.Dialog):
|
||||
bSizer1.Add(self.input, 1, wx.ALL, 5)
|
||||
self.input.Bind(wx.EVT_CHAR, self.onChar)
|
||||
self.input.Bind(wx.EVT_TEXT_ENTER, self.change)
|
||||
self.button = wx.Button(self, wx.ID_OK, u"Done")
|
||||
self.button = wx.Button(self, wx.ID_OK, "Done")
|
||||
bSizer1.Add(self.button, 0, wx.ALL, 5)
|
||||
|
||||
self.SetSizer(bSizer1)
|
||||
|
||||
@@ -49,7 +49,7 @@ class ChangeAffectingSkills(ContextMenu):
|
||||
if cont[attrName] == 0:
|
||||
continue
|
||||
|
||||
for fit, afflictors in cont.getAfflictions(attrName).iteritems():
|
||||
for fit, afflictors in cont.getAfflictions(attrName).items():
|
||||
for afflictor, modifier, amount, used in afflictors:
|
||||
# only add Skills
|
||||
if not isinstance(afflictor, Skill):
|
||||
@@ -89,7 +89,7 @@ class ChangeAffectingSkills(ContextMenu):
|
||||
if bitmap is not None:
|
||||
skillItem.SetBitmap(bitmap)
|
||||
|
||||
for i in xrange(-1, 6):
|
||||
for i in range(-1, 6):
|
||||
levelItem = self.addSkill(rootMenu if msw else grandSub, skill, i)
|
||||
grandSub.AppendItem(levelItem)
|
||||
if (not skill.learned and i == -1) or (skill.learned and skill.level == i):
|
||||
|
||||
@@ -46,7 +46,7 @@ class CommandFits(ContextMenu):
|
||||
return "Command Fits"
|
||||
|
||||
def addFit(self, menu, fit, includeShip=False):
|
||||
label = fit.name if not includeShip else u"({}) {}".format(fit.ship.item.name, fit.name)
|
||||
label = fit.name if not includeShip else "({}) {}".format(fit.ship.item.name, fit.name)
|
||||
id = ContextMenu.nextID()
|
||||
self.fitMenuItemIds[id] = fit
|
||||
menuItem = wx.MenuItem(menu, id, label)
|
||||
@@ -62,7 +62,7 @@ class CommandFits(ContextMenu):
|
||||
|
||||
if len(self.__class__.commandFits) < 15:
|
||||
for fit in sorted(self.__class__.commandFits, key=lambda x: x.name):
|
||||
print fit
|
||||
print(fit)
|
||||
menuItem = self.addFit(rootMenu if msw else sub, fit, True)
|
||||
sub.AppendItem(menuItem)
|
||||
else:
|
||||
|
||||
@@ -52,7 +52,7 @@ class DamagePattern(ContextMenu):
|
||||
self.singles.append(pattern)
|
||||
|
||||
# return list of names, with singles first followed by submenu names
|
||||
self.m = map(lambda p: p.name, self.singles) + self.subMenus.keys()
|
||||
self.m = [p.name for p in self.singles] + list(self.subMenus.keys())
|
||||
return self.m
|
||||
|
||||
def addPattern(self, rootMenu, pattern):
|
||||
|
||||
@@ -45,7 +45,7 @@ class DroneSpinner(wx.Dialog):
|
||||
|
||||
bSizer1.Add(self.spinner, 1, wx.ALL, 5)
|
||||
|
||||
self.button = wx.Button(self, wx.ID_OK, u"Split")
|
||||
self.button = wx.Button(self, wx.ID_OK, "Split")
|
||||
bSizer1.Add(self.button, 0, wx.ALL, 5)
|
||||
|
||||
self.SetSizer(bSizer1)
|
||||
|
||||
@@ -89,7 +89,7 @@ class MetaSwap(ContextMenu):
|
||||
|
||||
# Sort items by metalevel, and group within that metalevel
|
||||
items = list(self.variations)
|
||||
print context
|
||||
print(context)
|
||||
if "implantItem" in context:
|
||||
# sort implants based on name
|
||||
items.sort(key=lambda x: x.name)
|
||||
@@ -112,7 +112,7 @@ class MetaSwap(ContextMenu):
|
||||
if thisgroup != group and context not in ("implantItem", "boosterItem"):
|
||||
group = thisgroup
|
||||
id = ContextMenu.nextID()
|
||||
m.Append(id, u'─ %s ─' % group)
|
||||
m.Append(id, '─ %s ─' % group)
|
||||
m.Enable(id, False)
|
||||
|
||||
id = ContextMenu.nextID()
|
||||
|
||||
@@ -50,7 +50,7 @@ class ModuleAmmoPicker(ContextMenu):
|
||||
return False
|
||||
|
||||
self.modules = modules
|
||||
self.charges = list(filter(lambda charge: Market.getInstance().getPublicityByItem(charge), validCharges))
|
||||
self.charges = list([charge for charge in validCharges if Market.getInstance().getPublicityByItem(charge)])
|
||||
return len(self.charges) > 0
|
||||
|
||||
def getText(self, itmContext, selection):
|
||||
@@ -108,7 +108,7 @@ class ModuleAmmoPicker(ContextMenu):
|
||||
|
||||
def nameSorter(self, charge):
|
||||
parts = charge.name.split(" ")
|
||||
return map(self.numericConverter, parts)
|
||||
return list(map(self.numericConverter, parts))
|
||||
|
||||
def addCharge(self, menu, charge):
|
||||
id_ = ContextMenu.nextID()
|
||||
@@ -127,7 +127,7 @@ class ModuleAmmoPicker(ContextMenu):
|
||||
@staticmethod
|
||||
def addSeperator(m, text):
|
||||
id_ = ContextMenu.nextID()
|
||||
m.Append(id_, u'─ %s ─' % text)
|
||||
m.Append(id_, '─ %s ─' % text)
|
||||
m.Enable(id_, False)
|
||||
|
||||
def getSubMenu(self, context, selection, rootMenu, i, pitem):
|
||||
|
||||
@@ -43,7 +43,7 @@ class TabbedFits(ContextMenu):
|
||||
continue
|
||||
fit = sFit.getFit(page.activeFitID, basic=True)
|
||||
id = ContextMenu.nextID()
|
||||
mitem = wx.MenuItem(rootMenu, id, u"{}: {}".format(fit.ship.item.name, fit.name))
|
||||
mitem = wx.MenuItem(rootMenu, id, "{}: {}".format(fit.ship.item.name, fit.name))
|
||||
bindmenu.Bind(wx.EVT_MENU, self.handleSelection, mitem)
|
||||
self.fitLookup[id] = fit
|
||||
m.AppendItem(mitem)
|
||||
|
||||
@@ -95,7 +95,7 @@ class TargetResists(ContextMenu):
|
||||
sub.AppendItem(self.addPattern(rootMenu if msw else sub, pattern))
|
||||
|
||||
# Items that have a parent
|
||||
for menuName, patterns in self.subMenus.items():
|
||||
for menuName, patterns in list(self.subMenus.items()):
|
||||
# Create parent item for root menu that is simply name of parent
|
||||
item = wx.MenuItem(rootMenu, ContextMenu.nextID(), menuName)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class FitDpsGraph(Graph):
|
||||
def getIcons(self):
|
||||
icons = {}
|
||||
sAttr = Attribute.getInstance()
|
||||
for key, attrName in self.propertyAttributeMap.iteritems():
|
||||
for key, attrName in self.propertyAttributeMap.items():
|
||||
iconFile = sAttr.getAttributeInfo(attrName).icon.iconFile
|
||||
bitmap = BitmapLoader.getBitmap(iconFile, "icons")
|
||||
if bitmap:
|
||||
@@ -69,7 +69,7 @@ class FitDpsGraph(Graph):
|
||||
|
||||
fitDps.clearData()
|
||||
variable = None
|
||||
for fieldName, value in fields.iteritems():
|
||||
for fieldName, value in fields.items():
|
||||
d = Data(fieldName, value)
|
||||
if not d.isConstant():
|
||||
if variable is None:
|
||||
|
||||
@@ -205,7 +205,7 @@ class ItemView(Display):
|
||||
mktgrpid = sMkt.getMarketGroupByItem(item).ID
|
||||
except AttributeError:
|
||||
mktgrpid = None
|
||||
print("unable to find market group for", item.name)
|
||||
print(("unable to find market group for", item.name))
|
||||
parentname = sMkt.getParentItemByItem(item).name
|
||||
# Get position of market group
|
||||
metagrpid = sMkt.getMetaGroupIdByItem(item)
|
||||
@@ -266,7 +266,7 @@ class ItemView(Display):
|
||||
"""
|
||||
revmap = {}
|
||||
i = 0
|
||||
for mgids in self.sMkt.META_MAP.itervalues():
|
||||
for mgids in self.sMkt.META_MAP.values():
|
||||
for mgid in mgids:
|
||||
revmap[mgid] = i
|
||||
i += 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from pfSearchBox import PFSearchBox
|
||||
from .pfSearchBox import PFSearchBox
|
||||
|
||||
|
||||
class SearchBox(PFSearchBox):
|
||||
|
||||
@@ -50,7 +50,7 @@ class DummyView(PreferenceView):
|
||||
|
||||
def initHeader(self, panel):
|
||||
headerSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, u"Dummy", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, "Dummy", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(14, 70, 90, 90, False, wx.EmptyString))
|
||||
headerSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
@@ -60,10 +60,10 @@ class DummyView(PreferenceView):
|
||||
def initContent(self, panel):
|
||||
contentSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.m_checkBox2 = wx.CheckBox(panel, wx.ID_ANY, u"Check Me!", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_checkBox2 = wx.CheckBox(panel, wx.ID_ANY, "Check Me!", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
contentSizer.Add(self.m_checkBox2, 0, wx.ALL, 5)
|
||||
|
||||
self.m_radioBtn2 = wx.RadioButton(panel, wx.ID_ANY, u"RadioBtn", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_radioBtn2 = wx.RadioButton(panel, wx.ID_ANY, "RadioBtn", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
contentSizer.Add(self.m_radioBtn2, 0, wx.ALL, 5)
|
||||
|
||||
self.m_slider2 = wx.Slider(panel, wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL)
|
||||
@@ -82,12 +82,12 @@ class DummyView(PreferenceView):
|
||||
|
||||
footerSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
|
||||
|
||||
self.btnRestore = wx.Button(panel, wx.ID_ANY, u"Restore", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnRestore = wx.Button(panel, wx.ID_ANY, "Restore", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnRestore.Enable(False)
|
||||
|
||||
footerSizer.Add(self.btnRestore, 0, wx.ALL, 5)
|
||||
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, u"Apply", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, "Apply", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
footerSizer.Add(self.btnApply, 0, wx.ALL, 5)
|
||||
return footerSizer
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class PFContextMenuPref(PreferenceView):
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY,
|
||||
u"Disabling context menus can improve responsiveness.",
|
||||
"Disabling context menus can improve responsiveness.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 5)
|
||||
|
||||
@@ -36,7 +36,7 @@ class PFCrestPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.stInfo = wx.StaticText(panel, wx.ID_ANY,
|
||||
u"Please see the pyfa wiki on GitHub for information regarding these options.",
|
||||
"Please see the pyfa wiki on GitHub for information regarding these options.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stInfo.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
@@ -60,7 +60,7 @@ class PFCrestPref(PreferenceView):
|
||||
|
||||
timeoutSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stTimout = wx.StaticText(panel, wx.ID_ANY, u"Timeout (seconds):", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTimout = wx.StaticText(panel, wx.ID_ANY, "Timeout (seconds):", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTimout.Wrap(-1)
|
||||
|
||||
timeoutSizer.Add(self.stTimout, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -84,7 +84,7 @@ class PFCrestPref(PreferenceView):
|
||||
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
|
||||
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.stSetID = wx.StaticText(panel, wx.ID_ANY, u"Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetID.Wrap(-1)
|
||||
fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -93,7 +93,7 @@ class PFCrestPref(PreferenceView):
|
||||
|
||||
fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, u"Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetSecret.Wrap(-1)
|
||||
|
||||
fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -103,7 +103,7 @@ class PFCrestPref(PreferenceView):
|
||||
|
||||
fgAddrSizer.Add(self.inputClientSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, u"Save Client Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, "Save Client Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnApply.Bind(wx.EVT_BUTTON, self.OnBtnApply)
|
||||
|
||||
mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
@@ -24,7 +24,7 @@ class PFGeneralPref(PreferenceView):
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
@@ -33,11 +33,11 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
# Save in Root
|
||||
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, u"Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, "Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbsaveInRoot, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
# Database path
|
||||
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, u"pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, "pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetUserPath.Wrap(-1)
|
||||
mainSizer.Add(self.stSetUserPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
self.inputUserPath = wx.TextCtrl(panel, wx.ID_ANY, config.savePath, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -46,7 +46,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputUserPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
# Save DB
|
||||
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, u"Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, "Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stFitDB.Wrap(-1)
|
||||
mainSizer.Add(self.stFitDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -56,7 +56,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputFitDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
# Game Data DB
|
||||
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, u"Game Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, "Game Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stGameDB.Wrap(-1)
|
||||
mainSizer.Add(self.stGameDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -78,13 +78,13 @@ class PFGeneralPref(PreferenceView):
|
||||
btnSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
|
||||
|
||||
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, u"Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, "Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL, 5)
|
||||
|
||||
self.btnDeleteTargetResists = wx.Button(panel, wx.ID_ANY, u"Delete All Target Resist Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDeleteTargetResists = wx.Button(panel, wx.ID_ANY, "Delete All Target Resist Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnDeleteTargetResists, 0, wx.ALL, 5)
|
||||
|
||||
self.btnPrices = wx.Button(panel, wx.ID_ANY, u"Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnPrices = wx.Button(panel, wx.ID_ANY, "Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnPrices, 0, wx.ALL, 5)
|
||||
|
||||
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
|
||||
@@ -97,17 +97,17 @@ class PFGeneralPref(PreferenceView):
|
||||
panel.Layout()
|
||||
|
||||
def DeleteDamagePatterns(self, event):
|
||||
question = u"This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?"
|
||||
question = "This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
clearDamagePatterns()
|
||||
|
||||
def DeleteTargetResists(self, event):
|
||||
question = u"This is a destructive action that will delete all target resist profiles.\nAre you sure you want to do this?"
|
||||
question = "This is a destructive action that will delete all target resist profiles.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
clearTargetResists()
|
||||
|
||||
def DeletePrices(self, event):
|
||||
question = u"This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?"
|
||||
question = "This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
clearPrices()
|
||||
|
||||
|
||||
@@ -36,25 +36,25 @@ class PFFittingEnginePref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, u"Factor in reload time when calculating capacitor usage, damage, and tank.",
|
||||
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, "Factor in reload time when calculating capacitor usage, damage, and tank.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
|
||||
mainSizer.Add(self.cbGlobalForceReload, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbStrictSkillLevels = wx.CheckBox(panel, wx.ID_ANY,
|
||||
u"Enforce strict skill level requirements",
|
||||
"Enforce strict skill level requirements",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbStrictSkillLevels.SetCursor(helpCursor)
|
||||
self.cbStrictSkillLevels.SetToolTip(wx.ToolTip(
|
||||
u'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
|
||||
u'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
|
||||
u'Drone Operation skill, as that requires Drones V'))
|
||||
'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
|
||||
'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
|
||||
'Drone Operation skill, as that requires Drones V'))
|
||||
|
||||
mainSizer.Add(self.cbStrictSkillLevels, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbUniversalAdaptiveArmorHardener = wx.CheckBox(panel, wx.ID_ANY,
|
||||
u"When damage profile is Uniform, set Reactive Armor " +
|
||||
u"Hardener to match (old behavior).",
|
||||
"When damage profile is Uniform, set Reactive Armor " +
|
||||
"Hardener to match (old behavior).",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbUniversalAdaptiveArmorHardener, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class PFGaugePref(PreferenceView):
|
||||
|
||||
gSizer1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.st0100 = wx.StaticText(panel, wx.ID_ANY, u"0 - 100", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT)
|
||||
self.st0100 = wx.StaticText(panel, wx.ID_ANY, "0 - 100", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT)
|
||||
self.st0100.Wrap(-1)
|
||||
gSizer1.Add(self.st0100, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -185,7 +185,7 @@ class PFGaugePref(PreferenceView):
|
||||
|
||||
gSizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.st100101 = wx.StaticText(panel, wx.ID_ANY, u"100 - 101", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.st100101 = wx.StaticText(panel, wx.ID_ANY, "100 - 101", wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.ALIGN_RIGHT)
|
||||
self.st100101.Wrap(-1)
|
||||
gSizer2.Add(self.st100101, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -211,7 +211,7 @@ class PFGaugePref(PreferenceView):
|
||||
|
||||
gSizer3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.st101103 = wx.StaticText(panel, wx.ID_ANY, u"101 - 103", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.st101103 = wx.StaticText(panel, wx.ID_ANY, "101 - 103", wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.ALIGN_RIGHT)
|
||||
self.st101103.Wrap(-1)
|
||||
gSizer3.Add(self.st101103, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -237,7 +237,7 @@ class PFGaugePref(PreferenceView):
|
||||
|
||||
gSizer4 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.st103105 = wx.StaticText(panel, wx.ID_ANY, u"103 - 105", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.st103105 = wx.StaticText(panel, wx.ID_ANY, "103 - 105", wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.ALIGN_RIGHT)
|
||||
self.st103105.Wrap(-1)
|
||||
gSizer4.Add(self.st103105, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -284,20 +284,20 @@ class PFGaugePref(PreferenceView):
|
||||
|
||||
buttonsSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.cbLink = wx.CheckBox(panel, wx.ID_ANY, u"Link Colors", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbLink = wx.CheckBox(panel, wx.ID_ANY, "Link Colors", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
buttonsSizer.Add(self.cbLink, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.LEFT, 5)
|
||||
|
||||
self.sliderGradientStart = wx.Slider(panel, wx.ID_ANY, self.gradientStart, -100, 100, wx.DefaultPosition,
|
||||
(127, -1), wx.SL_HORIZONTAL | wx.SL_LABELS)
|
||||
buttonsSizer.Add(self.sliderGradientStart, 1, wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.btnRestore = wx.Button(panel, wx.ID_ANY, u"Restore Defaults", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnRestore = wx.Button(panel, wx.ID_ANY, "Restore Defaults", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
buttonsSizer.Add(self.btnRestore, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.btnDump = wx.Button(panel, wx.ID_ANY, u"Dump Colors", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDump = wx.Button(panel, wx.ID_ANY, "Dump Colors", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
buttonsSizer.Add(self.btnDump, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.btnOk = wx.Button(panel, wx.ID_ANY, u"Apply", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnOk = wx.Button(panel, wx.ID_ANY, "Apply", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
buttonsSizer.Add(self.btnOk, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
footerSizer.Add(buttonsSizer, 1, wx.ALIGN_RIGHT, 5)
|
||||
@@ -432,11 +432,11 @@ class PFGaugePref(PreferenceView):
|
||||
event.Skip()
|
||||
|
||||
def DumpColours(self, event):
|
||||
print("Gradient start: %d" % self.sliderGradientStart.GetValue())
|
||||
print(" 0 <-> 100 Start: ", self.c0100S, " End: ", self.c0100E)
|
||||
print("100 <-> 101 Start: ", self.c100101S, " End: ", self.c100101E)
|
||||
print("101 <-> 103 Start: ", self.c101103S, " End: ", self.c101103E)
|
||||
print("103 <-> 105 Start: ", self.c103105S, " End: ", self.c103105E)
|
||||
print(("Gradient start: %d" % self.sliderGradientStart.GetValue()))
|
||||
print((" 0 <-> 100 Start: ", self.c0100S, " End: ", self.c0100E))
|
||||
print(("100 <-> 101 Start: ", self.c100101S, " End: ", self.c100101E))
|
||||
print(("101 <-> 103 Start: ", self.c101103S, " End: ", self.c101103E))
|
||||
print(("103 <-> 105 Start: ", self.c103105S, " End: ", self.c103105E))
|
||||
|
||||
event.Skip()
|
||||
|
||||
|
||||
@@ -34,70 +34,70 @@ class PFGeneralPref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, u"Use global character", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, u"Use global damage pattern", wx.DefaultPosition,
|
||||
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, u"Compact skills needed tooltip", wx.DefaultPosition,
|
||||
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition,
|
||||
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, u"Reopen previous fits on startup", wx.DefaultPosition,
|
||||
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, u"Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
labelSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, u"Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
|
||||
mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)
|
||||
|
||||
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, u"Show tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, u"Show market shortcuts", wx.DefaultPosition,
|
||||
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, "Show market shortcuts", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, u"Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY, u"Export loaded charges", wx.DefaultPosition,
|
||||
self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY, "Export loaded charges", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, u"Open fittings in a new page by default",
|
||||
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, u"Show ship browser tooltip",
|
||||
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
priceSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, u"Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, "Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stDefaultSystem.Wrap(-1)
|
||||
priceSizer.Add(self.stDefaultSystem, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.chPriceSystem = wx.Choice(panel, choices=Price.systemsList.keys())
|
||||
self.chPriceSystem = wx.Choice(panel, choices=list(Price.systemsList.keys()))
|
||||
priceSizer.Add(self.chPriceSystem, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
mainSizer.Add(priceSizer, 0, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
delayTimer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, u"Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, "Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stMarketDelay.Wrap(-1)
|
||||
self.stMarketDelay.SetCursor(helpCursor)
|
||||
self.stMarketDelay.SetToolTip(
|
||||
|
||||
@@ -38,7 +38,7 @@ class PFHTMLExportPref(PreferenceView):
|
||||
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
|
||||
|
||||
self.PathLinkCtrl = wx.HyperlinkCtrl(panel, wx.ID_ANY, self.HTMLExportSettings.getPath(),
|
||||
u'file:///{}'.format(self.HTMLExportSettings.getPath()),
|
||||
'file:///{}'.format(self.HTMLExportSettings.getPath()),
|
||||
wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.HL_ALIGN_LEFT | wx.NO_BORDER | wx.HL_CONTEXTMENU)
|
||||
mainSizer.Add(self.PathLinkCtrl, 0, wx.ALL | wx.EXPAND, 5)
|
||||
@@ -56,7 +56,7 @@ class PFHTMLExportPref(PreferenceView):
|
||||
self.stDesc4.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stDesc4, 0, wx.ALL, 5)
|
||||
|
||||
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, u"Enable minimal format", wx.DefaultPosition,
|
||||
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, "Enable minimal format", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.exportMinimal.SetValue(self.HTMLExportSettings.getMinimalEnabled())
|
||||
self.exportMinimal.Bind(wx.EVT_CHECKBOX, self.OnMinimalEnabledChange)
|
||||
@@ -67,7 +67,7 @@ class PFHTMLExportPref(PreferenceView):
|
||||
|
||||
def setPathLinkCtrlValues(self, path):
|
||||
self.PathLinkCtrl.SetLabel(self.HTMLExportSettings.getPath())
|
||||
self.PathLinkCtrl.SetURL(u'file:///{}'.format(self.HTMLExportSettings.getPath()))
|
||||
self.PathLinkCtrl.SetURL('file:///{}'.format(self.HTMLExportSettings.getPath()))
|
||||
self.PathLinkCtrl.SetSize(wx.DefaultSize)
|
||||
self.PathLinkCtrl.Refresh()
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class PFGeneralPref(PreferenceView):
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
@@ -34,7 +34,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
# Database path
|
||||
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, u"Log file location:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, "Log file location:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stLogPath.Wrap(-1)
|
||||
mainSizer.Add(self.stLogPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
self.inputLogPath = wx.TextCtrl(panel, wx.ID_ANY, config.logPath, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -43,13 +43,13 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputLogPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
# Debug Logging
|
||||
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, u"Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, "Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbdebugLogging, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, u"Pressing this button will cause all logs in memory to write to the log file:",
|
||||
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, "Pressing this button will cause all logs in memory to write to the log file:",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.stDumpLogs, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, u"Dump All Logs", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, "Dump All Logs", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDumpLogs.Bind(wx.EVT_BUTTON, OnDumpLogs)
|
||||
mainSizer.Add(self.btnDumpLogs, 0, wx.ALIGN_LEFT, 5)
|
||||
|
||||
|
||||
@@ -30,18 +30,18 @@ class PFNetworkPref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, u"Enable Network", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, "Enable Network", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbEnableNetwork, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
subSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, u"EVE Servers (API && CREST import)", wx.DefaultPosition,
|
||||
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, "EVE Servers (API && CREST import)", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbEve, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, u"Pricing updates", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, "Pricing updates", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbPricing, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, u"Pyfa Update checks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, "Pyfa Update checks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbPyfaUpdate, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
mainSizer.Add(subSizer, 0, wx.LEFT | wx.EXPAND, 30)
|
||||
@@ -80,11 +80,11 @@ class PFNetworkPref(PreferenceView):
|
||||
|
||||
ptypeSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stPType = wx.StaticText(panel, wx.ID_ANY, u"Mode:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPType = wx.StaticText(panel, wx.ID_ANY, "Mode:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPType.Wrap(-1)
|
||||
ptypeSizer.Add(self.stPType, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.chProxyTypeChoices = [u"No proxy", u"Auto-detected proxy settings", u"Manual proxy settings"]
|
||||
self.chProxyTypeChoices = ["No proxy", "Auto-detected proxy settings", "Manual proxy settings"]
|
||||
self.chProxyType = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chProxyTypeChoices, 0)
|
||||
|
||||
self.chProxyType.SetSelection(self.nMode)
|
||||
@@ -98,7 +98,7 @@ class PFNetworkPref(PreferenceView):
|
||||
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
|
||||
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, u"Addr:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, "Addr:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetAddr.Wrap(-1)
|
||||
fgAddrSizer.Add(self.stPSetAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -106,7 +106,7 @@ class PFNetworkPref(PreferenceView):
|
||||
|
||||
fgAddrSizer.Add(self.editProxySettingsAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, u"Port:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, "Port:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPort.Wrap(-1)
|
||||
|
||||
fgAddrSizer.Add(self.stPSetPort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -118,11 +118,11 @@ class PFNetworkPref(PreferenceView):
|
||||
mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
# proxy auth information: login and pass
|
||||
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, u"Username:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, "Username:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetLogin.Wrap(-1)
|
||||
self.editProxySettingsLogin = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[0], wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, u"Password:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, "Password:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPassword.Wrap(-1)
|
||||
self.editProxySettingsPassword = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[1], wx.DefaultPosition,
|
||||
wx.DefaultSize, wx.TE_PASSWORD)
|
||||
@@ -133,7 +133,7 @@ class PFNetworkPref(PreferenceView):
|
||||
pAuthSizer.Add(self.editProxySettingsPassword, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
mainSizer.Add(pAuthSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, u"Auto-detected: ", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, "Auto-detected: ", wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
self.stPSAutoDetected.Wrap(-1)
|
||||
mainSizer.Add(self.stPSAutoDetected, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -141,7 +141,7 @@ class PFNetworkPref(PreferenceView):
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
|
||||
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, u"Apply Proxy Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, "Apply Proxy Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
|
||||
btnSizer.Add(self.btnApply, 0, wx.ALL, 5)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class PFStatViewPref(PreferenceView):
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY,
|
||||
u"Changes require restart of pyfa to take effect.",
|
||||
"Changes require restart of pyfa to take effect.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
|
||||
@@ -33,7 +33,7 @@ class PFUpdatePref(PreferenceView):
|
||||
self.stDesc.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
|
||||
|
||||
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, u"Allow pre-release notifications", wx.DefaultPosition,
|
||||
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, "Allow pre-release notifications", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.suppressPrerelease.Bind(wx.EVT_CHECKBOX, self.OnPrereleaseStateChange)
|
||||
self.suppressPrerelease.SetValue(not self.UpdateSettings.get('prerelease'))
|
||||
|
||||
@@ -12,7 +12,7 @@ import gui.mainFrame
|
||||
import gui.utils.colorUtils as colorUtils
|
||||
import gui.utils.drawUtils as drawUtils
|
||||
import gui.utils.fonts as fonts
|
||||
from events import *
|
||||
from .events import *
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from gui.builtinShipBrowser.pfBitmapFrame import PFBitmapFrame
|
||||
from service.fit import Fit
|
||||
@@ -154,8 +154,8 @@ class FitItem(SFItem.SFBrowserItem):
|
||||
if self.shipTrait and sFit.serviceFittingOptions["showShipBrowserTooltip"]:
|
||||
notes = ""
|
||||
if self.notes:
|
||||
notes = u'─' * 20 + u"\nNotes: {}\n".format(self.notes[:197] + '...' if len(self.notes) > 200 else self.notes)
|
||||
self.SetToolTip(wx.ToolTip(u'{}\n{}{}\n{}'.format(self.shipName, notes, u'─' * 20, self.shipTrait)))
|
||||
notes = '─' * 20 + "\nNotes: {}\n".format(self.notes[:197] + '...' if len(self.notes) > 200 else self.notes)
|
||||
self.SetToolTip(wx.ToolTip('{}\n{}{}\n{}'.format(self.shipName, notes, '─' * 20, self.shipTrait)))
|
||||
|
||||
def OnKeyUp(self, event):
|
||||
if event.GetKeyCode() in (32, 13): # space and enter
|
||||
|
||||
@@ -8,7 +8,7 @@ import gui.mainFrame
|
||||
import gui.utils.colorUtils as colorUtils
|
||||
import gui.utils.drawUtils as drawUtils
|
||||
import gui.utils.fonts as fonts
|
||||
from events import *
|
||||
from .events import *
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ class PFListPane(wx.ScrolledWindow):
|
||||
maxy = 0
|
||||
|
||||
selected = None
|
||||
for i in xrange(len(self._wList)):
|
||||
for i in range(len(self._wList)):
|
||||
iwidth, iheight = self._wList[i].GetSize()
|
||||
xa, ya = self.CalcScrolledPosition((0, maxy))
|
||||
self._wList[i].SetPosition((xa, ya))
|
||||
@@ -144,7 +144,7 @@ class PFListPane(wx.ScrolledWindow):
|
||||
elif doFocus:
|
||||
self.SetFocus()
|
||||
|
||||
for i in xrange(len(self._wList)):
|
||||
for i in range(len(self._wList)):
|
||||
iwidth, iheight = self._wList[i].GetSize()
|
||||
self._wList[i].SetSize((cwidth, iheight))
|
||||
if doRefresh is True:
|
||||
|
||||
@@ -6,7 +6,7 @@ from logbook import Logger
|
||||
import gui.utils.animEffects as animEffects
|
||||
import gui.utils.colorUtils as colorUtils
|
||||
import gui.utils.drawUtils as drawUtils
|
||||
from events import *
|
||||
from .events import *
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -8,7 +8,7 @@ import gui.mainFrame
|
||||
import gui.utils.colorUtils as colorUtils
|
||||
import gui.utils.drawUtils as drawUtils
|
||||
import gui.utils.fonts as fonts
|
||||
from events import *
|
||||
from .events import *
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from gui.contextMenu import ContextMenu
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -124,7 +124,7 @@ class CapacitorViewFull(StatsView):
|
||||
label = getattr(self, labelName % panel)
|
||||
value = value() if fit is not None else 0
|
||||
value = value if value is not None else 0
|
||||
if isinstance(value, basestring):
|
||||
if isinstance(value, str):
|
||||
label.SetLabel(value)
|
||||
label.SetToolTip(wx.ToolTip(value))
|
||||
else:
|
||||
|
||||
@@ -69,7 +69,7 @@ class MiningYieldViewFull(StatsView):
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 1, wx.ALIGN_CENTER)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 m\u00B3/s")
|
||||
setattr(self, "label%sminingyield%s" % (panel.capitalize(), miningType.capitalize()), lbl)
|
||||
|
||||
hbox.Add(lbl, 0, wx.ALIGN_CENTER)
|
||||
@@ -90,7 +90,7 @@ class MiningYieldViewFull(StatsView):
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 1, wx.EXPAND)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0.0 m\u00B3/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 m\u00B3/s")
|
||||
setattr(self, "label%sminingyieldTotal" % panel.capitalize(), lbl)
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
@@ -128,9 +128,9 @@ class MiningYieldViewFull(StatsView):
|
||||
def refreshPanel(self, fit):
|
||||
# If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
|
||||
stats = (("labelFullminingyieldMiner", lambda: fit.minerYield, 3, 0, 0, u"%s m\u00B3/s", None),
|
||||
("labelFullminingyieldDrone", lambda: fit.droneYield, 3, 0, 0, u"%s m\u00B3/s", None),
|
||||
("labelFullminingyieldTotal", lambda: fit.totalYield, 3, 0, 0, u"%s m\u00B3/s", None))
|
||||
stats = (("labelFullminingyieldMiner", lambda: fit.minerYield, 3, 0, 0, "%s m\u00B3/s", None),
|
||||
("labelFullminingyieldDrone", lambda: fit.droneYield, 3, 0, 0, "%s m\u00B3/s", None),
|
||||
("labelFullminingyieldTotal", lambda: fit.totalYield, 3, 0, 0, "%s m\u00B3/s", None))
|
||||
|
||||
counter = 0
|
||||
for labelName, value, prec, lowest, highest, valueFormat, altFormat in stats:
|
||||
|
||||
@@ -63,9 +63,9 @@ class OutgoingViewFull(StatsView):
|
||||
baseBox.Add(BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER)
|
||||
|
||||
if "Capacitor" in outgoingType:
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0 GJ/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0 GJ/s")
|
||||
else:
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0 HP/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0 HP/s")
|
||||
|
||||
lbl.SetToolTip(wx.ToolTip(tooltip))
|
||||
|
||||
@@ -81,10 +81,10 @@ class OutgoingViewFull(StatsView):
|
||||
# If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
|
||||
stats = [
|
||||
("labelRemoteArmor", lambda: fit.remoteReps["Armor"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteShield", lambda: fit.remoteReps["Shield"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteHull", lambda: fit.remoteReps["Hull"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteCapacitor", lambda: fit.remoteReps["Capacitor"], 3, 0, 0, u"%s GJ/s", None),
|
||||
("labelRemoteArmor", lambda: fit.remoteReps["Armor"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteShield", lambda: fit.remoteReps["Shield"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteHull", lambda: fit.remoteReps["Hull"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteCapacitor", lambda: fit.remoteReps["Capacitor"], 3, 0, 0, "%s GJ/s", None),
|
||||
]
|
||||
|
||||
counter = 0
|
||||
|
||||
@@ -62,9 +62,9 @@ class OutgoingViewMinimal(StatsView):
|
||||
baseBox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label), 0, wx.ALIGN_CENTER)
|
||||
|
||||
if "Capacitor" in outgoingType:
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0 GJ/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0 GJ/s")
|
||||
else:
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, u"0 HP/s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0 HP/s")
|
||||
|
||||
lbl.SetToolTip(wx.ToolTip(tooltip))
|
||||
|
||||
@@ -80,10 +80,10 @@ class OutgoingViewMinimal(StatsView):
|
||||
# If we did anything intresting, we'd update our labels to reflect the new fit's stats here
|
||||
|
||||
stats = [
|
||||
("labelRemoteArmor", lambda: fit.remoteReps["Armor"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteShield", lambda: fit.remoteReps["Shield"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteHull", lambda: fit.remoteReps["Hull"], 3, 0, 0, u"%s HP/s", None),
|
||||
("labelRemoteCapacitor", lambda: fit.remoteReps["Capacitor"], 3, 0, 0, u"%s GJ/s", None),
|
||||
("labelRemoteArmor", lambda: fit.remoteReps["Armor"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteShield", lambda: fit.remoteReps["Shield"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteHull", lambda: fit.remoteReps["Hull"], 3, 0, 0, "%s HP/s", None),
|
||||
("labelRemoteCapacitor", lambda: fit.remoteReps["Capacitor"], 3, 0, 0, "%s GJ/s", None),
|
||||
]
|
||||
|
||||
counter = 0
|
||||
|
||||
@@ -93,7 +93,7 @@ class ResistancesViewFull(StatsView):
|
||||
|
||||
self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP)
|
||||
|
||||
for i in xrange(4):
|
||||
for i in range(4):
|
||||
sizerResistances.AddGrowableCol(i + 1)
|
||||
|
||||
sizerResistances.Add(self.stEHPs, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER)
|
||||
|
||||
@@ -169,8 +169,8 @@ class ResourcesViewFull(StatsView):
|
||||
setattr(self, "label%sTotal%s" % (panel.capitalize(), capitalizedType), lbl)
|
||||
absolute.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
units = {"cpu": " tf", "pg": " MW", "droneBandwidth": " mbit/s", "droneBay": u" m\u00B3",
|
||||
"fighterBay": u" m\u00B3", "cargoBay": u" m\u00B3"}
|
||||
units = {"cpu": " tf", "pg": " MW", "droneBandwidth": " mbit/s", "droneBay": " m\u00B3",
|
||||
"fighterBay": " m\u00B3", "cargoBay": " m\u00B3"}
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "%s" % units[type_])
|
||||
absolute.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
@@ -275,7 +275,7 @@ class ResourcesViewFull(StatsView):
|
||||
totalCalibrationPoints = value
|
||||
labelTCP = label
|
||||
|
||||
if isinstance(value, basestring):
|
||||
if isinstance(value, str):
|
||||
label.SetLabel(value)
|
||||
label.SetToolTip(wx.ToolTip(value))
|
||||
else:
|
||||
|
||||
@@ -87,7 +87,7 @@ class TargetingMiscViewFull(StatsView):
|
||||
("Align time", "AlignTime", "s"),
|
||||
("Signature", "SigRadius", "m"),
|
||||
("Warp Speed", "WarpSpeed", "AU/s"),
|
||||
("Cargo", "Cargo", u"m\u00B3"))
|
||||
("Cargo", "Cargo", "m\u00B3"))
|
||||
|
||||
for header, labelShort, unit in labels:
|
||||
gridMisc.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
|
||||
@@ -157,7 +157,7 @@ class TargetingMiscViewFull(StatsView):
|
||||
("labelFullAlignTime", {"main": lambda: fit.alignTime}, 3, 0, 0, "s"),
|
||||
("labelFullSigRadius", {"main": lambda: fit.ship.getModifiedItemAttr("signatureRadius")}, 3, 0, 9, ""),
|
||||
("labelFullWarpSpeed", {"main": lambda: fit.warpSpeed}, 3, 0, 0, "AU/s"),
|
||||
("labelFullCargo", cargoValues, 4, 0, 9, u"m\u00B3"))
|
||||
("labelFullCargo", cargoValues, 4, 0, 9, "m\u00B3"))
|
||||
|
||||
counter = 0
|
||||
RADII = [("Pod", 25), ("Interceptor", 33), ("Frigate", 38),
|
||||
@@ -167,13 +167,13 @@ class TargetingMiscViewFull(StatsView):
|
||||
for labelName, valueDict, prec, lowest, highest, unit in stats:
|
||||
label = getattr(self, labelName)
|
||||
newValues = {}
|
||||
for valueAlias, value in valueDict.items():
|
||||
for valueAlias, value in list(valueDict.items()):
|
||||
value = value() if fit is not None else 0
|
||||
value = value if value is not None else 0
|
||||
newValues[valueAlias] = value
|
||||
if self._cachedValues[counter] != newValues:
|
||||
mainValue = newValues["main"]
|
||||
otherValues = dict((k, newValues[k]) for k in filter(lambda k: k != "main", newValues))
|
||||
otherValues = dict((k, newValues[k]) for k in [k for k in newValues if k != "main"])
|
||||
if labelName == "labelFullCargo":
|
||||
# Get sum of all cargoholds except for maintenance bay
|
||||
additionalCargo = sum(otherValues.values())
|
||||
@@ -210,11 +210,11 @@ class TargetingMiscViewFull(StatsView):
|
||||
agility = "Agility:\t%.3fx" % (fit.ship.getModifiedItemAttr("agility") or 0)
|
||||
label.SetToolTip(wx.ToolTip("%s\n%s\n%s" % (alignTime, mass, agility)))
|
||||
elif labelName == "labelFullCargo":
|
||||
tipLines = [u"Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
for attrName, tipAlias in cargoNamesOrder.items():
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if newValues[attrName] > 0:
|
||||
tipLines.append(u"{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
|
||||
label.SetToolTip(wx.ToolTip(u"\n".join(tipLines)))
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
|
||||
label.SetToolTip(wx.ToolTip("\n".join(tipLines)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % mainValue))
|
||||
else:
|
||||
@@ -238,11 +238,11 @@ class TargetingMiscViewFull(StatsView):
|
||||
cachedCargo = self._cachedValues[counter]
|
||||
# if you add stuff to cargo, the capacity doesn't change and thus it is still cached
|
||||
# This assures us that we force refresh of cargo tooltip
|
||||
tipLines = [u"Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
for attrName, tipAlias in cargoNamesOrder.items():
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if cachedCargo[attrName] > 0:
|
||||
tipLines.append(u"{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
|
||||
label.SetToolTip(wx.ToolTip(u"\n".join(tipLines)))
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
|
||||
label.SetToolTip(wx.ToolTip("\n".join(tipLines)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip(""))
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
("Align time", "AlignTime", "s"),
|
||||
("Signature", "SigRadius", "m"),
|
||||
("Warp Speed", "WarpSpeed", "AU/s"),
|
||||
("Cargo", "Cargo", u"m\u00B3"))
|
||||
("Cargo", "Cargo", "m\u00B3"))
|
||||
|
||||
for header, labelShort, unit in labels:
|
||||
gridMisc.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
|
||||
@@ -154,7 +154,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
("labelFullAlignTime", {"main": lambda: fit.alignTime}, 3, 0, 0, "s"),
|
||||
("labelFullSigRadius", {"main": lambda: fit.ship.getModifiedItemAttr("signatureRadius")}, 3, 0, 9, ""),
|
||||
("labelFullWarpSpeed", {"main": lambda: fit.warpSpeed}, 3, 0, 0, "AU/s"),
|
||||
("labelFullCargo", cargoValues, 4, 0, 9, u"m\u00B3"))
|
||||
("labelFullCargo", cargoValues, 4, 0, 9, "m\u00B3"))
|
||||
|
||||
counter = 0
|
||||
RADII = [("Pod", 25), ("Interceptor", 33), ("Frigate", 38),
|
||||
@@ -164,13 +164,13 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
for labelName, valueDict, prec, lowest, highest, unit in stats:
|
||||
label = getattr(self, labelName)
|
||||
newValues = {}
|
||||
for valueAlias, value in valueDict.items():
|
||||
for valueAlias, value in list(valueDict.items()):
|
||||
value = value() if fit is not None else 0
|
||||
value = value if value is not None else 0
|
||||
newValues[valueAlias] = value
|
||||
if self._cachedValues[counter] != newValues:
|
||||
mainValue = newValues["main"]
|
||||
otherValues = dict((k, newValues[k]) for k in filter(lambda k: k != "main", newValues))
|
||||
otherValues = dict((k, newValues[k]) for k in [k for k in newValues if k != "main"])
|
||||
if labelName == "labelFullCargo":
|
||||
# Get sum of all cargoholds except for maintenance bay
|
||||
additionalCargo = sum(otherValues.values())
|
||||
@@ -204,11 +204,11 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
agility = "Agility:\t%.3fx" % (fit.ship.getModifiedItemAttr("agility") or 0)
|
||||
label.SetToolTip(wx.ToolTip("%s\n%s\n%s" % (alignTime, mass, agility)))
|
||||
elif labelName == "labelFullCargo":
|
||||
tipLines = [u"Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
for attrName, tipAlias in cargoNamesOrder.items():
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if newValues[attrName] > 0:
|
||||
tipLines.append(u"{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
|
||||
label.SetToolTip(wx.ToolTip(u"\n".join(tipLines)))
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
|
||||
label.SetToolTip(wx.ToolTip("\n".join(tipLines)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % mainValue))
|
||||
else:
|
||||
@@ -232,11 +232,11 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
cachedCargo = self._cachedValues[counter]
|
||||
# if you add stuff to cargo, the capacity doesn't change and thus it is still cached
|
||||
# This assures us that we force refresh of cargo tooltip
|
||||
tipLines = [u"Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
for attrName, tipAlias in cargoNamesOrder.items():
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if cachedCargo[attrName] > 0:
|
||||
tipLines.append(u"{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
|
||||
label.SetToolTip(wx.ToolTip(u"\n".join(tipLines)))
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
|
||||
label.SetToolTip(wx.ToolTip("\n".join(tipLines)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip(""))
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class AttributeDisplay(ViewColumn):
|
||||
if self.info.name == "volume":
|
||||
str_ = (formatAmount(attr, 3, 0, 3))
|
||||
if hasattr(mod, "amount"):
|
||||
str_ += u"m\u00B3 (%s m\u00B3)" % (formatAmount(attr * mod.amount, 3, 0, 3))
|
||||
str_ += "m\u00B3 (%s m\u00B3)" % (formatAmount(attr * mod.amount, 3, 0, 3))
|
||||
attr = str_
|
||||
|
||||
if isinstance(attr, (float, int)):
|
||||
|
||||
@@ -71,9 +71,9 @@ class BaseName(ViewColumn):
|
||||
elif isinstance(stuff, Rack):
|
||||
if FitSvc.getInstance().serviceFittingOptions["rackLabels"]:
|
||||
if stuff.slot == Slot.MODE:
|
||||
return u'─ Tactical Mode ─'
|
||||
return '─ Tactical Mode ─'
|
||||
else:
|
||||
return u'─ {} Slots ─'.format(Slot.getName(stuff.slot).capitalize())
|
||||
return '─ {} Slots ─'.format(Slot.getName(stuff.slot).capitalize())
|
||||
else:
|
||||
return ""
|
||||
elif isinstance(stuff, Module):
|
||||
@@ -91,7 +91,7 @@ class BaseName(ViewColumn):
|
||||
|
||||
if marketShortcut:
|
||||
# use unicode subscript to display shortcut value
|
||||
shortcut = unichr(marketShortcut + 8320) + u" "
|
||||
shortcut = chr(marketShortcut + 8320) + " "
|
||||
del item.marketShortcut
|
||||
return shortcut + item.name
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class Miscellanea(ViewColumn):
|
||||
"falloff range": falloffRangeBonus,
|
||||
"tracking speed": trackingSpeedBonus}
|
||||
|
||||
isTrackingDisruptor = any(map(lambda x: x is not None and x != 0, trackingDisruptorAttributes.values()))
|
||||
isTrackingDisruptor = any([x is not None and x != 0 for x in list(trackingDisruptorAttributes.values())])
|
||||
|
||||
# Then get the attributes for guidance disruptors
|
||||
explosionVelocityBonus = stuff.getModifiedItemAttr("aoeVelocityBonus")
|
||||
@@ -186,7 +186,7 @@ class Miscellanea(ViewColumn):
|
||||
"flight time": flightTimeBonus,
|
||||
"missile velocity": missileVelocityBonus}
|
||||
|
||||
isGuidanceDisruptor = any(map(lambda x: x is not None and x != 0, guidanceDisruptorAttributes.values()))
|
||||
isGuidanceDisruptor = any([x is not None and x != 0 for x in list(guidanceDisruptorAttributes.values())])
|
||||
|
||||
if isTrackingDisruptor:
|
||||
attributes = trackingDisruptorAttributes
|
||||
@@ -195,12 +195,12 @@ class Miscellanea(ViewColumn):
|
||||
else:
|
||||
return "", None
|
||||
|
||||
display = max(attributes.values(), key=lambda x: abs(x))
|
||||
display = max(list(attributes.values()), key=lambda x: abs(x))
|
||||
|
||||
text = "{0}%".format(formatAmount(display, 3, 0, 3, forceSign=True))
|
||||
|
||||
ttEntries = []
|
||||
for attributeName, attributeValue in attributes.items():
|
||||
for attributeName, attributeValue in list(attributes.items()):
|
||||
if attributeValue == display:
|
||||
ttEntries.append(attributeName)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class EntityEditor(wx.Panel):
|
||||
|
||||
self.choices = []
|
||||
self.choices.sort(key=lambda p: p.name)
|
||||
self.entityChoices = wx.Choice(self, choices=map(lambda p: p.name, self.choices))
|
||||
self.entityChoices = wx.Choice(self, choices=[p.name for p in self.choices])
|
||||
self.navSizer.Add(self.entityChoices, 1, wx.ALL, 5)
|
||||
|
||||
buttons = (("new", wx.ART_NEW, self.OnNew),
|
||||
@@ -96,8 +96,8 @@ class EntityEditor(wx.Panel):
|
||||
|
||||
def OnNew(self, event):
|
||||
dlg = TextEntryValidatedDialog(self, self.validator,
|
||||
u"Enter a name for your new {}:".format(self.entityName),
|
||||
u"New {}".format(self.entityName))
|
||||
"Enter a name for your new {}:".format(self.entityName),
|
||||
"New {}".format(self.entityName))
|
||||
dlg.CenterOnParent()
|
||||
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
@@ -110,10 +110,10 @@ class EntityEditor(wx.Panel):
|
||||
|
||||
def OnCopy(self, event):
|
||||
dlg = TextEntryValidatedDialog(self, self.validator,
|
||||
u"Enter a name for your {} copy:".format(self.entityName),
|
||||
u"Copy {}".format(self.entityName))
|
||||
"Enter a name for your {} copy:".format(self.entityName),
|
||||
"Copy {}".format(self.entityName))
|
||||
active = self.getActiveEntity()
|
||||
dlg.SetValue(u"{} Copy".format(active.name))
|
||||
dlg.SetValue("{} Copy".format(active.name))
|
||||
dlg.txtctrl.SetInsertionPointEnd()
|
||||
dlg.CenterOnParent()
|
||||
|
||||
@@ -124,8 +124,8 @@ class EntityEditor(wx.Panel):
|
||||
|
||||
def OnRename(self, event):
|
||||
dlg = TextEntryValidatedDialog(self, self.validator,
|
||||
u"Enter a new name for your {}:".format(self.entityName),
|
||||
u"Rename {}".format(self.entityName))
|
||||
"Enter a new name for your {}:".format(self.entityName),
|
||||
"Rename {}".format(self.entityName))
|
||||
active = self.getActiveEntity()
|
||||
dlg.SetValue(active.name)
|
||||
dlg.txtctrl.SetInsertionPointEnd()
|
||||
@@ -138,9 +138,9 @@ class EntityEditor(wx.Panel):
|
||||
|
||||
def OnDelete(self, event):
|
||||
dlg = wx.MessageDialog(self,
|
||||
u"Do you really want to delete the {} {}?".format(self.getActiveEntity().name,
|
||||
"Do you really want to delete the {} {}?".format(self.getActiveEntity().name,
|
||||
self.entityName),
|
||||
u"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
|
||||
"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
|
||||
dlg.CenterOnParent()
|
||||
|
||||
if dlg.ShowModal() == wx.ID_YES:
|
||||
@@ -152,7 +152,7 @@ class EntityEditor(wx.Panel):
|
||||
self.choices = self.getEntitiesFromContext()
|
||||
self.entityChoices.Clear()
|
||||
|
||||
self.entityChoices.AppendItems(map(lambda p: p.name, self.choices))
|
||||
self.entityChoices.AppendItems([p.name for p in self.choices])
|
||||
if selected:
|
||||
idx = self.choices.index(selected)
|
||||
self.entityChoices.SetSelection(idx)
|
||||
|
||||
@@ -321,7 +321,7 @@ class FittingView(d.Display):
|
||||
fit = sFit.getFit(self.getActiveFit(), basic=True)
|
||||
|
||||
bitmap = BitmapLoader.getImage("race_%s_small" % fit.ship.item.race, "gui")
|
||||
text = u"%s: %s" % (fit.ship.item.name, fit.name)
|
||||
text = "%s: %s" % (fit.ship.item.name, fit.name)
|
||||
|
||||
pageIndex = self.parent.GetPageIndex(self)
|
||||
if pageIndex is not None:
|
||||
@@ -731,7 +731,7 @@ class FittingView(d.Display):
|
||||
break
|
||||
name = col.getText(st)
|
||||
|
||||
if not isinstance(name, basestring):
|
||||
if not isinstance(name, str):
|
||||
name = ""
|
||||
|
||||
nx, ny = tdc.GetTextExtent(name)
|
||||
@@ -761,7 +761,7 @@ class FittingView(d.Display):
|
||||
name = col.columnText
|
||||
imgId = col.imageId
|
||||
|
||||
if not isinstance(name, basestring):
|
||||
if not isinstance(name, str):
|
||||
name = ""
|
||||
|
||||
opts = wx.HeaderButtonParams()
|
||||
@@ -804,7 +804,7 @@ class FittingView(d.Display):
|
||||
name = col.columnText
|
||||
imgId = col.imageId
|
||||
|
||||
if not isinstance(name, basestring):
|
||||
if not isinstance(name, str):
|
||||
name = ""
|
||||
|
||||
opts = wx.HeaderButtonParams()
|
||||
@@ -838,7 +838,7 @@ class FittingView(d.Display):
|
||||
break
|
||||
|
||||
name = col.getText(st)
|
||||
if not isinstance(name, basestring):
|
||||
if not isinstance(name, str):
|
||||
name = ""
|
||||
|
||||
imgId = col.getImageId(st)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
from utils.floatspin import FloatSpin
|
||||
from .utils.floatspin import FloatSpin
|
||||
# noinspection PyPackageRequirements
|
||||
import wx.lib.newevent
|
||||
# noinspection PyPackageRequirements
|
||||
@@ -57,9 +57,9 @@ class CharacterTextValidor(BaseValidator):
|
||||
raise ValueError("Character name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
except ValueError, e:
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox(u"{}".format(e), "Error")
|
||||
wx.MessageBox("{}".format(e), "Error")
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
|
||||
@@ -128,7 +128,7 @@ class CharacterEntityEditor(EntityEditor):
|
||||
|
||||
class CharacterEditor(wx.Frame):
|
||||
def __init__(self, parent):
|
||||
wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition,
|
||||
wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="pyfa: Character Editor", pos=wx.DefaultPosition,
|
||||
size=wx.Size(640, 600), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
|
||||
|
||||
i = wx.IconFromBitmap(BitmapLoader.getBitmap("character_small", "gui"))
|
||||
@@ -351,7 +351,7 @@ class SkillTreeView(wx.Panel):
|
||||
self.levelIds[idUnlearned] = "Not learned"
|
||||
self.levelChangeMenu.Append(idUnlearned, "Unlearn")
|
||||
|
||||
for level in xrange(6):
|
||||
for level in range(6):
|
||||
id = wx.NewId()
|
||||
self.levelIds[id] = level
|
||||
self.levelChangeMenu.Append(id, "Level %d" % level)
|
||||
@@ -514,7 +514,7 @@ class SkillTreeView(wx.Panel):
|
||||
def _setTreeSkillLevel(treeItem, skillID):
|
||||
lvl, dirty = sChar.getSkillLevel(char.ID, skillID)
|
||||
self.skillTreeListCtrl.SetItemText(treeItem,
|
||||
"Level {}".format(int(lvl)) if not isinstance(lvl, basestring) else lvl,
|
||||
"Level {}".format(int(lvl)) if not isinstance(lvl, str) else lvl,
|
||||
1)
|
||||
if not dirty:
|
||||
self.skillTreeListCtrl.SetItemTextColour(treeItem, None)
|
||||
@@ -611,16 +611,16 @@ class APIView(wx.Panel):
|
||||
self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor
|
||||
self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
|
||||
|
||||
self.apiUrlCreatePredefined = u"https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=8"
|
||||
self.apiUrlKeyList = u"https://community.eveonline.com/support/api-key/"
|
||||
self.apiUrlCreatePredefined = "https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=8"
|
||||
self.apiUrlKeyList = "https://community.eveonline.com/support/api-key/"
|
||||
|
||||
pmainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
hintSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
hintSizer.AddStretchSpacer()
|
||||
self.stDisabledTip = wx.StaticText(self, wx.ID_ANY,
|
||||
u"You cannot add API Details for All 0 and All 5 characters.\n"
|
||||
u"Please select another character or make a new one.", style=wx.ALIGN_CENTER)
|
||||
"You cannot add API Details for All 0 and All 5 characters.\n"
|
||||
"Please select another character or make a new one.", style=wx.ALIGN_CENTER)
|
||||
self.stDisabledTip.Wrap(-1)
|
||||
hintSizer.Add(self.stDisabledTip, 0, wx.TOP | wx.BOTTOM, 10)
|
||||
self.stDisabledTip.Hide()
|
||||
@@ -632,21 +632,21 @@ class APIView(wx.Panel):
|
||||
fgSizerInput.SetFlexibleDirection(wx.BOTH)
|
||||
fgSizerInput.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.m_staticIDText = wx.StaticText(self, wx.ID_ANY, u"keyID:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticIDText = wx.StaticText(self, wx.ID_ANY, "keyID:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticIDText.Wrap(-1)
|
||||
fgSizerInput.Add(self.m_staticIDText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.inputID = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
fgSizerInput.Add(self.inputID, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.m_staticKeyText = wx.StaticText(self, wx.ID_ANY, u"vCode:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticKeyText = wx.StaticText(self, wx.ID_ANY, "vCode:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticKeyText.Wrap(-1)
|
||||
fgSizerInput.Add(self.m_staticKeyText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.inputKey = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
fgSizerInput.Add(self.inputKey, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.m_staticCharText = wx.StaticText(self, wx.ID_ANY, u"Character:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticCharText = wx.StaticText(self, wx.ID_ANY, "Character:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticCharText.Wrap(-1)
|
||||
fgSizerInput.Add(self.m_staticCharText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -661,11 +661,11 @@ class APIView(wx.Panel):
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnSizer.AddStretchSpacer()
|
||||
|
||||
self.btnFetchCharList = wx.Button(self, wx.ID_ANY, u"Get Characters")
|
||||
self.btnFetchCharList = wx.Button(self, wx.ID_ANY, "Get Characters")
|
||||
btnSizer.Add(self.btnFetchCharList, 0, wx.ALL, 2)
|
||||
self.btnFetchCharList.Bind(wx.EVT_BUTTON, self.fetchCharList)
|
||||
|
||||
self.btnFetchSkills = wx.Button(self, wx.ID_ANY, u"Fetch Skills")
|
||||
self.btnFetchSkills = wx.Button(self, wx.ID_ANY, "Fetch Skills")
|
||||
btnSizer.Add(self.btnFetchSkills, 0, wx.ALL, 2)
|
||||
self.btnFetchSkills.Bind(wx.EVT_BUTTON, self.fetchSkills)
|
||||
self.btnFetchSkills.Enable(False)
|
||||
@@ -678,7 +678,7 @@ class APIView(wx.Panel):
|
||||
|
||||
pmainSizer.AddStretchSpacer()
|
||||
self.stAPITip = wx.StaticText(self, wx.ID_ANY,
|
||||
u"You can create a pre-defined key here (only CharacterSheet is required):",
|
||||
"You can create a pre-defined key here (only CharacterSheet is required):",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stAPITip.Wrap(-1)
|
||||
|
||||
@@ -688,7 +688,7 @@ class APIView(wx.Panel):
|
||||
wx.DefaultPosition, wx.DefaultSize, wx.HL_DEFAULT_STYLE)
|
||||
pmainSizer.Add(self.hlEveAPI, 0, wx.ALL, 2)
|
||||
|
||||
self.stAPITip2 = wx.StaticText(self, wx.ID_ANY, u"Or, you can choose an existing key from:", wx.DefaultPosition,
|
||||
self.stAPITip2 = wx.StaticText(self, wx.ID_ANY, "Or, you can choose an existing key from:", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.stAPITip2.Wrap(-1)
|
||||
pmainSizer.Add(self.stAPITip2, 0, wx.ALL, 2)
|
||||
@@ -747,15 +747,15 @@ class APIView(wx.Panel):
|
||||
try:
|
||||
activeChar = self.charEditor.entityEditor.getActiveEntity()
|
||||
list = sChar.apiCharList(activeChar.ID, self.inputID.GetLineText(0), self.inputKey.GetLineText(0))
|
||||
except AuthenticationError, e:
|
||||
except AuthenticationError as e:
|
||||
msg = "Authentication failure. Please check keyID and vCode combination."
|
||||
pyfalog.info(msg)
|
||||
self.stStatus.SetLabel(msg)
|
||||
except TimeoutError, e:
|
||||
except TimeoutError as e:
|
||||
msg = "Request timed out. Please check network connectivity and/or proxy settings."
|
||||
pyfalog.info(msg)
|
||||
self.stStatus.SetLabel(msg)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
pyfalog.error(e)
|
||||
self.stStatus.SetLabel("Error:\n%s" % e.message)
|
||||
else:
|
||||
@@ -801,7 +801,7 @@ class SaveCharacterAs(wx.Dialog):
|
||||
|
||||
bSizer1.Add(self.input, 1, wx.ALL, 5)
|
||||
self.input.Bind(wx.EVT_TEXT_ENTER, self.change)
|
||||
self.button = wx.Button(self, wx.ID_OK, u"Save")
|
||||
self.button = wx.Button(self, wx.ID_OK, "Save")
|
||||
bSizer1.Add(self.button, 0, wx.ALL, 5)
|
||||
|
||||
self.SetSizer(bSizer1)
|
||||
@@ -828,7 +828,7 @@ class SecStatusDialog(wx.Dialog):
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.m_staticText1 = wx.StaticText(self, wx.ID_ANY,
|
||||
u"Security Status is used in some CONCORD hull calculations; you can set the characters security status here",
|
||||
"Security Status is used in some CONCORD hull calculations; you can set the characters security status here",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticText1.Wrap(-1)
|
||||
bSizer1.Add(self.m_staticText1, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
@@ -103,14 +103,14 @@ class CharacterSelection(wx.Panel):
|
||||
sChar = Character.getInstance()
|
||||
|
||||
skillsMap = {}
|
||||
for item, stuff in self.reqs.iteritems():
|
||||
for things in stuff.values():
|
||||
for item, stuff in self.reqs.items():
|
||||
for things in list(stuff.values()):
|
||||
if things[1] not in skillsMap:
|
||||
skillsMap[things[1]] = things[0]
|
||||
elif things[0] > skillsMap[things[1]]:
|
||||
skillsMap[things[1]] = things[0]
|
||||
|
||||
for skillID, level in skillsMap.iteritems():
|
||||
for skillID, level in skillsMap.items():
|
||||
sChar.changeLevel(charID, skillID, level, ifHigher=True)
|
||||
|
||||
self.refreshCharacterList()
|
||||
@@ -142,7 +142,7 @@ class CharacterSelection(wx.Panel):
|
||||
sFit = Fit.getInstance()
|
||||
sFit.changeChar(fitID, charID)
|
||||
|
||||
choice.Append(u"\u2015 Open Character Editor \u2015", -1)
|
||||
choice.Append("\u2015 Open Character Editor \u2015", -1)
|
||||
self.charCache = self.charChoice.GetCurrentSelection()
|
||||
|
||||
if event is not None:
|
||||
@@ -251,11 +251,11 @@ class CharacterSelection(wx.Panel):
|
||||
sCharacter = Character.getInstance()
|
||||
|
||||
if tabulationLevel == 0:
|
||||
for item, subReqs in reqs.iteritems():
|
||||
for item, subReqs in reqs.items():
|
||||
tip += "%s:\n" % item.name
|
||||
tip += self._buildSkillsTooltip(subReqs, item.name, 1)
|
||||
else:
|
||||
for name, info in reqs.iteritems():
|
||||
for name, info in reqs.items():
|
||||
level, ID, more = info
|
||||
sCharacter.skillReqsDict['skills'].append({
|
||||
'item': currItem,
|
||||
@@ -277,11 +277,11 @@ class CharacterSelection(wx.Panel):
|
||||
sCharacter = Character.getInstance()
|
||||
|
||||
if tabulationLevel == 0:
|
||||
for item, subReqs in reqs.iteritems():
|
||||
for item, subReqs in reqs.items():
|
||||
skillsMap = self._buildSkillsTooltipCondensed(subReqs, item.name, 1, skillsMap)
|
||||
sorted(skillsMap, key=skillsMap.get)
|
||||
else:
|
||||
for name, info in reqs.iteritems():
|
||||
for name, info in reqs.items():
|
||||
level, ID, more = info
|
||||
sCharacter.skillReqsDict['skills'].append({
|
||||
'item': currItem,
|
||||
|
||||
@@ -72,7 +72,7 @@ class ContextMenu(object):
|
||||
display_amount += 1
|
||||
texts = m.getText(itemContext, selection)
|
||||
|
||||
if isinstance(texts, basestring):
|
||||
if isinstance(texts, str):
|
||||
texts = (texts,)
|
||||
|
||||
bitmap = m.getBitmap(srcContext, selection)
|
||||
|
||||
@@ -31,21 +31,21 @@ class CopySelectDialog(wx.Dialog):
|
||||
copyFormatMultiBuy = 5
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Select a format", size=(-1, -1),
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1),
|
||||
style=wx.DEFAULT_DIALOG_STYLE)
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
copyFormats = [u"EFT", u"EFT (Implants)", u"XML", u"DNA", u"CREST", u"MultiBuy"]
|
||||
copyFormatTooltips = {CopySelectDialog.copyFormatEft: u"EFT text format",
|
||||
CopySelectDialog.copyFormatEftImps: u"EFT text format",
|
||||
CopySelectDialog.copyFormatXml: u"EVE native XML format",
|
||||
CopySelectDialog.copyFormatDna: u"A one-line text format",
|
||||
CopySelectDialog.copyFormatCrest: u"A JSON format used for EVE CREST",
|
||||
CopySelectDialog.copyFormatMultiBuy: u"MultiBuy text format"}
|
||||
selector = wx.RadioBox(self, wx.ID_ANY, label=u"Copy to the clipboard using:", choices=copyFormats,
|
||||
copyFormats = ["EFT", "EFT (Implants)", "XML", "DNA", "CREST", "MultiBuy"]
|
||||
copyFormatTooltips = {CopySelectDialog.copyFormatEft: "EFT text format",
|
||||
CopySelectDialog.copyFormatEftImps: "EFT text format",
|
||||
CopySelectDialog.copyFormatXml: "EVE native XML format",
|
||||
CopySelectDialog.copyFormatDna: "A one-line text format",
|
||||
CopySelectDialog.copyFormatCrest: "A JSON format used for EVE CREST",
|
||||
CopySelectDialog.copyFormatMultiBuy: "MultiBuy text format"}
|
||||
selector = wx.RadioBox(self, wx.ID_ANY, label="Copy to the clipboard using:", choices=copyFormats,
|
||||
style=wx.RA_SPECIFY_ROWS)
|
||||
selector.Bind(wx.EVT_RADIOBOX, self.Selected)
|
||||
for format, tooltip in copyFormatTooltips.iteritems():
|
||||
for format, tooltip in copyFormatTooltips.items():
|
||||
selector.SetItemToolTip(format, tooltip)
|
||||
|
||||
self.copyFormat = CopySelectDialog.copyFormatEft
|
||||
|
||||
@@ -45,7 +45,7 @@ class CrestFittings(wx.Frame):
|
||||
characterSelectSizer.Add(self.charChoice, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
|
||||
self.updateCharList()
|
||||
|
||||
self.fetchBtn = wx.Button(self, wx.ID_ANY, u"Fetch Fits", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
self.fetchBtn = wx.Button(self, wx.ID_ANY, "Fetch Fits", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
characterSelectSizer.Add(self.fetchBtn, 0, wx.ALL, 5)
|
||||
mainSizer.Add(characterSelectSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
@@ -64,8 +64,8 @@ class CrestFittings(wx.Frame):
|
||||
fitSizer.Add(self.fitView, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.importBtn = wx.Button(self, wx.ID_ANY, u"Import to pyfa", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
self.deleteBtn = wx.Button(self, wx.ID_ANY, u"Delete from EVE", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
self.importBtn = wx.Button(self, wx.ID_ANY, "Import to pyfa", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
self.deleteBtn = wx.Button(self, wx.ID_ANY, "Delete from EVE", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
btnSizer.Add(self.importBtn, 1, wx.ALL, 5)
|
||||
btnSizer.Add(self.deleteBtn, 1, wx.ALL, 5)
|
||||
fitSizer.Add(btnSizer, 0, wx.EXPAND)
|
||||
@@ -207,7 +207,7 @@ class ExportToEve(wx.Frame):
|
||||
self.updateCharList()
|
||||
self.charChoice.SetSelection(0)
|
||||
|
||||
self.exportBtn = wx.Button(self, wx.ID_ANY, u"Export Fit", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
self.exportBtn = wx.Button(self, wx.ID_ANY, "Export Fit", wx.DefaultPosition, wx.DefaultSize, 5)
|
||||
hSizer.Add(self.exportBtn, 0, wx.ALL, 5)
|
||||
|
||||
mainSizer.Add(hSizer, 0, wx.EXPAND, 5)
|
||||
@@ -314,10 +314,10 @@ class CrestMgmt(wx.Dialog):
|
||||
|
||||
btnSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.addBtn = wx.Button(self, wx.ID_ANY, u"Add Character", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.addBtn = wx.Button(self, wx.ID_ANY, "Add Character", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.addBtn, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.deleteBtn = wx.Button(self, wx.ID_ANY, u"Revoke Character", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.deleteBtn = wx.Button(self, wx.ID_ANY, "Revoke Character", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.deleteBtn, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
|
||||
@@ -397,7 +397,7 @@ class FittingsTreeView(wx.Panel):
|
||||
dict[fit['ship']['name']] = []
|
||||
dict[fit['ship']['name']].append(fit)
|
||||
|
||||
for name, fits in dict.iteritems():
|
||||
for name, fits in dict.items():
|
||||
shipID = tree.AppendItem(root, name)
|
||||
for fit in fits:
|
||||
fitId = tree.AppendItem(shipID, fit['name'])
|
||||
|
||||
@@ -55,7 +55,7 @@ class Display(wx.ListCtrl):
|
||||
name, type, defaultValue = param
|
||||
value = params[x] if len(params) > x else defaultValue
|
||||
value = value if value != "" else defaultValue
|
||||
if type == bool and isinstance(value, basestring):
|
||||
if type == bool and isinstance(value, str):
|
||||
value = bool(value) if value.lower() != "false" and value != "0" else False
|
||||
paramDict[name] = value
|
||||
col = colClass(self, paramDict)
|
||||
@@ -219,13 +219,13 @@ class Display(wx.ListCtrl):
|
||||
|
||||
if listItemCount < stuffItemCount:
|
||||
for i in range(stuffItemCount - listItemCount):
|
||||
self.InsertStringItem(sys.maxint, "")
|
||||
self.InsertStringItem(sys.maxsize, "")
|
||||
|
||||
if listItemCount > stuffItemCount:
|
||||
if listItemCount - stuffItemCount > 20 > stuffItemCount:
|
||||
self.DeleteAllItems()
|
||||
for i in range(stuffItemCount):
|
||||
self.InsertStringItem(sys.maxint, "")
|
||||
self.InsertStringItem(sys.maxsize, "")
|
||||
else:
|
||||
for i in range(listItemCount - stuffItemCount):
|
||||
self.DeleteItem(self.getLastItem())
|
||||
@@ -247,7 +247,7 @@ class Display(wx.ListCtrl):
|
||||
newText = col.getText(st)
|
||||
if newText is False:
|
||||
col.delayedText(st, self, colItem)
|
||||
newText = u"\u21bb"
|
||||
newText = "\u21bb"
|
||||
|
||||
newImageId = col.getImageId(st)
|
||||
|
||||
|
||||
@@ -93,13 +93,13 @@ class GraphFrame(wx.Frame):
|
||||
|
||||
graphFrame_enabled = True
|
||||
if int(mpl.__version__[0]) < 1:
|
||||
print("pyfa: Found matplotlib version ", mpl.__version__, " - activating OVER9000 workarounds")
|
||||
print(("pyfa: Found matplotlib version ", mpl.__version__, " - activating OVER9000 workarounds"))
|
||||
print("pyfa: Recommended minimum matplotlib version is 1.0.0")
|
||||
self.legendFix = True
|
||||
|
||||
mplImported = True
|
||||
|
||||
wx.Frame.__init__(self, parent, title=u"pyfa: Graph Generator", style=style, size=(520, 390))
|
||||
wx.Frame.__init__(self, parent, title="pyfa: Graph Generator", style=style, size=(520, 390))
|
||||
|
||||
i = wx.IconFromBitmap(BitmapLoader.getBitmap("graphs_small", "gui"))
|
||||
self.SetIcon(i)
|
||||
@@ -179,7 +179,7 @@ class GraphFrame(wx.Frame):
|
||||
|
||||
def getValues(self):
|
||||
values = {}
|
||||
for fieldName, field in self.fields.iteritems():
|
||||
for fieldName, field in self.fields.items():
|
||||
values[fieldName] = field.GetValue()
|
||||
|
||||
return values
|
||||
@@ -193,14 +193,14 @@ class GraphFrame(wx.Frame):
|
||||
self.fields.clear()
|
||||
|
||||
# Setup textboxes
|
||||
for field, defaultVal in view.getFields().iteritems():
|
||||
for field, defaultVal in view.getFields().items():
|
||||
|
||||
textBox = wx.TextCtrl(self.gridPanel, wx.ID_ANY, style=0)
|
||||
self.fields[field] = textBox
|
||||
textBox.Bind(wx.EVT_TEXT, self.onFieldChanged)
|
||||
sizer.Add(textBox, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
|
||||
if defaultVal is not None:
|
||||
if not isinstance(defaultVal, basestring):
|
||||
if not isinstance(defaultVal, str):
|
||||
defaultVal = ("%f" % defaultVal).rstrip("0")
|
||||
if defaultVal[-1:] == ".":
|
||||
defaultVal += "0"
|
||||
@@ -248,8 +248,8 @@ class GraphFrame(wx.Frame):
|
||||
self.subplot.plot(x, y)
|
||||
legend.append(fit.name)
|
||||
except:
|
||||
pyfalog.warning(u"Invalid values in '{0}'", fit.name)
|
||||
self.SetStatusText(u"Invalid values in '%s'" % fit.name)
|
||||
pyfalog.warning("Invalid values in '{0}'", fit.name)
|
||||
self.SetStatusText("Invalid values in '%s'" % fit.name)
|
||||
self.canvas.draw()
|
||||
return
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class ItemStatsDialog(wx.Dialog):
|
||||
self.mainSizer.Add(self.container, 1, wx.EXPAND)
|
||||
|
||||
if "wxGTK" in wx.PlatformInfo:
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, u"Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
|
||||
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
|
||||
|
||||
@@ -294,19 +294,19 @@ class ItemParams(wx.Panel):
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, u" ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, " ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, u"Toggle view mode", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle view mode", wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, u"Export Item Stats", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, "Export Item Stats", wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
bSizer.Add(self.exportStatsBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
if stuff is not None:
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, u"Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
|
||||
|
||||
@@ -426,7 +426,7 @@ class ItemParams(wx.Panel):
|
||||
self.imageList = wx.ImageList(16, 16)
|
||||
self.paramList.SetImageList(self.imageList, wx.IMAGE_LIST_SMALL)
|
||||
|
||||
names = list(self.attrValues.iterkeys())
|
||||
names = list(self.attrValues.keys())
|
||||
names.sort()
|
||||
|
||||
idNameMap = {}
|
||||
@@ -463,7 +463,7 @@ class ItemParams(wx.Panel):
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("7_15", "icons"))
|
||||
|
||||
index = self.paramList.InsertImageStringItem(sys.maxint, attrName, attrIcon)
|
||||
index = self.paramList.InsertImageStringItem(sys.maxsize, attrName, attrIcon)
|
||||
idNameMap[idCount] = attrName
|
||||
self.paramList.SetItemData(index, idCount)
|
||||
idCount += 1
|
||||
@@ -510,7 +510,7 @@ class ItemParams(wx.Panel):
|
||||
"Inversed Modifier Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Modifier Percent" : (
|
||||
lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
|
||||
"Volume" : (lambda: value, u"m\u00B3"),
|
||||
"Volume" : (lambda: value, "m\u00B3"),
|
||||
"Sizeclass" : (lambda: value, ""),
|
||||
"Absolute Percent" : (lambda: (value * 100), unitName),
|
||||
"Milliseconds" : (lambda: value / 1000.0, unitName),
|
||||
@@ -524,7 +524,7 @@ class ItemParams(wx.Panel):
|
||||
v = override[0]()
|
||||
if isinstance(v, str):
|
||||
fvalue = v
|
||||
elif isinstance(v, (int, float, long)):
|
||||
elif isinstance(v, (int, float)):
|
||||
fvalue = formatAmount(v, 3, 0, 0)
|
||||
else:
|
||||
fvalue = v
|
||||
@@ -558,12 +558,12 @@ class ItemCompare(wx.Panel):
|
||||
|
||||
# get a dict of attrName: attrInfo of all unique attributes across all items
|
||||
for item in self.items:
|
||||
for attr in item.attributes.keys():
|
||||
for attr in list(item.attributes.keys()):
|
||||
if item.attributes[attr].info.displayName:
|
||||
self.attrs[attr] = item.attributes[attr].info
|
||||
|
||||
# Process attributes for items and find ones that differ
|
||||
for attr in self.attrs.keys():
|
||||
for attr in list(self.attrs.keys()):
|
||||
value = None
|
||||
|
||||
for item in self.items:
|
||||
@@ -588,14 +588,14 @@ class ItemCompare(wx.Panel):
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, u" ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, " ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, u"Toggle view mode", wx.DefaultPosition,
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle view mode", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, u"Refresh", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
|
||||
@@ -649,7 +649,7 @@ class ItemCompare(wx.Panel):
|
||||
try:
|
||||
# Remember to reduce by 1, because the attrs array
|
||||
# starts at 0 while the list has the item name as column 0.
|
||||
attr = str(self.attrs.keys()[sort - 1])
|
||||
attr = str(list(self.attrs.keys())[sort - 1])
|
||||
func = lambda _val: _val.attributes[attr].value if attr in _val.attributes else None
|
||||
except IndexError:
|
||||
# Clicked on a column that's not part of our array (price most likely)
|
||||
@@ -670,7 +670,7 @@ class ItemCompare(wx.Panel):
|
||||
self.paramList.SetColumnWidth(len(self.attrs) + 1, 60)
|
||||
|
||||
for item in self.items:
|
||||
i = self.paramList.InsertStringItem(sys.maxint, item.name)
|
||||
i = self.paramList.InsertStringItem(sys.maxsize, item.name)
|
||||
for x, attr in enumerate(self.attrs.keys()):
|
||||
if attr in item.attributes:
|
||||
info = self.attrs[attr]
|
||||
@@ -708,7 +708,7 @@ class ItemCompare(wx.Panel):
|
||||
"Inverse Absolute Percent" : (lambda: (1 - value) * 100, unitName),
|
||||
"Inversed Modifier Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Modifier Percent" : (lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
|
||||
"Volume" : (lambda: value, u"m\u00B3"),
|
||||
"Volume" : (lambda: value, "m\u00B3"),
|
||||
"Sizeclass" : (lambda: value, ""),
|
||||
"Absolute Percent" : (lambda: (value * 100), unitName),
|
||||
"Milliseconds" : (lambda: value / 1000.0, unitName),
|
||||
@@ -722,7 +722,7 @@ class ItemCompare(wx.Panel):
|
||||
v = override[0]()
|
||||
if isinstance(v, str):
|
||||
fvalue = v
|
||||
elif isinstance(v, (int, float, long)):
|
||||
elif isinstance(v, (int, float)):
|
||||
fvalue = formatAmount(v, 3, 0, 0)
|
||||
else:
|
||||
fvalue = v
|
||||
@@ -759,7 +759,7 @@ class ItemRequirements(wx.Panel):
|
||||
self.Layout()
|
||||
|
||||
def getFullSkillTree(self, parentSkill, parent, sbIconId):
|
||||
for skill, level in parentSkill.requiredSkills.iteritems():
|
||||
for skill, level in parentSkill.requiredSkills.items():
|
||||
child = self.reqTree.AppendItem(parent, "%s %s" % (skill.name, self.romanNb[int(level)]), sbIconId)
|
||||
if skill.ID not in self.skillIdHistory:
|
||||
self.getFullSkillTree(skill, child, sbIconId)
|
||||
@@ -794,7 +794,7 @@ class ItemDependents(wx.Panel):
|
||||
def getFullSkillTree(self, parentSkill, parent, sbIconId):
|
||||
levelToItems = {}
|
||||
|
||||
for item, level in parentSkill.requiredFor.iteritems():
|
||||
for item, level in parentSkill.requiredFor.items():
|
||||
if level not in levelToItems:
|
||||
levelToItems[level] = []
|
||||
levelToItems[level].append(item)
|
||||
@@ -853,11 +853,11 @@ class ItemEffects(wx.Panel):
|
||||
|
||||
item = self.item
|
||||
effects = item.effects
|
||||
names = list(effects.iterkeys())
|
||||
names = list(effects.keys())
|
||||
names.sort()
|
||||
|
||||
for name in names:
|
||||
index = self.effectList.InsertStringItem(sys.maxint, name)
|
||||
index = self.effectList.InsertStringItem(sys.maxsize, name)
|
||||
|
||||
if effects[name].isImplemented:
|
||||
if effects[name].activeByDefault:
|
||||
@@ -962,17 +962,17 @@ class ItemAffectedBy(wx.Panel):
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, u"Expand All", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, "Expand All", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleExpandBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, u"Toggle Names", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle Names", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleNameBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, u"Toggle View", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle View", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
if stuff is not None:
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, u"Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshTree)
|
||||
|
||||
@@ -995,7 +995,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
|
||||
stuff = self.affectedBy.GetPyData(item)
|
||||
# String is set as data when we are dealing with attributes, not stuff containers
|
||||
if stuff is None or isinstance(stuff, basestring):
|
||||
if stuff is None or isinstance(stuff, str):
|
||||
return
|
||||
contexts = []
|
||||
|
||||
@@ -1104,7 +1104,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
if attributes[attrName] == (attributes.getOriginal(attrName, 0)):
|
||||
continue
|
||||
|
||||
for fit, afflictors in attributes.getAfflictions(attrName).iteritems():
|
||||
for fit, afflictors in attributes.getAfflictions(attrName).items():
|
||||
for afflictor, modifier, amount, used in afflictors:
|
||||
|
||||
if not used or afflictor.item is None:
|
||||
@@ -1135,7 +1135,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
(type(afflictor), afflictor, item, modifier, amount, getattr(afflictor, "projected", False)))
|
||||
|
||||
# Make sure projected fits are on top
|
||||
rootOrder = container.keys()
|
||||
rootOrder = list(container.keys())
|
||||
rootOrder.sort(key=lambda x: self.ORDER.index(type(x)))
|
||||
|
||||
# Now, we take our created dictionary and start adding stuff to our tree
|
||||
@@ -1149,7 +1149,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
parent = child
|
||||
|
||||
attributes = container[thing]
|
||||
attrOrder = sorted(attributes.keys(), key=self.sortAttrDisplayName)
|
||||
attrOrder = sorted(list(attributes.keys()), key=self.sortAttrDisplayName)
|
||||
|
||||
for attrName in attrOrder:
|
||||
attrInfo = self.stuff.item.attributes.get(attrName)
|
||||
@@ -1233,7 +1233,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
if attributes[attrName] == (attributes.getOriginal(attrName, 0)):
|
||||
continue
|
||||
|
||||
for fit, afflictors in attributes.getAfflictions(attrName).iteritems():
|
||||
for fit, afflictors in attributes.getAfflictions(attrName).items():
|
||||
for afflictor, modifier, amount, used in afflictors:
|
||||
if not used or getattr(afflictor, 'item', None) is None:
|
||||
continue
|
||||
@@ -1269,7 +1269,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
info[2].append((attrName, modifier, amount))
|
||||
|
||||
# Make sure projected fits are on top
|
||||
rootOrder = container.keys()
|
||||
rootOrder = list(container.keys())
|
||||
rootOrder.sort(key=lambda x: self.ORDER.index(type(x)))
|
||||
|
||||
# Now, we take our created dictionary and start adding stuff to our tree
|
||||
@@ -1283,7 +1283,7 @@ class ItemAffectedBy(wx.Panel):
|
||||
parent = child
|
||||
|
||||
items = container[thing]
|
||||
order = items.keys()
|
||||
order = list(items.keys())
|
||||
order.sort(key=lambda x: (self.ORDER.index(items[x][0]), x))
|
||||
|
||||
for itemName in order:
|
||||
@@ -1387,7 +1387,7 @@ class ItemProperties(wx.Panel):
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, u" ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, " ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
|
||||
|
||||
mainSizer.Add(bSizer, 0, wx.ALIGN_RIGHT)
|
||||
@@ -1439,7 +1439,7 @@ class ItemProperties(wx.Panel):
|
||||
attrName = name.title()
|
||||
value = getattr(self.item, name)
|
||||
|
||||
index = self.paramList.InsertStringItem(sys.maxint, attrName)
|
||||
index = self.paramList.InsertStringItem(sys.maxsize, attrName)
|
||||
# index = self.paramList.InsertImageStringItem(sys.maxint, attrName)
|
||||
idNameMap[idCount] = attrName
|
||||
self.paramList.SetItemData(index, idCount)
|
||||
|
||||
@@ -93,7 +93,7 @@ try:
|
||||
from gui.propertyEditor import AttributeEditor
|
||||
except ImportError as e:
|
||||
AttributeEditor = None
|
||||
print("Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled." % e.message)
|
||||
print(("Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled." % e.message))
|
||||
disableOverrideEditor = True
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -413,7 +413,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
""" Export active fit """
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(self.getActiveFit())
|
||||
defaultFile = u"%s - %s.xml" % (fit.ship.item.name, fit.name) if fit else None
|
||||
defaultFile = "%s - %s.xml" % (fit.ship.item.name, fit.name) if fit else None
|
||||
|
||||
dlg = wx.FileDialog(self, "Save Fitting As...",
|
||||
wildcard="EVE XML fitting files (*.xml)|*.xml",
|
||||
@@ -427,7 +427,7 @@ class MainFrame(wx.Frame, IPortUser):
|
||||
if '.' not in os.path.basename(path):
|
||||
path += ".xml"
|
||||
else:
|
||||
print("oops, invalid fit format %d" % format_)
|
||||
print(("oops, invalid fit format %d" % format_))
|
||||
try:
|
||||
dlg.Destroy()
|
||||
except PyDeadObjectError:
|
||||
|
||||
@@ -65,7 +65,7 @@ class MarketBrowser(wx.Panel):
|
||||
vbox.Add(p, 0, wx.EXPAND)
|
||||
self.metaButtons = []
|
||||
btn = None
|
||||
for name in self.sMkt.META_MAP.keys():
|
||||
for name in list(self.sMkt.META_MAP.keys()):
|
||||
btn = MetaButton(p, wx.ID_ANY, name.capitalize(), style=wx.BU_EXACTFIT)
|
||||
setattr(self, name, btn)
|
||||
box.Add(btn, 1, wx.ALIGN_CENTER)
|
||||
|
||||
@@ -51,7 +51,7 @@ class DmgPatternTextValidor(BaseValidator):
|
||||
return True
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox(u"{}".format(e), "Error")
|
||||
wx.MessageBox("{}".format(e), "Error")
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
|
||||
@@ -89,7 +89,7 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Damage Pattern Editor", size=wx.Size(400, 240))
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Damage Pattern Editor", size=wx.Size(400, 240))
|
||||
|
||||
self.block = False
|
||||
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
|
||||
@@ -128,7 +128,7 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
|
||||
# set text edit
|
||||
setattr(self, "%sEdit" % type_, IntCtrl(self, wx.ID_ANY, 0, wx.DefaultPosition, defSize))
|
||||
setattr(self, "%sPerc" % type_, wx.StaticText(self, wx.ID_ANY, u"0%"))
|
||||
setattr(self, "%sPerc" % type_, wx.StaticText(self, wx.ID_ANY, "0%"))
|
||||
editObj = getattr(self, "%sEdit" % type_)
|
||||
|
||||
dmgeditSizer.Add(bmp, 0, style, border)
|
||||
@@ -147,7 +147,7 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
footerSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
perSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, u"")
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, "")
|
||||
self.stNotice.Wrap(-1)
|
||||
perSizer.Add(self.stNotice, 0, wx.BOTTOM | wx.TOP | wx.LEFT, 5)
|
||||
|
||||
@@ -160,7 +160,7 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
mainSizer.Add(contentSizer, 1, wx.EXPAND, 0)
|
||||
|
||||
if "wxGTK" in wx.PlatformInfo:
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, u"Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
|
||||
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
|
||||
|
||||
@@ -200,7 +200,7 @@ class DmgPatternEditorDlg(wx.Dialog):
|
||||
return
|
||||
|
||||
p = self.entityEditor.getActiveEntity()
|
||||
total = sum(map(lambda attr: getattr(self, "%sEdit" % attr).GetValue(), self.DAMAGE_TYPES))
|
||||
total = sum([getattr(self, "%sEdit" % attr).GetValue() for attr in self.DAMAGE_TYPES])
|
||||
for type_ in self.DAMAGE_TYPES:
|
||||
editObj = getattr(self, "%sEdit" % type_)
|
||||
percObj = getattr(self, "%sPerc" % type_)
|
||||
|
||||
@@ -47,7 +47,7 @@ class PreferenceDialog(wx.Dialog):
|
||||
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
|
||||
self.btnOK = wx.Button(self, wx.ID_ANY, u"OK", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnOK = wx.Button(self, wx.ID_ANY, "OK", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnOK, 0, wx.ALL, 5)
|
||||
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
|
||||
self.SetSizer(mainSizer)
|
||||
|
||||
@@ -70,7 +70,7 @@ class AttributeEditor(wx.Frame):
|
||||
mainSizer.Add(leftPanel, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
rightSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.btnRemoveOverrides = wx.Button(panel, wx.ID_ANY, u"Remove Overides for Item", wx.DefaultPosition,
|
||||
self.btnRemoveOverrides = wx.Button(panel, wx.ID_ANY, "Remove Overides for Item", wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.pg = AttributeGrid(panel)
|
||||
rightSizer.Add(self.pg, 1, wx.ALL | wx.EXPAND, 5)
|
||||
@@ -126,7 +126,7 @@ class AttributeEditor(wx.Frame):
|
||||
with open(path, 'wb') as csvfile:
|
||||
writer = csv.writer(csvfile)
|
||||
for item in items:
|
||||
for key, override in item.overrides.iteritems():
|
||||
for key, override in item.overrides.items():
|
||||
writer.writerow([item.ID, override.attrID, override.value])
|
||||
|
||||
def OnClear(self, event):
|
||||
@@ -145,7 +145,7 @@ class AttributeEditor(wx.Frame):
|
||||
# them due to the eve/user database disconnect. We must loop through
|
||||
# all items that have overrides and remove them
|
||||
for item in items:
|
||||
for _, x in item.overrides.items():
|
||||
for _, x in list(item.overrides.items()):
|
||||
item.deleteOverride(x.attr)
|
||||
self.itemView.updateItems(True)
|
||||
self.pg.Clear()
|
||||
@@ -247,7 +247,7 @@ class AttributeGrid(wxpg.PropertyGrid):
|
||||
if self.item is None:
|
||||
return
|
||||
|
||||
for x in self.item.overrides.values():
|
||||
for x in list(self.item.overrides.values()):
|
||||
self.item.deleteOverride(x.attr)
|
||||
self.itemView.updateItems(True)
|
||||
self.ClearModifiedStatus()
|
||||
|
||||
@@ -74,7 +74,7 @@ class TogglePanel(wx.Panel):
|
||||
|
||||
hbmpSizer.Add(self.headerBmp, 0, 0, 5)
|
||||
|
||||
self.headerLabel = wx.StaticText(self.headerPanel, wx.ID_ANY, u"PYFA", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.headerLabel = wx.StaticText(self.headerPanel, wx.ID_ANY, "PYFA", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
hlblSizer.Add(self.headerLabel, 0, wx.EXPAND, 5)
|
||||
|
||||
headerSizer.Add(hbmpSizer, 0, wx.RIGHT, 5)
|
||||
|
||||
@@ -379,7 +379,7 @@ class PyGauge(wx.PyWindow):
|
||||
r.left += 1
|
||||
r.top += 1
|
||||
if self._range == 0.01 and self._value > 0:
|
||||
formatStr = u'\u221e'
|
||||
formatStr = '\u221e'
|
||||
dc.SetTextForeground(wx.Colour(80, 80, 80))
|
||||
dc.DrawLabel(formatStr, r, wx.ALIGN_CENTER)
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class TargetResistsTextValidor(BaseValidator):
|
||||
return True
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox(u"{}".format(e), "Error")
|
||||
wx.MessageBox("{}".format(e), "Error")
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
|
||||
@@ -87,7 +87,7 @@ class ResistsEditorDlg(wx.Dialog):
|
||||
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Target Resists Editor", size=wx.Size(350, 240))
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Target Resists Editor", size=wx.Size(350, 240))
|
||||
|
||||
self.block = False
|
||||
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
|
||||
@@ -124,7 +124,7 @@ class ResistsEditorDlg(wx.Dialog):
|
||||
setattr(self, "%sEdit" % type_, wx.TextCtrl(self, wx.ID_ANY, "", wx.DefaultPosition, defSize))
|
||||
editObj = getattr(self, "%sEdit" % type_)
|
||||
resistEditSizer.Add(editObj, 0, wx.BOTTOM | wx.TOP | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
resistEditSizer.Add(wx.StaticText(self, wx.ID_ANY, u"%", wx.DefaultPosition, wx.DefaultSize, 0), 0,
|
||||
resistEditSizer.Add(wx.StaticText(self, wx.ID_ANY, "%", wx.DefaultPosition, wx.DefaultSize, 0), 0,
|
||||
wx.BOTTOM | wx.TOP | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
editObj.Bind(wx.EVT_TEXT, self.ValuesUpdated)
|
||||
|
||||
@@ -138,7 +138,7 @@ class ResistsEditorDlg(wx.Dialog):
|
||||
footerSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
perSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, u"")
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, "")
|
||||
self.stNotice.Wrap(-1)
|
||||
perSizer.Add(self.stNotice, 0, wx.BOTTOM | wx.TOP | wx.LEFT, 5)
|
||||
|
||||
@@ -151,7 +151,7 @@ class ResistsEditorDlg(wx.Dialog):
|
||||
mainSizer.Add(contentSizer, 1, wx.EXPAND, 0)
|
||||
|
||||
if "wxGTK" in wx.PlatformInfo:
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, u"Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
|
||||
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class ImplantTextValidor(BaseValidator):
|
||||
return True
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox(u"{}".format(e), "Error")
|
||||
wx.MessageBox("{}".format(e), "Error")
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
|
||||
@@ -114,7 +114,7 @@ class ImplantSetEditor(BaseImplantEditorView):
|
||||
|
||||
class ImplantSetEditorDlg(wx.Dialog):
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Implant Set Editor", size=wx.Size(640, 600))
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Implant Set Editor", size=wx.Size(640, 600))
|
||||
|
||||
self.block = False
|
||||
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
|
||||
@@ -135,12 +135,12 @@ class ImplantSetEditorDlg(wx.Dialog):
|
||||
|
||||
footerSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, u"")
|
||||
self.stNotice = wx.StaticText(self, wx.ID_ANY, "")
|
||||
self.stNotice.Wrap(-1)
|
||||
footerSizer.Add(self.stNotice, 1, wx.BOTTOM | wx.TOP | wx.LEFT, 5)
|
||||
|
||||
if "wxGTK" in wx.PlatformInfo:
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, u"Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.closeBtn = wx.Button(self, wx.ID_ANY, "Close", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.closeBtn, 0, wx.ALL | wx.ALIGN_RIGHT, 5)
|
||||
self.closeBtn.Bind(wx.EVT_BUTTON, self.closeEvent)
|
||||
|
||||
|
||||
@@ -214,12 +214,12 @@ class ShipBrowser(wx.Panel):
|
||||
if ship.race not in racesList:
|
||||
racesList.append(ship.race)
|
||||
|
||||
for race, state in self.racesFilter.iteritems():
|
||||
for race, state in self.racesFilter.items():
|
||||
if race in racesList:
|
||||
subRacesFilter[race] = self.racesFilter[race]
|
||||
|
||||
override = True
|
||||
for race, state in subRacesFilter.iteritems():
|
||||
for race, state in subRacesFilter.items():
|
||||
if state:
|
||||
override = False
|
||||
break
|
||||
@@ -382,7 +382,7 @@ class ShipBrowser(wx.Panel):
|
||||
|
||||
self.lpane.AddWidget(FitItem(self.lpane, ID, (shipName, shipTrait, name, booster, timestamp, notes), shipID))
|
||||
if len(ships) == 0 and len(fitList) == 0:
|
||||
self.lpane.AddWidget(PFStaticText(self.lpane, label=u"No matching results."))
|
||||
self.lpane.AddWidget(PFStaticText(self.lpane, label="No matching results."))
|
||||
self.lpane.RefreshList(doFocus=False)
|
||||
self.lpane.Thaw()
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class exportHtmlThread(threading.Thread):
|
||||
FILE.write(HTML.encode('utf-8'))
|
||||
FILE.close()
|
||||
except IOError:
|
||||
print("Failed to write to " + settings.getPath())
|
||||
print(("Failed to write to " + settings.getPath()))
|
||||
pass
|
||||
|
||||
if self.callback:
|
||||
@@ -222,7 +222,7 @@ class exportHtmlThread(threading.Thread):
|
||||
return
|
||||
try:
|
||||
dnaFit = Port.exportDna(getFit(fit[0]))
|
||||
print dnaFit
|
||||
print(dnaFit)
|
||||
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[
|
||||
1] + '</a></li>\n'
|
||||
except:
|
||||
|
||||
@@ -410,7 +410,7 @@ class FloatSpin(wx.PyControl):
|
||||
height = best_size.GetHeight()
|
||||
|
||||
self._validkeycode = [43, 44, 45, 46, 69, 101, 127, 314]
|
||||
self._validkeycode.extend(range(48, 58))
|
||||
self._validkeycode.extend(list(range(48, 58)))
|
||||
self._validkeycode.extend([wx.WXK_RETURN, wx.WXK_TAB, wx.WXK_BACK,
|
||||
wx.WXK_LEFT, wx.WXK_RIGHT])
|
||||
|
||||
@@ -1282,8 +1282,8 @@ class FixedPoint(object):
|
||||
self.n = n
|
||||
return
|
||||
|
||||
if isinstance(value, type(42)) or isinstance(value, type(42L)):
|
||||
self.n = long(value) * _tento(p)
|
||||
if isinstance(value, type(42)) or isinstance(value, type(42)):
|
||||
self.n = int(value) * _tento(p)
|
||||
return
|
||||
|
||||
if isinstance(value, FixedPoint):
|
||||
@@ -1303,7 +1303,7 @@ class FixedPoint(object):
|
||||
# up all bits in 2 iterations for all known binary double-
|
||||
# precision formats, and small enough to fit in an int.
|
||||
CHUNK = 28
|
||||
top = 0L
|
||||
top = 0
|
||||
# invariant: |value| = (top + f) * 2**e exactly
|
||||
while f:
|
||||
f = math.ldexp(f, CHUNK)
|
||||
@@ -1321,7 +1321,7 @@ class FixedPoint(object):
|
||||
if e >= 0:
|
||||
n = top << e
|
||||
else:
|
||||
n = _roundquotient(top, 1L << -e)
|
||||
n = _roundquotient(top, 1 << -e)
|
||||
if value < 0:
|
||||
n = -n
|
||||
self.n = n
|
||||
@@ -1329,7 +1329,7 @@ class FixedPoint(object):
|
||||
|
||||
if isinstance(value, type(42 - 42j)):
|
||||
raise TypeError("can't convert complex to FixedPoint: " +
|
||||
`value`)
|
||||
repr(value))
|
||||
|
||||
# can we coerce to a float?
|
||||
yes = 1
|
||||
@@ -1344,14 +1344,14 @@ class FixedPoint(object):
|
||||
# similarly for long
|
||||
yes = 1
|
||||
try:
|
||||
aslong = long(value)
|
||||
aslong = int(value)
|
||||
except:
|
||||
yes = 0
|
||||
if yes:
|
||||
self.__init__(aslong, p)
|
||||
return
|
||||
|
||||
raise TypeError("can't convert to FixedPoint: " + `value`)
|
||||
raise TypeError("can't convert to FixedPoint: " + repr(value))
|
||||
|
||||
def get_precision(self):
|
||||
"""
|
||||
@@ -1378,9 +1378,9 @@ class FixedPoint(object):
|
||||
p = int(precision)
|
||||
except:
|
||||
raise TypeError("precision not convertable to int: " +
|
||||
`precision`)
|
||||
repr(precision))
|
||||
if p < 0:
|
||||
raise ValueError("precision must be >= 0: " + `precision`)
|
||||
raise ValueError("precision must be >= 0: " + repr(precision))
|
||||
|
||||
if p > self.p:
|
||||
self.n = self.n * _tento(p - self.p)
|
||||
@@ -1403,7 +1403,7 @@ class FixedPoint(object):
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
return "FixedPoint" + `(str(self), self.p)`
|
||||
return "FixedPoint" + repr((str(self), self.p))
|
||||
|
||||
def copy(self):
|
||||
""" Create a copy of the current :class:`FixedPoint`. """
|
||||
@@ -1434,7 +1434,7 @@ class FixedPoint(object):
|
||||
# a float, their hashes may differ. This is a teensy bit Bad.
|
||||
return hash(n) ^ hash(p)
|
||||
|
||||
def __nonzero__(self):
|
||||
def __bool__(self):
|
||||
return self.n != 0
|
||||
|
||||
def __neg__(self):
|
||||
@@ -1531,7 +1531,7 @@ class FixedPoint(object):
|
||||
|
||||
|
||||
"""
|
||||
return self - long(self)
|
||||
return self - int(self)
|
||||
|
||||
# return n, p s.t. self == n/10**p and n % 10 != 0
|
||||
def __reduce(self):
|
||||
@@ -1550,7 +1550,7 @@ def _tento(n, cache={}):
|
||||
try:
|
||||
return cache[n]
|
||||
except KeyError:
|
||||
answer = cache[n] = 10L ** n
|
||||
answer = cache[n] = 10 ** n
|
||||
return answer
|
||||
|
||||
|
||||
@@ -1632,7 +1632,7 @@ del re
|
||||
def _string2exact(s):
|
||||
m = _parser(s)
|
||||
if m is None:
|
||||
raise ValueError("can't parse as number: " + `s`)
|
||||
raise ValueError("can't parse as number: " + repr(s))
|
||||
|
||||
exp = m.group('exp')
|
||||
if exp is None:
|
||||
@@ -1651,7 +1651,7 @@ def _string2exact(s):
|
||||
assert intpart
|
||||
assert fracpart
|
||||
|
||||
i, f = long(intpart), long(fracpart)
|
||||
i, f = int(intpart), int(fracpart)
|
||||
nfrac = len(fracpart)
|
||||
i = i * _tento(nfrac) + f
|
||||
exp = exp - nfrac
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import wx
|
||||
|
||||
|
||||
def YesNoDialog(question=u'Are you sure you want to do this?', caption=u'Yes or no?'):
|
||||
def YesNoDialog(question='Are you sure you want to do this?', caption='Yes or no?'):
|
||||
dlg = wx.MessageDialog(None, question, caption, wx.YES_NO | wx.ICON_QUESTION)
|
||||
result = dlg.ShowModal() == wx.ID_YES
|
||||
dlg.Destroy()
|
||||
|
||||
@@ -5,5 +5,5 @@ def formatList(words):
|
||||
if len(words) == 1:
|
||||
return words[0]
|
||||
last = words[-1:][0]
|
||||
beginning = u", ".join(words[:-1])
|
||||
return u"{0} and {1}".format(beginning, last)
|
||||
beginning = ", ".join(words[:-1])
|
||||
return "{0} and {1}".format(beginning, last)
|
||||
|
||||
@@ -17,13 +17,13 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
|
||||
return ""
|
||||
# Define suffix maps
|
||||
posSuffixMap = {3: "k", 6: "M", 9: "B" if currency is True else "G"}
|
||||
negSuffixMap = {-6: u'\u03bc', -3: "m"}
|
||||
negSuffixMap = {-6: '\u03bc', -3: "m"}
|
||||
# Define tuple of the map keys
|
||||
# As we're going to go from the biggest order of abs(key), sort
|
||||
# them differently due to one set of values being negative
|
||||
# and other positive
|
||||
posOrders = tuple(sorted(posSuffixMap.iterkeys(), reverse=True))
|
||||
negOrders = tuple(sorted(negSuffixMap.iterkeys(), reverse=False))
|
||||
posOrders = tuple(sorted(iter(posSuffixMap.keys()), reverse=True))
|
||||
negOrders = tuple(sorted(iter(negSuffixMap.keys()), reverse=False))
|
||||
# Find the least abs(key)
|
||||
posLowest = min(posOrders)
|
||||
negHighest = max(negOrders)
|
||||
@@ -89,7 +89,7 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
|
||||
mantissa = roundToPrec(mantissa, prec)
|
||||
sign = "+" if forceSign is True and mantissa > 0 else ""
|
||||
# Round mantissa and add suffix
|
||||
result = u"{0}{1}{2}".format(sign, mantissa, suffix)
|
||||
result = "{0}{1}{2}".format(sign, mantissa, suffix)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user