def __init__(self, prefix, windowName, width, height, icon, shelfCommand, annotation=' ', dockable=False, menuBar=False, mnb=False, mxb=False, s=False, rtf=False, startArea='right', allowedAreas='all', floating=False, *args, **kwargs): """ Initialize class and variables """ self.kwargs = kwargs self.windowName = windowName self.dockName = windowName + 'Dock' self.width = width self.height = height self.icon = icon self.prefix = prefix self.shelfCommand = shelfCommand self.annotation = annotation self.dockable = dockable self.menuBar = menuBar self.mnb = mnb self.mxb = mxb self.sizeable = s self.rtf = rtf self.startArea = startArea self.allowedAreas = allowedAreas self.floating = floating # store for use outside self.toolName = windowName self.mainWindow = '' self.menuBarLayout = '' self.prinipalMenus = None self.global_cfg = lcConfiguration.GlobalSettingsDictionary() self.lct_cfg = lcConfiguration.ConfigurationNode(lcPath.Path.get_tools_settings_file(), self.global_cfg) self.srcPath = lcPath.Path.getSrcPath()
conf = lcConfiguration.Conf.load_conf_file(os.path.join(os.path.abspath(os.path.dirname(__file__)), "{}.conf".format(os.path.basename(__file__).split('.')[0]) ) ) publish = conf['publish'] annotation = conf['annotation'] prefix = conf['prefix'] height = conf['height'] #set paths srcPath = lcPath.Path.getSrcPath() basePath = os.path.abspath(os.path.dirname(__file__)) iconPath = os.path.normpath(os.path.join(basePath, 'icons')) defaultPath = 'Export Path . . .' # #setup configuration node and add necessary attributes global_cfg = lcConfiguration.GlobalSettingsDictionary() lct_cfg = lcConfiguration.ConfigurationNode(lcPath.Path.get_tools_settings_file(), global_cfg) lct_cfg.add('lcObjToolsPop', False) lct_cfg.add('lcObjToolsPath', defaultPath) lct_cfg.add('lcObjToolsPrefix', '') lct_cfg.add('lcObjToolsExportIndividual', True) lct_cfg.add('lcObjToolsUseSmoothPreview', True) def lcObjToolsUI(dockable=False, asChildLayout=False, *args, **kwargs): ''' ''' global lct_cfg global prefix ci = 0 #color index iterator windowName = 'lcObjTools' shelfCommand = 'import lct.src.{0}.{0} as {1}\nreload({1})\n{1}.{0}UI()'.format(windowName, prefix) commandString = 'import lct.src.{0}.{0} as {1}\nreload({1})\n{1}.{0}UI(asChildLayout=True)'.format(windowName, prefix)