Skip to content

Commit

Permalink
Use local styles directory by default. Refs: #2
Browse files Browse the repository at this point in the history
  • Loading branch information
spanezz committed Aug 8, 2020
1 parent 4f6a8af commit 3daa533
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arkimaps
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,14 @@ class LogCollector(logging.Handler):


def main():
default_styles = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "styles"))
if not os.path.isdir(default_styles):
default_styles = "/usr/share/magics/styles/ecmwf"

parser = argparse.ArgumentParser(description="Render model maps")
parser.add_argument("--verbose", "-v", action="store_true", help="verbose output")
parser.add_argument("--debug", action="store_true", help="debug output")

parser.add_argument("--styles", metavar="dir", action="store", default=default_styles, help="styles directory")
args = parser.parse_args()

# Setup logging
Expand All @@ -199,6 +203,9 @@ def main():
root_logger = logging.getLogger()
root_logger.addHandler(log_collector)

# Tell magics where it shuold take its default styles from
os.environ["MAGICS_STYLE_PATH"] = args.styles

with workdir() as root:
# Dispatch input products into a work directory
collector = Catalog(root)
Expand Down

0 comments on commit 3daa533

Please sign in to comment.