Changed: No output if space is closed and verbose if false
This commit is contained in:
parent
16a73b5949
commit
d5bcc27608
|
@ -55,6 +55,7 @@ def status(json_data, verbose):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if json_data['state']['open'] is False:
|
if json_data['state']['open'] is False:
|
||||||
|
if verbose:
|
||||||
print('{} is closed'.format(str(json_data['space'])))
|
print('{} is closed'.format(str(json_data['space'])))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -115,17 +116,22 @@ def main(args):
|
||||||
getHomepage(data, debug)
|
getHomepage(data, debug)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if status(data, verbose=False):
|
if status(data, debug):
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
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',
|
||||||
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('-d', '--details',
|
||||||
parser.add_argument('-v', '--verbose', action='store_true', help='verbose output')
|
help='Shows more details of Hackerspace')
|
||||||
parser.add_argument('-w', '--web', action='store_true', help='get homepage url')
|
parser.add_argument('-l', '--list', action='store_true',
|
||||||
|
help='List all Hackspaces on Spaceapi')
|
||||||
|
parser.add_argument('-v', '--verbose', action='store_true',
|
||||||
|
help='verbose output')
|
||||||
|
parser.add_argument('-w', '--web', action='store_true',
|
||||||
|
help='get homepage url')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
main(args)
|
main(args)
|
||||||
|
|
Loading…
Reference in New Issue