peng3d/resource.py
def resourceNameToPath(self,name,ext=""):
        """
        Converts the given resource name to a file path.
        
        A resource path is of the format ``<app>:<cat1>.<cat2>.<name>`` where cat1 and cat2 can be repeated as often as desired.
        
        ``ext`` is the file extension to use, e.g. ``.png`` or similar.
        
        As an example, the resource name ``peng3d:some.category.foo`` with the extension ``.png`` results in the path ``<basepath>/assets/peng3d/some/category/foo.png``\ .
        
        This resource naming scheme is used by most other methods of this class.
        
        Note that it is currently not possible to define multiple base paths to search through.
        """
        nsplit = name.split(":")[1].split(".")
        return os.path.join(self.basepath,"assets",name.split(":")[0],*nsplit)+ext
def resourceNameToPath(self,name,ext=""):
        """
        Converts the given resource name to a file path.
        
        A resource path is of the format ``<app>:<cat1>.<cat2>.<name>`` where cat1 and cat2 can be repeated as often as desired.
        
        ``ext`` is the file extension to use, e.g. ``.png`` or similar.
        
        As an example, the resource name ``peng3d:some.category.foo`` with the extension ``.png`` results in the path ``<basepath>/assets/peng3d/some/category/foo.png``\ .
        
        This resource naming scheme is used by most other methods of this class.
        
        Note that it is currently not possible to define multiple base paths to search through.
        """
        nsplit = name.split(":")[1].split(".")
        return os.path.join(self.basepath,"assets",name.split(":")[0],*nsplit)+ext
def resourceNameToPath ( self , name , ext = "" ) : nsplit = name . split ( ":" ) [ 1 ] . split ( "." ) return os . path . join ( self . basepath , "assets" , name . split ( ":" ) [ 0 ] , * nsplit ) + ext
Converts the given resource name to a file path.
        
        A resource path is of the format ``<app>:<cat1>.<cat2>.<name>`` where cat1 and cat2 can be repeated as often as desired.
        
        ``ext`` is the file extension to use, e.g. ``.png`` or similar.
        
        As an example, the resource name ``peng3d:some.category.foo`` with the extension ``.png`` results in the path ``<basepath>/assets/peng3d/some/category/foo.png``\ .
        
        This resource naming scheme is used by most other methods of this class.
        
        Note that it is currently not possible to define multiple base paths to search through.
Converts the given resource name to a file path . A resource path is of the format <app > : <cat1 > . <cat2 > . <name > where cat1 and cat2 can be repeated as often as desired . ext is the file extension to use e . g . . png or similar . As an example the resource name peng3d : some . category . foo with the extension . png results in the path <basepath > / assets / peng3d / some / category / foo . png \ . This resource naming scheme is used by most other methods of this class . Note that it is currently not possible to define multiple base paths to search through .