mirror of
https://github.com/YunoHost/yunodevtools.git
synced 2024-09-03 20:16:19 +02:00
[fix] Properly close apps list json file
This commit is contained in:
parent
b25ae1e3cf
commit
b5795709b0
1 changed files with 7 additions and 5 deletions
|
@ -1,13 +1,14 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import argparse
|
import sys
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
|
import argparse
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import datetime
|
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
|
|
||||||
|
|
||||||
# Create argument parser
|
# Create argument parser
|
||||||
parser = argparse.ArgumentParser(description='Process YunoHost application list.')
|
parser = argparse.ArgumentParser(description='Process YunoHost application list.')
|
||||||
|
|
||||||
|
@ -19,9 +20,10 @@ parser.add_argument("-g", "--github", help="Github token <username>:<password>")
|
||||||
# Parse args
|
# Parse args
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Open list json file
|
|
||||||
try:
|
try:
|
||||||
apps_list = json.load(open(args.input))
|
# Retrieve apps list from json file
|
||||||
|
with open(args.input) as f:
|
||||||
|
apps_list = json.load(f)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
print "Error: %s file not found" % args.input
|
print "Error: %s file not found" % args.input
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue