Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/FSBLProcess.py   Products.BastionLedger(Download)
 
from Products.CMFCore.utils import getPackageName
from Products.CMFCore.DirectoryView import _dirreg, registerFileExtension, registerMetaType, \
     DirectoryView, DirectoryViewSurrogate, DirectoryRegistry, DirectoryInformation, \
     _generateKey, _findProductForPath
        (package, name) = _findProductForPath(_prefix, name)
 
    reg_key = _generateKey(package, name)
    info = _dirreg.getDirectoryInfo(reg_key)
    if info is None:

src/e/r/erp5-HEAD/product/ERP5/ERP5Site.py   erp5(Download)
  def addCMFDefaultDirectoryViews(self, p):
    """Semi-manually create DirectoryViews since CMFDefault 2.X no longer
    registers the "skins" directory, only its subdirectories, making it
    unusable with Products.CMFCore.DirectoryView.addDirectoryViews."""
    from Products.CMFCore.DirectoryView import createDirectoryView, _generateKey
    # get the layer directories actually present
    for cmfdefault_skin_layer in self.CMFDEFAULT_FOLDER_LIST:
      reg_key = _generateKey(Products.CMFDefault.__name__,
                             'skins/' + cmfdefault_skin_layer)
      createDirectoryView(ps, reg_key)

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/upgrade/to21.py   Products.CMFDefault(Download)
 
from Products.CMFCore.DirectoryView import _dirreg
from Products.CMFCore.DirectoryView import _generateKey
from Products.CMFCore.interfaces import IDirectoryView
from Products.CMFCore.utils import getToolByName
        product.append(dirparts[0])
        dirparts = dirparts[1:]
        possible_key = _generateKey('.'.join(product), '/'.join(dirparts))
        if possible_key in _dirreg._directories:
            return possible_key

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/tests/test_DirectoryView.py   Products.CMFCore(Download)
    def test__generateKey(self):
        from Products.CMFCore.DirectoryView import _generateKey
 
        key = _generateKey('Products.CMFCore', 'tests')
        self.assertEqual(key.split(':')[0], 'Products.CMFCore')
 
        subkey = _generateKey('Products.CMFCore', 'tests\foo')