本文整理汇总了Python中stsci.tools.teal.getHelpFileAsString函数的典型用法代码示例。如果您正苦于以下问题:Python getHelpFileAsString函数的具体用法?Python getHelpFileAsString怎么用?Python getHelpFileAsString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getHelpFileAsString函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getHelpAsString
def getHelpAsString(docstring = False, show_ver = True):
"""
return useful help from a file in the script directory called
__taskname__.help
"""
install_dir = os.path.dirname(__file__)
taskname = util.base_taskname(__taskname__, __package__)
htmlfile = os.path.join(install_dir, 'htmlhelp', taskname + '.html')
helpfile = os.path.join(install_dir, taskname + '.help')
if docstring or (not docstring and not os.path.exists(htmlfile)):
if show_ver:
helpString = os.linesep + \
' '.join([__taskname__, 'Version', __version__,
' updated on ', __vdate__]) + 2*os.linesep
else:
helpString = ''
if os.path.exists(helpfile):
helpString += teal.getHelpFileAsString(taskname, __file__)
else:
if __doc__ is not None:
helpString += __doc__ + os.linesep
else:
helpString = 'file://' + htmlfile
return helpString
示例2: getHelpAsString
def getHelpAsString(fulldoc=True):
"""Return help info from <module>.help in the script directory"""
if fulldoc:
basedoc = __doc__
else:
basedoc = ""
helpString = basedoc + "\n"
helpString += "Version " + __version__ + "\n"
helpString += teal.getHelpFileAsString(__taskname__, __file__)
return helpString
示例3: getHelpAsString
def getHelpAsString(docstring=False):
"""Return documentation on the 'wf3ir' function. Required by TEAL."""
install_dir = os.path.dirname(__file__)
htmlfile = os.path.join(install_dir, 'htmlhelp', __taskname__ + '.html')
helpfile = os.path.join(install_dir, __taskname__ + '.help')
if docstring or (not docstring and not os.path.exists(htmlfile)):
helpString = ' '.join([__taskname__, 'Version', __version__,
' updated on ', __vdate__]) + '\n\n'
if os.path.exists(helpfile):
helpString += teal.getHelpFileAsString(__taskname__, __file__)
else:
helpString = 'file://' + htmlfile
return helpString
示例4: getHelpAsString
def getHelpAsString(docstring=False):
"""
return useful help from a file in the script directory called __taskname__.help
"""
install_dir = os.path.dirname(__file__)
htmlfile = os.path.join(install_dir, 'htmlhelp', __taskname__ + '.html')
helpfile = os.path.join(install_dir, __taskname__ + '.help')
if docstring or (not docstring and not os.path.exists(htmlfile)):
helpString = __taskname__ + ' Version ' + __version__ + '\n\n'
if os.path.exists(helpfile):
helpString += teal.getHelpFileAsString(__taskname__, __file__)
else:
helpString = 'file://' + htmlfile
return helpString
示例5: getHelpAsString
def getHelpAsString(docstring=False):
"""
Returns documentation on the 'sub2full' function.
return useful help from a file in the script directory called
__taskname__.help
"""
install_dir = os.path.dirname(__file__)
helpfile = os.path.join(install_dir, __taskname__ + '.help')
if docstring or (not docstring):
helpString = ' '.join([__taskname__, 'Version', __version__,
' updated on ', __vdate__]) + '\n\n'
if os.path.exists(helpfile):
helpString += teal.getHelpFileAsString(__taskname__, __file__)
return helpString
示例6: getHelpAsString
def getHelpAsString(fulldoc=True):
"""Return help info from <module>.help in the script directory"""
try:
from stsci.tools import teal
except ImportError:
teal = None
if fulldoc:
basedoc = __doc__
else:
basedoc = ""
helpString = basedoc + "\n"
helpString += "Version " + __version__ + "\n"
if teal is not None:
helpString += teal.getHelpFileAsString(__taskname__, __file__)
helpString += __usage__
return helpString