~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugin.py

  • Committer: Andrew Bennetts
  • Date: 2011-05-31 06:15:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5949.
  • Revision ID: andrew.bennetts@canonical.com-20110531061524-uvc0a9i1gse5mg45
Take a slightly more direct approach by largely preserving BZR_DISABLE_PLUGINS/BZR_PLUGINS_AT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
535
535
        self.name = name
536
536
        self.module = module
537
537
 
538
 
    def path(self, default_to_None=False):
539
 
        """Get the path that this plugin was loaded from.
540
 
        
541
 
        :param default_to_None: if True, return None if the path could not be
542
 
            determined.  Otherwise the repr of the module is used in that case.
543
 
        """
 
538
    def path(self):
 
539
        """Get the path that this plugin was loaded from."""
544
540
        if getattr(self.module, '__path__', None) is not None:
545
541
            return os.path.abspath(self.module.__path__[0])
546
542
        elif getattr(self.module, '__file__', None) is not None:
551
547
                    path = pypath
552
548
            return path
553
549
        else:
554
 
            if default_to_None:
555
 
                return None
556
 
            else:
557
 
                return repr(self.module)
 
550
            return repr(self.module)
558
551
 
559
552
    def __str__(self):
560
553
        return "<%s.%s object at %s, name=%s, module=%s>" % (