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
def external_resource(name, pkg=None): if pkg is None: pkg = '%s.resources.external' % modulecallee().__name__.split('.')[0] return resource_filename(pkg, name)
def icon_resource(name, pkg=None): if pkg is None: pkg = '%s.resources.images' % modulecallee().__name__.split('.')[0] return imageicon(pkg, name)
def image_resource(name, pkg=None): if pkg is None: pkg = "%s.resources.images" % modulecallee().__name__.split(".")[0] return imagepath(pkg, name)