@@ -317,27 +317,30 @@ def version():
317317
318318# Usage function
319319def usage ():
320- __runningfile__ = os .path .basename (__file__ )
321- print "Usage for Plex Remote Transcoder (prt)"
322- print "%s [options]\n " % (__runningfile__ )
323- print "Options:\n " \
324- "usage, help, -h, ?\t shows usage page\n " \
325- "get_load\t \t shows the load of the system\n " \
326- "install\t \t \t installs PRT for the first time and then sets up configuration\n " \
327- "overwrite\t \t fixes PRT after PMS has had a version update breaking PRT\n " \
328- "add_host\t \t adds an extra host to the list of slaves PRT is to use\n " \
329- "remove_host\t \t removes a host from the list of slaces PRT is to use\n "
320+ version ()
321+ print "Plex Remote Transcode comes with ABSOLUTELY NO WARRANTY.\n \n " \
322+ "This is free software, and you are welcome to redistribute it and/or modify\n " \
323+ "it under the terms of the MIT License.\n \n "
324+ print "Usage:\n "
325+ print " %s [options]\n " % os .path .basename (sys .argv [0 ])
326+ print "Options:\n \n " \
327+ " usage, help, -h, ? Show usage page\n " \
328+ " get_load Show the load of the system\n " \
329+ " install Install PRT for the first time and then sets up configuration\n " \
330+ " overwrite Fix PRT after PMS has had a version update breaking PRT\n " \
331+ " add_host Add an extra host to the list of slaves PRT is to use\n " \
332+ " remove_host Removes a host from the list of slaves PRT is to use\n "
330333
331334
332335def main ():
333336 # Specific usage options
334- if any ( [ len (sys .argv ) < 2 , sys .argv [1 ] == "usage" , sys .argv [1 ] == "help" , sys .argv [1 ] == "-h" ,
335- sys .argv [1 ] == "?" ,] ):
337+ if len (sys .argv ) < 2 or any (( sys .argv [1 ] == "usage" , sys .argv [1 ] == "help" , sys .argv [1 ] == "-h" ,
338+ sys .argv [1 ] == "?" ,) ):
336339 usage ()
337340 sys .exit (- 1 )
338341
339- # TODO: get_load_all to show load currently across all nodes
340- # TODO: show_hosts_status to show current status across all nodes
342+ # TODO: get_load_all to show load currently across all nodes
343+ # TODO: show_hosts_status to show current status across all nodes
341344
342345 if sys .argv [1 ] == "get_load" :
343346 print " " .join ([str (i ) for i in get_system_load_local ()])
0 commit comments