예제 #1
0
def image_resources(pkg=None, dir='resources'):
    if pkg is None:
        pkg = modulecallee().__name__.split('.')[0]
    pkg_dir = '%s.%s' % (pkg, dir)
    images = []
    for i in resource_listdir(pkg, dir):
        fname = resource_filename(pkg_dir, i)
        if resource_isdir(pkg_dir, i):
            images.extend(image_resources(pkg_dir, i))
        elif what(fname) is not None:
            images.append(fname)
    return images
예제 #2
0
def external_resource(name, pkg=None):
    if pkg is None:
        pkg = '%s.resources.external' % modulecallee().__name__.split('.')[0]
    return resource_filename(pkg, name)
예제 #3
0
def icon_resource(name, pkg=None):
    if pkg is None:
        pkg = '%s.resources.images' % modulecallee().__name__.split('.')[0]
    return imageicon(pkg, name)
예제 #4
0
def image_resource(name, pkg=None):
    if pkg is None:
        pkg = "%s.resources.images" % modulecallee().__name__.split(".")[0]
    return imagepath(pkg, name)