Check library sources before adding

New sources should:
  1) Be a string
  2) Not already be a tracked source
This commit is contained in:
Bryan Schumaker 2010-12-01 22:00:58 -05:00
parent 86494f7f7f
commit 8a0baf6693
1 changed files with 4 additions and 1 deletions

View File

@ -211,7 +211,10 @@ def is_visible(id):
def add_source(path):
global sources
sources.append(path)
if path.__class__ == unicode:
path = str(path)
if path not in sources:
sources.append(path)
def scan(path):
add_source(path)