Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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)
Esempio n. 4
0
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)
Esempio n. 5
0
 def test_is_local_path(self):
     assert fs.is_local_path(FILE)
     assert not fs.is_local_path('http://google.com')
Esempio n. 6
0
 def test_is_local_path(self):
     assert fs.is_local_path(FILE)
     assert not fs.is_local_path('http://google.com')