Skip to content

Commit

Permalink
Cab now remove old filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Podshot committed May 8, 2014
1 parent 435561e commit e613541
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Update Filters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import glob, urllib2, urllib, json
import glob, urllib2, urllib, json, os

displayName = "Update Filters"

inputs = (
("Remove Old Filters?", True),
)

def perform(level, box, options):
doRemove = options["Remove Old Filters?"]
filters = glob.glob("filters/*.py")
for filt in filters:
py = __import__(filt)
Expand All @@ -13,4 +18,6 @@ def perform(level, box, options):
jsonRaw = json.loads(response)
if filterVersion != str(jsonRaw["Version"]):
urllib.urlretrieve(str(jsonRaw["Download-Url"]), str(jsonRaw["Name"]))
if doRemove:
os.remove(filt)

0 comments on commit e613541

Please sign in to comment.