Fix paths

This commit is contained in:
blitzmann
2014-11-29 20:49:10 -05:00
parent 7836506444
commit ee8395e8fd
4 changed files with 17 additions and 9 deletions

View File

@@ -57,11 +57,16 @@ import re
import sqlite3
from optparse import OptionParser
script_dir = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
# Form list of effects for processing
effects_path = os.path.join(script_dir, "..", "pyfa", "eos", "effects")
usage = "usage: %prog --database=DB [--debug=DEBUG]"
parser = OptionParser(usage=usage)
parser.add_option("-d", "--database", help="path to eve cache data dump in \
sqlite format, default pyfa database path is used if none specified",
type="string", default=os.path.join("~", ".pyfa","eve.db"))
sqlite format, default to eve database file included in pyfa (../pyfa/staticdata/eve.db)",
type="string", default=os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db"))
parser.add_option("-e", "--effects", help="explicit comma-separated list of \
effects to process", type="string", default="")
parser.add_option("-r", "--remove", help="remove effect files that are not \
@@ -379,8 +384,6 @@ for typeid in publishedtypes:
(set(), len(typenamesplitted))
globalmap_typeid_typenamecombtuple[typeid][0].add(typenamecomb)
# Form list of effects for processing
effects_path = os.path.join("..", "..", "effects")
if options.effects:
effect_list = options.effects.split(",")
else:

View File

@@ -5,8 +5,10 @@ import os.path
import re
import sqlite3
script_dir = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
# Connect to database and set up cursor
db = sqlite3.connect(os.path.join("..", "..", "..", "staticdata", "eve.db"))
db = sqlite3.connect(os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db"))
cursor = db.cursor()
# Queries to get raw data

View File

@@ -30,8 +30,10 @@ import os.path
import re
import sqlite3
script_dir = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
parser = argparse.ArgumentParser(description="Compare two databases generated from eve dump to find eos-related differences")
parser.add_argument("-o", "--old", type=str, required=True, help="path to old cache data dump")
parser.add_argument("-o", "--old", type=str, help="path to old cache data dump, defaults to current pyfa eve.db", default=os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db"))
parser.add_argument("-n", "--new", type=str, required=True, help="path to new cache data dump")
parser.add_argument("-g", "--nogroups", action="store_false", default=True, dest="groups", help="don't show changed groups")
parser.add_argument("-e", "--noeffects", action="store_false", default=True, dest="effects", help="don't show list of changed effects")
@@ -53,7 +55,8 @@ for typename in FORCEPUB_TYPES:
new_cursor.execute(OVERRIDES_TYPEPUB, (typename,))
# Initialization of few things used by both changed/renamed effects list
effectspath = os.path.join("..", "..", "effects")
script_dir = os.path.dirname(__file__)
effectspath = os.path.join(script_dir, "..", "pyfa", "eos", "effects")
implemented = set()
for filename in os.listdir(effectspath):

View File

@@ -23,7 +23,7 @@ import sys
# Add eos root path to sys.path so we can import ourselves
path = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
sys.path.append(os.path.realpath(os.path.join(path, "..", "..", "..")))
sys.path.append(os.path.realpath(os.path.join(path, "..", "pyfa")))
import json
import argparse
@@ -31,7 +31,7 @@ import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="This scripts dumps effects from an sqlite cache dump to mongo")
parser.add_argument("-d", "--db", required=True, type=str, help="The sqlalchemy connectionstring, example: sqlite:///c:/tq.db")
parser.add_argument("-j", "--json", required=True, type=str, help="The path to the json dum")
parser.add_argument("-j", "--json", required=True, type=str, help="The path to the json dump")
args = parser.parse_args()
jsonPath = os.path.expanduser(args.json)