コード例 #1
0
ファイル: test_fs.py プロジェクト: ThePenguin1140/jabbapylib
 def test_is_image_file(self):
     assert fs.is_image_file('/trash/well.jpg')
     assert fs.is_image_file('/trash/well.jpeg')
     assert fs.is_image_file('/trash/well.png')
     assert fs.is_image_file('/trash/well.gif')
     assert fs.is_image_file('/trash/well.JPG')
     assert fs.is_image_file('/trash/well.PNG')
     #
     assert not fs.is_image_file('/trash/well.txt')
     assert not fs.is_image_file('/trash/well.py')
     assert not fs.is_image_file('/trash/well.java')
コード例 #2
0
ファイル: test_fs.py プロジェクト: the7day/jabbapylib
 def test_is_image_file(self):
     assert fs.is_image_file('/trash/well.jpg')
     assert fs.is_image_file('/trash/well.jpeg')
     assert fs.is_image_file('/trash/well.png')
     assert fs.is_image_file('/trash/well.gif')
     assert fs.is_image_file('/trash/well.JPG')
     assert fs.is_image_file('/trash/well.PNG')
     #
     assert not fs.is_image_file('/trash/well.txt')
     assert not fs.is_image_file('/trash/well.py')
     assert not fs.is_image_file('/trash/well.java')
コード例 #3
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)
コード例 #4
0
ファイル: set_wallpaper.py プロジェクト: the7day/jabbapylib
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)