コード例 #1
0
def packagedin(abspath):
    """Return the package name that contains the asset `abspath`."""
    from pluggdapps import papackages  # Keep this line, don't shuffle around !!

    locations = {pinfo['location']: p for p, pinfo in papackages.items()}
    prefix = longest_prefix(locations.keys(), abspath)
    return locations[prefix] if prefix else None
コード例 #2
0
ファイル: asset.py プロジェクト: prataprc/pluggdapps
def packagedin( abspath ):
    """Return the package name that contains the asset `abspath`."""
    from pluggdapps import papackages # Keep this line, don't shuffle around !!

    locations = { pinfo['location'] : p for p, pinfo in papackages.items() }
    prefix = longest_prefix( locations.keys(), abspath )
    return locations[prefix] if prefix else None
コード例 #3
0
ファイル: serve.py プロジェクト: prataprc/pluggdapps
 def ttlfiles( self ):
     """Return a list of ttlfile related to this environment."""
     from pluggdapps import papackages
     ttlfiles = h.flatten(
         [ list( map( h.abspath_from_asset_spec, n.get('ttlplugins', []) ))
           for nm, n in papackages.items() ]
     )
     return ttlfiles + self.pa._monitoredfiles
コード例 #4
0
 def ttlfiles(self):
     """Return a list of ttlfile related to this environment."""
     from pluggdapps import papackages
     ttlfiles = h.flatten([
         list(map(h.abspath_from_asset_spec, n.get('ttlplugins', [])))
         for nm, n in papackages.items()
     ])
     return ttlfiles + self.pa._monitoredfiles