Some beauty fixes
This commit is contained in:
parent
8203e62359
commit
286d1018e0
|
@ -43,6 +43,11 @@ def list_spaces():
|
||||||
print('{}'.format(name))
|
print('{}'.format(name))
|
||||||
|
|
||||||
|
|
||||||
|
def details(data, verbose):
|
||||||
|
"""Show all details"""
|
||||||
|
print(json.dumps(data, indent=4, sort_keys=True))
|
||||||
|
|
||||||
|
|
||||||
def status(json, verbose):
|
def status(json, verbose):
|
||||||
"""Ermittelt aus dem Json den Status des Hackerspace"""
|
"""Ermittelt aus dem Json den Status des Hackerspace"""
|
||||||
if verbose is True:
|
if verbose is True:
|
||||||
|
@ -84,8 +89,9 @@ def getspaceurl(name, debug=False):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
debug = args.v
|
debug = True
|
||||||
else:
|
else:
|
||||||
debug = False
|
debug = False
|
||||||
|
|
||||||
|
@ -101,6 +107,11 @@ def main(args):
|
||||||
print('not connected')
|
print('not connected')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if args.details:
|
||||||
|
details(json, debug)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if args.web:
|
if args.web:
|
||||||
getHomepage(json, debug)
|
getHomepage(json, debug)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
@ -112,8 +123,9 @@ def main(args):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(description='Show Space Status')
|
parser = argparse.ArgumentParser(description='Show Space Status')
|
||||||
parser.add_argument('-n', '--name', help='Name of Hackerspace', default='LeineLab')
|
parser.add_argument('-n', '--name', help='Name of Hackerspace', default='LeineLab')
|
||||||
|
parser.add_argument('-d', '--details', help='Shows more details of Hackerspace', default='LeineLab')
|
||||||
parser.add_argument('-l', '--list', action='store_true', help='List all Hackspaces on Spaceapi')
|
parser.add_argument('-l', '--list', action='store_true', help='List all Hackspaces on Spaceapi')
|
||||||
parser.add_argument('-v', '--verbose', action='store_true', help='Show more Infos of Hackspace')
|
parser.add_argument('-v', '--verbose', action='store_true', help='verbose output')
|
||||||
parser.add_argument('-w', '--web', action='store_true', help='get homepage url')
|
parser.add_argument('-w', '--web', action='store_true', help='get homepage url')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue