def DefaultContainerPathForOwner(self, module):
     """Overrides the default."""
     if module.owner_domain == 'google.com':
         if ((self._options and self._options.get('google_api'))
                 or not module.package_path):
             return 'com/google/api/services'
     return '/'.join(utilities.ReversedDomainComponents(
         module.owner_domain))
Пример #2
0
    def DefaultContainerPathForOwner(self, module):
        """Computes the default path to a module for the given owner information.

    For a given module, compute the portions of the path which are determined
    by the owner of the module - excluding the module path itself.

    Subclasses almost certainly want to override this.

    Args:
      module: (template_objects.Module) The module.
    Returns:
      (str) The path to use for the namespace of this API.
    """
        return '/'.join(utilities.ReversedDomainComponents(
            module.owner_domain))
Пример #3
0
 def DefaultContainerPathForOwner(self, module):
     return '/'.join(utilities.ReversedDomainComponents(
         module.owner_domain))
Пример #4
0
 def testReversedDomainComponents(self):
     self.assertEquals([], utilities.ReversedDomainComponents(''))
     self.assertEquals(['com', 'google'],
                       utilities.ReversedDomainComponents('google.com'))
Пример #5
0
 def DefaultContainerPathForOwner(self, module):
     """Overrides the default implementation."""
     return '%s/api/gwt/services' % '/'.join(
         utilities.ReversedDomainComponents(module.owner_domain))