def loadSettings(self,d,name): self.clearSettings() self.entryName.insert(0,name) self.entryFile.insert(0,d['file']) file = d['file'] print ("osetuh"+ file) if file is not None: classes = getClasses(d['file']) print (classes) if not classes: self.cbPluginClass['values']= [''] self.cbGuiClass['values']= [''] self.cbPluginClass.current(0) self.cbGuiClass.current(0) else: print (classes.index(d['mainClass'])) self.cbPluginClass['values']= classes self.cbPluginClass.current(classes.index(d['mainClass'])) self.cbGuiClass['values']= classes self.cbGuiClass.current(classes.index(d['guiClass'])) else: file= OBS.GetAppDataPath()+"/pluginData/Python" print ("LoadSettings" + file) self.btnBrowse.config(command=lambda arg=os.path.dirname(file):self.btnBrowseEvent(arg)) self.btnOpenFolder.config(command=lambda arg=os.path.dirname(file): openContaningFolder(arg)) self.btnEditScript.config(command=lambda arg=file: openFileWithDefaultOSApp(arg))
def __init__(self, config): OBS.Log(u"__init__") self.config = config #config.SetInt("cx",1000) #config.SetInt("cy",100) self.width = 1500 self.height = 1500 self.bpp = 4 self.pixelbuffer = bytearray(self.width * self.height * self.bpp)
def btnBrowseEvent(self,file): print ("btnbrowsefile " + file) if file is None: #path = askopenfilename(parent=self.parent,initialdir=("C:\\")) path = askopenfilename(parent=self.parent,initialdir=(OBS.GetAppDataPath()+"/pluginData/Python")) else: path = askopenfilename(parent=self.parent,initialdir=(file)) if path == '': #user cancled do nothing. return self.updateComboBoxes(path)
def clearSettings(self): self.entryName.delete(0,END) self.entryFile.delete(0,END) self.btnBrowse.config(command=None) self.cbPluginClass['values'] = [''] self.cbGuiClass['values'] = [''] self.cbPluginClass.current(0) self.cbGuiClass.current(0) self.btnEditScript.config(command=None) self.btnOpenFolder.config(command=None) self.btnBrowse.config(command=lambda file= OBS.GetAppDataPath()+"/pluginData/Python" :self.btnBrowseEvent(file))
def __init__(self,sourceData): self.sourceData = sourceData self.jsonPath = OBS.GetAppDataPath()+"/pluginData/Python/scripts.json" self.scriptDict = loadJSON(self.jsonPath) self.currentDict = [] self.selectedScript = None print(getScriptNames(self.scriptDict)) self.initUI()
def __init__(self,config): OBS.Log(u"__init__") self.width = 300 self.height = 300 self.bpp = 4 self.pixelbuffer = bytearray(self.width*self.height*self.bpp) self.SetColour(0xff,0xff,255,255) self.CreateHotKey(0x52,self.hkey) self.CreateHotKey(0x47,self.hkey) self.CreateHotKey(0x42,self.hkey) self.CreateHotKey(0x57,self.hkey) self.CreateHotKey(0x26,self.hkey) self.CreateHotKey(0x28,self.hkey)
def EndScene(self): OBS.Log(u"endScene")
def btnOpenLogsEvent(self): stdErr = OBS.GetAppDataPath()+"/pluginData/Python/stdErr.txt" stdOut = OBS.GetAppDataPath()+"/pluginData/Python/stdOut.txt" openFileWithDefaultOSApp(stdErr) openFileWithDefaultOSApp(stdOut)
def getHWNDS(self): self.obshwnd = OBS.GetMainWindow() self.hwndTkinter = self.parent.winfo_id()