示例#1
0
def get_img():
    img_file = "/tmp/.images.yml"
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
示例#2
0
文件: ncurses.py 项目: sdmoko/neo-cli
def get_img():
    # utils.log_info("Get images data...")
    img_file = "/tmp/.images.yml"
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
示例#3
0
def get_img():
    temp = utils.tmp_dir()
    img_file = os.path.join(temp, "images.yml")
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
示例#4
0
 def test_get_list(self, monkeypatch):
     monkeypatch.setattr(neo.libs.image, "get_image_client",
                         self.fake_client_list_images)
     assert image.get_list("fake_session") == ["fake_img1", "fake_img2"]