__all__ = ['DisableTemplates', 'instantiate']
from UserCustomization import UserCustomBase, CustomInfo
from MessagingAPI import MessageSender
from RTFapi import SystemInformation
class DisableTemplates( UserCustomBase, MessageSender ):
def appendMenuItems( self, id, menu ):
SystemInformation.instance().setConfigSwitch('preview-disable-templates',True)
if "Help" == id:
menu.appendSeparator()
menu.appendItem("Import Templates...", self.onFileNew)
def onFileNew( self, *args ) :
self.sendMessage( "TEMPLATE_FILE_NEW", (True,) )
def instantiate():
return DisableTemplates()
def info():
customInfo = CustomInfo()
customInfo.vendor = 'Autodesk'
customInfo.version = '1.0'
customInfo.api = '2012'
customInfo.shortInfo = "Disable import templates"
customInfo.longInfo = \
"""Changes the behavior of File->New to create an empty file instead of presenting the user with the import templates workflow.
"""
return customInfo
if __name__ == '__main__' :
bfu = instantiate()