Skip to content

Commit

Permalink
Merge pull request #1597 from dassaniansh/checks
Browse files Browse the repository at this point in the history
Feature to check for already existing data packages
  • Loading branch information
henrykironde committed Jul 5, 2021
2 parents 1e027fa + 72a345b commit 6c59641
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ apidocs
scripts/*.pyc
.idea*
*_pycache_
.vscode/
16 changes: 16 additions & 0 deletions retriever/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ def main():
return

if args.command == 'autocreate':
if args.c:
url = args.path
script_list = SCRIPT_LIST()
flag = 0

for script in script_list:
for dataset in script.tables:
if script.tables[dataset].url == url:
flag = 1
break

if flag == 1:
print("File already exist in dataset " + str(script.name))
else:
print("Dataset is not avaliable, Please download")
return
if sum([args.f, args.d]) == 1:
file_flag = bool(args.f)
create_package(args.path, args.dt, file_flag, args.o, args.skip_lines,
Expand Down
1 change: 1 addition & 0 deletions retriever/lib/get_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
help='write scripts out to a designated directory',
nargs='?',
const='')
autocreate_parser.add_argument('-c', help='turn files into scripts', action='store_true')
autocreate_parser.add_argument('--skip-lines',
help='skip a set number of lines before processing data',
nargs=1,
Expand Down

0 comments on commit 6c59641

Please sign in to comment.