-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix for android volta.Phones -> phones
- Loading branch information
Timur Torubarov
committed
May 23, 2017
1 parent
c6c7617
commit 2eac568
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
import yaml | ||
import pandas as pd | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
import argparse | ||
parser = argparse.ArgumentParser(description='volta console post-loader') | ||
parser.add_argument('--debug', dest='debug', action='store_true', default=False) | ||
parser.add_argument('-c', '--config', dest='config') | ||
args = parser.parse_args() | ||
|
||
logging.basicConfig( | ||
level="DEBUG" if args.debug else "INFO", | ||
format='%(asctime)s [%(levelname)s] [Volta Post-loader] %(filename)s:%(lineno)d %(message)s') | ||
|
||
if not args.config: | ||
raise RuntimeError('Empty config') | ||
with open(args.config, 'r') as cfg: | ||
cfg_data = cfg.read() | ||
try: | ||
cfg_dict = yaml.safe_load(cfg_data) | ||
except: | ||
logger.debug('Config file format not yaml or json...', exc_info=True) | ||
raise RuntimeError('Unknown config file format. Malformed?') | ||
|