From 2ae8ce2b2e3c51c59c0dca3ddd24b21097957a22 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 25 Dec 2018 12:53:08 -0200 Subject: Allow an alternative syntax --- licensecheck/serverdata.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/licensecheck/serverdata.py b/licensecheck/serverdata.py index 5ab9b7a..c60714d 100755 --- a/licensecheck/serverdata.py +++ b/licensecheck/serverdata.py @@ -9,6 +9,7 @@ # Initialize stuff import subprocess +import sys erp=[] # Clear previous NPC list @@ -17,24 +18,24 @@ try: except: pass +# Determine correct path +PATH="../../server-data/npc/" +if len(sys.argv) == 2: + PATH=sys.argv[1] + # Generate NPC list -subprocess.call("find ../../server-data/npc/ txt > npcs.txt", shell=True) +subprocess.call("find "+PATH+" txt > npcs.txt", shell=True) npcs=open("npcs.txt", "r") # Begin -print("Checking license info for NPCs (this excludes _npcs and mapflags)") +print("Checking license info for NPCs") +print("Source is at: "+PATH) for mpa in npcs: mp=mpa.replace('\n','') - # Skip files prefixed with _ or called mapflags + # Skip mapflags if "mapflag" in mp: continue - if "_import" in mp: - continue - if "_warps" in mp: - continue - if "_mobs" in mp: - continue # Skip bad files if not '.txt' in mp: continue -- cgit v1.2.3-60-g2f50