def check(path): if not fs.is_image_file(path): print >>sys.stderr, "Error: provide an _image_ file." sys.exit(1) # if fs.is_local_path(path) and not os.path.isfile(path): print >>sys.stderr, "Error: the input file doesn't exist." sys.exit(1)
def main(args): param = args[0] check(param) if fs.is_local_path(param): fname = os.path.abspath(param) else: fname = download(param) gnome.set_wallpaper(fname)
def test_is_local_path(self): assert fs.is_local_path(FILE) assert not fs.is_local_path('http://google.com')