diff --git a/TradeDangerous.pyproj b/TradeDangerous.pyproj index a737c181..5dbcfedd 100644 --- a/TradeDangerous.pyproj +++ b/TradeDangerous.pyproj @@ -13,7 +13,7 @@ Standard Python launcher - run -vv --ly 10.38 --empty 11.16 --cap 18 --jumps 6 --cr 131366 --from "aritimi" -s 3 + buildcache -f -i False @@ -32,23 +32,26 @@ + + + + - - - + + @@ -57,7 +60,6 @@ - @@ -71,22 +73,13 @@ - - - - - - - - - - + diff --git a/commands/__init__.py b/commands/__init__.py index cf572db6..64e87cc2 100644 --- a/commands/__init__.py +++ b/commands/__init__.py @@ -8,8 +8,8 @@ import pathlib import sys -import commands.exceptions -import commands.parsing +import commands.exceptions as exceptions +import commands.parsing as parsing import commands.buildcache_cmd import commands.buy_cmd @@ -38,7 +38,10 @@ class HelpAction(argparse.Action): because Python 3.4's argparse is ever-so subtly very broken. """ def __call__(self, parser, namespace, values, option_string=None): - raise exceptions.UsageError("TradeDangerous help", parser.format_help()) + raise exceptions.UsageError( + "TradeDangerous help", + parser.format_help() + ) def addArguments(group, options, required, topGroup=None): diff --git a/commands/export_cmd.py b/commands/export_cmd.py index 0b5365bd..e1bd07d4 100644 --- a/commands/export_cmd.py +++ b/commands/export_cmd.py @@ -1,5 +1,6 @@ from __future__ import absolute_import, with_statement, print_function, division, unicode_literals +from csvexport import exportTableToFile from commands.parsing import MutuallyExclusiveGroup, ParseArgument from commands.exceptions import CommandLineError from pathlib import Path @@ -64,11 +65,9 @@ # Perform query and populate result set def run(results, cmdenv, tdb): - from csvexport import exportTableToFile - # check database exists if not tdb.dbPath.is_file(): - raise CommandLineError("Database '{}' not found.".format(dbFilename)) + raise CommandLineError("Database '{}' not found.".format(tdb.dbPath)) # check export path exists if cmdenv.path: diff --git a/commands/run_cmd.py b/commands/run_cmd.py index 6c358e08..285adeb8 100644 --- a/commands/run_cmd.py +++ b/commands/run_cmd.py @@ -157,7 +157,7 @@ def note(self, str, addBreak=True): print("(i) {} (i){}".format(str, "\n" if addBreak else "")) - def run(self, route, credits): + def run(self, route, cr): tdb, mfd = self.tdb, self.mfd stations, hops, jumps = route.route, route.hops, route.jumps lastHopIdx = len(stations) - 1 @@ -207,7 +207,7 @@ def run(self, route, credits): gainCr += hop[1] if cmdenv.detail and gainCr > 0: self.note("GAINED: {:n}cr, CREDITS: {:n}cr".format( - gainCr, credits + gainCr)) + gainCr, cr + gainCr)) if hopNo < lastHopIdx: print("\n--------------------------------------\n") @@ -215,7 +215,7 @@ def run(self, route, credits): if mfd: mfd.display('FINISHED', "+{:n}cr".format(gainCr), - "={:n}cr".format(credits + gainCr)) + "={:n}cr".format(cr + gainCr)) mfd.attention(3) from time import sleep sleep(1.5) diff --git a/tradedb.py b/tradedb.py index 6d1b16c0..dd03a6a6 100644 --- a/tradedb.py +++ b/tradedb.py @@ -1395,6 +1395,7 @@ def loadDirectTrades(self, fromStation, toStation): self.cur.execute(stmt, [ fromStation.ID, toStation.ID ]) trading = [] + items = self.itemByID for ( itemID, srcPriceCr, profit, diff --git a/tradeexcept.py b/tradeexcept.py index 7e87a95b..3fbf5124 100644 --- a/tradeexcept.py +++ b/tradeexcept.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, with_statement, print_function, division, unicode_literals - class TradeException(Exception): """ Distinguishes runtime logical errors (such as no data for what you