You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that commands can be plugged-in later, it would be better to make doc_description a method so as to be possible to override.
Just check cmd-graphx:line291. The version-discovery to be imprinted in the help-msg runs at import-time.
doc_description is used by doit help system as an attribute of Command instance (accessed as self.doc_description as opposed to MyCommand.doc_description ). That means it is possible to overwrite it with a method decorated as a @property. Since it hardly makes sense to have dynamic content on the description it is usually defined at class level with a static string.
For this specific case where the "dynamic" part is the version of the command I suggest we add a new version attribute member to command and let the help system assemble different parts of the help message as it already do with doc_purpose, doc_usage, doc_description. This way there would be no need for a method just to create doc_description.
The text was updated successfully, but these errors were encountered:
doc_description
is used bydoit
help system as an attribute of Command instance (accessed asself.doc_description
as opposed toMyCommand.doc_description
). That means it is possible to overwrite it with a method decorated as a@property
. Since it hardly makes sense to have dynamic content on the description it is usually defined at class level with a static string.For this specific case where the "dynamic" part is the
version
of the command I suggest we add a newversion
attribute member to command and let the help system assemble different parts of the help message as it already do withdoc_purpose
,doc_usage
,doc_description
. This way there would be no need for a method just to createdoc_description
.The text was updated successfully, but these errors were encountered: