Skip to content

Commit

Permalink
Missing import command
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Nov 22, 2014
1 parent 7853779 commit c589c37
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions commands/import_cmd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from __future__ import absolute_import, with_statement, print_function, division, unicode_literals
from commands.parsing import MutuallyExclusiveGroup, ParseArgument
from commands.exceptions import *
import math

import cache
from pathlib import Path

######################################################################
# Parser config

help=(
"Imports price data from a '.prices' format file "
"without affecting data for stations not included "
"in the import file."
)
name='import'
epilog=None
wantsTradeDB=True
arguments = [
ParseArgument('filename', help='Name of the file to read.', type=str),
]
switches = [
]

######################################################################
# Perform query and populate result set

def run(results, cmdenv, tdb):
filePath = Path(cmdenv.filename)
cache.importDataFromFile(tdb, cmdenv, filePath)
return None

0 comments on commit c589c37

Please sign in to comment.