~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-18 02:46:15 UTC
  • mfrom: (5236.1.1 working-tree-get-file-text)
  • Revision ID: pqm@pqm.ubuntu.com-20100518024615-dmqzcnicw5p48k53
(lifeless) Explicitly close the file handle in WT.get_file_text. (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
397
397
            will not mangled.
398
398
 
399
399
    :cvar hooks: An instance of CommandHooks.
400
 
    :ivar __doc__: The help shown by 'bzr help command' for this command.
401
 
        This is set by assigning explicitly to __doc__ so that -OO can
402
 
        be used::
403
 
 
404
 
        class Foo(Command):
405
 
            __doc__ = "My help goes here"
406
400
    """
407
401
    aliases = []
408
402
    takes_args = []
413
407
 
414
408
    def __init__(self):
415
409
        """Construct an instance of this command."""
 
410
        if self.__doc__ == Command.__doc__ or not self.__doc__:
 
411
            raise ValueError("No help message set for %r" % self)
416
412
        # List of standard options directly supported
417
413
        self.supported_std_options = []
418
414
        self._setup_run()
486
482
            message explaining how to obtain full help.
487
483
        """
488
484
        doc = self.help()
489
 
        if not doc:
490
 
            doc = "No help for this command."
 
485
        if doc is None:
 
486
            raise NotImplementedError(
 
487
                "self.help() returned None -  no detailed help yet for %r" %
 
488
                self.name())
491
489
 
492
490
        # Extract the summary (purpose) and sections out from the text
493
491
        purpose,sections,order = self._get_help_parts(doc)