From 9a8642e7893d12a0cc8ae24731bb7d7d8c288643 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sat, 29 Nov 2014 20:57:44 -0500 Subject: [PATCH] Fix more paths --- scripts/effectUsedBy.py | 6 +++--- scripts/findNonMarket.py | 2 +- scripts/itemDiff.py | 4 ++-- scripts/jsonToSql.py | 2 +- scripts/prep_data.py | 9 +++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/effectUsedBy.py b/scripts/effectUsedBy.py index 65c1e76b1..ad949af9e 100755 --- a/scripts/effectUsedBy.py +++ b/scripts/effectUsedBy.py @@ -60,13 +60,13 @@ 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") +effects_path = os.path.join(script_dir, "..", "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 to eve database file included in pyfa (../pyfa/staticdata/eve.db)", - type="string", default=os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db")) + sqlite format, default to eve database file included in pyfa (../staticdata/eve.db)", + type="string", default=os.path.join(script_dir, "..", "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 \ diff --git a/scripts/findNonMarket.py b/scripts/findNonMarket.py index aaa2c3fae..83d5f328e 100755 --- a/scripts/findNonMarket.py +++ b/scripts/findNonMarket.py @@ -8,7 +8,7 @@ import sqlite3 script_dir = os.path.dirname(unicode(__file__, sys.getfilesystemencoding())) # Connect to database and set up cursor -db = sqlite3.connect(os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db")) +db = sqlite3.connect(os.path.join(script_dir, "..", "staticdata", "eve.db")) cursor = db.cursor() # Queries to get raw data diff --git a/scripts/itemDiff.py b/scripts/itemDiff.py index f81f144d5..b1877897c 100755 --- a/scripts/itemDiff.py +++ b/scripts/itemDiff.py @@ -32,7 +32,7 @@ import sqlite3 import sys script_dir = os.path.dirname(__file__) -default_old = os.path.join(script_dir, "..", "pyfa", "staticdata", "eve.db") +default_old = os.path.join(script_dir, "..", "staticdata", "eve.db") def main(old, new, groups=True, effects=True, attributes=True, renames=True): # Open both databases and get their cursors @@ -50,7 +50,7 @@ def main(old, new, groups=True, effects=True, attributes=True, renames=True): # Initialization of few things used by both changed/renamed effects list script_dir = os.path.dirname(__file__) - effectspath = os.path.join(script_dir, "..", "pyfa", "eos", "effects") + effectspath = os.path.join(script_dir, "..", "eos", "effects") implemented = set() for filename in os.listdir(effectspath): diff --git a/scripts/jsonToSql.py b/scripts/jsonToSql.py index aebb58985..5c861e522 100755 --- a/scripts/jsonToSql.py +++ b/scripts/jsonToSql.py @@ -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, "..", "pyfa"))) +sys.path.append(os.path.realpath(os.path.join(path, ".."))) import json import argparse diff --git a/scripts/prep_data.py b/scripts/prep_data.py index 92f4d557c..e13415a74 100644 --- a/scripts/prep_data.py +++ b/scripts/prep_data.py @@ -6,15 +6,13 @@ import os # Phobos location phb_path = os.path.expanduser("path/to/phobos") -### Append Phobos to path -sys.path.append(os.path.realpath(phb_path)) - import argparse parser = argparse.ArgumentParser() parser.add_argument("-e", "--eve", dest="eve_path", help="Location of EVE directory", required=True) parser.add_argument("-c", "--cache", dest="cache_path", help="Location of EVE cache directory. If not specified, an attempt will be make to automatically determine path.") parser.add_argument("-d", "--dump", dest="dump_path", help="Location of Phobos JSON dump directory", required=True) +parser.add_argument("-p", "--phobos", dest="phb_path", help="Location of Phobos, defaults to path noted in script", default=phb_path) parser.add_argument("-s", "--singularity", action="store_true", help="Singularity build") parser.add_argument("-j", "--nojson", dest="nojson", action="store_true", help="Skip Phobos JSON data dump.") @@ -24,6 +22,9 @@ cache_path = os.path.expanduser(unicode(args.cache_path, sys.getfilesystemencodi dump_path = os.path.expanduser(unicode(args.dump_path, sys.getfilesystemencoding())) script_path = os.path.dirname(unicode(__file__, sys.getfilesystemencoding())) +### Append Phobos to path +sys.path.append(os.path.expanduser(unicode(args.phb_path, sys.getfilesystemencoding()))) + def header(text, subtext=None): print print "* "*30 @@ -82,7 +83,7 @@ jsonToSql.main("sqlite:///"+db_file, dump_path) ### Diff generation import itemDiff diff_file = os.path.join(dump_path, "diff.txt") -old_db = os.path.join(script_path, "..", "pyfa", "staticdata", "eve.db") +old_db = os.path.join(script_path, "..", "staticdata", "eve.db") header("Generating DIFF", diff_file) old_stdout = sys.stdout