validate:launcher: skip default media path for --media-paths option

when --media-paths is specified, then no need to check the default media.
And add Force argument to let testsuite force the inclusion of
default media directory.

https://bugzilla.gnome.org/show_bug.cgi?id=752461
This commit is contained in:
Vineeth T M 2015-07-16 20:27:11 +09:00 committed by Thibault Saunier
parent 89283ef3fe
commit 6c48e89aab

View file

@ -294,7 +294,10 @@ class LauncherConfig(Loggable):
self.http_server_dir = path
def add_paths(self, paths):
def add_paths(self, paths, force=False):
if force is False:
if self.paths:
return
if not isinstance(paths, list):
paths = [paths]
@ -302,7 +305,6 @@ class LauncherConfig(Loggable):
self.paths = paths
self._using_default_paths = False
else:
for path in paths:
if path not in self.paths:
self.paths.append(path)