rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
c = wmi.WMI () c_drive = c.Win32_LogicalDisk (Name='C:') | <pre class="code"> c = wmi.WMI () c_drive = c.Win32_LogicalDisk (Name='C:') </pre> | def references (self, wmi_class=""): """Return a list of associations involving this object, optionally limited by the result class (the name of the association class). |
of the classes on offer. This means you can explore a bit with things like this: c = wmi.WMI () for i in c.classes: if "user" in i.lower (): print i | of the classes on offer. This means you can explore a bit with things like this: <pre class="code"> c = wmi.WMI () for i in c.classes: if "user" in i.lower (): print i </pre> | def __init__(self, obj, attributes): if attributes: for attr in attributes: self.__dict__[attr] = obj.Properties_ (attr).Value else: for p in obj.Properties_: attr = p.Name self.__dict__[attr] = obj.Properties_(attr).Value |
eg system.instances ("Win32_LogicalDisk") or system.Win32_LogicalDisk () | <pre class="code"> system.instances ("Win32_LogicalDisk") system.Win32_LogicalDisk () </pre> | def instances (self, class_name): """Return a list of instances of the WMI class. This is (probably) equivalent to querying with no qualifiers. |
returns an wmi_watcher which can be called to get the next event. eg, c = wmi.WMI () watcher = c.watch_for (raw_wql="SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_Process'") while 1: process_created = watcher () print process_created.Name or, watcher = c.watch_for ( notification_type... | returns an wmi_watcher which can be called to get the next event. eg, <pre class="code"> c = wmi.WMI () raw_wql = "SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_Process'" watcher = c.watch_for (raw_wql=raw_wql) while 1: process_created = watcher () print process_created.Name watche... | def watch_for ( self, raw_wql=None, notification_type=None, wmi_class=None, delay_secs=1, **where_clause |
return _wmi_watcher (self._namespace.ExecNotificationQuery (wql), self) | return _wmi_watcher (self._namespace.ExecNotificationQuery (wql)) | def watch_for ( self, raw_wql=None, notification_type=None, wmi_class=None, delay_secs=1, **where_clause |
or | def connect ( computer=".", impersonation_level="", authentication_level="", authority="", privileges="", moniker="", wmi=None, namespace="", suffix="", user="", password="", find_classes=True, debug=False | |
eg c = wmi.WMI (wmi=wmi.connect_server (server="remote_machine", user="myname", password="mypassword")) | <pre class="code"> c = wmi.WMI (wmi=wmi.connect_server (server="remote_machine", user="myname", password="mypassword")) </pre> | def connect_server ( server, namespace = "", user = "", password = "", locale = "", authority = "", security_flags = 0, named_value_set = None |
if len(outputfile) == 3 and outputfile[2] == '"' : outputfile = outputfile[0:2] + '\\' | if rootpath and (len(rootpath)==3) and (rootpath[2]) == '"' : rootpath = rootpath[0:2] + '\\' | def __init__(self, rootpath=None, outputfile=None, size=None, tree=None) : # Gruik Gruik : C:" -> C:\ Thanks Windows ! if len(outputfile) == 3 and outputfile[2] == '"' : outputfile = outputfile[0:2] + '\\' if (rootpath == None) and (tree==None) : rootpath = u'.' if rootpath != None : tree = FileTree(unicode(rootpath)) ... |
completepath = os.path.join(path,subpath) | def scan( self, rootpath=None ) : if rootpath : self._rootpath = rootpath self._root = None pathinfos = {} for infopath in os.walk(self._rootpath,False) : #print "[%s]" % (pathinfos,) (path,subpaths,files) = infopath if path == self._rootpath : name = path else : name = os.path.split(path)[1] dirInfo = DirInfo( name=... | |
completepath = os.path.join(path,subpath) dirInfo.insertChild(pathinfos[completepath]) del pathinfos[completepath] | if completepath in pathinfos : completepath = os.path.join(path,subpath) dirInfo.insertChild(pathinfos[completepath]) del pathinfos[completepath] | def scan( self, rootpath=None ) : if rootpath : self._rootpath = rootpath self._root = None pathinfos = {} for infopath in os.walk(self._rootpath,False) : #print "[%s]" % (pathinfos,) (path,subpaths,files) = infopath if path == self._rootpath : name = path else : name = os.path.split(path)[1] dirInfo = DirInfo( name=... |
if (errnum == socket.SSL_ERROR_WANT_READ): | if (errnum == socket.SSL_ERROR_WANT_READ or errnum == socket.SSL_ERROR_WANT_WRITE): | def gotactivity(self): """gotactivity() -- internal handler for socket activity. Do not call. |
wrote = self.ssl.write(dat) | retry = False try: wrote = self.ssl.write(dat) except socket.sslerror, ex: (errnum, errstr) = ex if (errnum == socket.SSL_ERROR_WANT_READ or errnum == socket.SSL_ERROR_WANT_WRITE): self.log.warning('retrying write on ssl socket %s:%d', self.host, self.port) retry = True else: raise if (retry): continue | def send(self, dat): """send(dat) -> int |
'RecordFilePrefix', | def getDefaultParametersFromMythTVDB(): """Reads settings from MythTV database""" write( "Obtaining MythTV settings from MySQL database for hostname " + configHostname) #TVFormat is not dependant upon the hostname. sqlstatement="""select value, data from settings where value in('DBSchemaVer') or (hostname='""" + conf... | |
WHERE basename = '%s'""" % file.attributes["filename"].value.replace("'", "\\'") | WHERE basename = '%s'""" % basename.replace("'", "\\'") | def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.cre... |
FROM recorded WHERE basename = '%s'""" % file.attributes["filename"].value.replace("'", "\\'") | FROM recorded WHERE basename = '%s'""" % basename.replace("'", "\\'") | def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.cre... |
mediafile = os.path.join(recordingpath, file.attributes["filename"].value) | mediafile = file.attributes["filename"].value | def preProcessFile(file, folder): """Pre-process a single video/recording file.""" write( "Pre-processing file '" + file.attributes["filename"].value + \ "' of type '"+ file.attributes["type"].value+"'") #As part of this routine we need to pre-process the video: #1. check the file actually exists #2. extract informat... |
mediafile = os.path.join(recordingpath, file.attributes["filename"].value) | mediafile = file.attributes["filename"].value | def processFile(file, folder): from shutil import copy """Process a single video/recording file ready for burning.""" write( "*************************************************************") write( "Processing file " + file.attributes["filename"].value + " of type " + file.attributes["type"].value) write( "***********... |
previewImage = os.path.join(recordingpath, file.attributes["filename"].value + ".png") | previewImage = file.attributes["filename"].value + ".png" | def processFile(file, folder): from shutil import copy """Process a single video/recording file ready for burning.""" write( "*************************************************************") write( "Processing file " + file.attributes["filename"].value + " of type " + file.attributes["type"].value) write( "***********... |
if node.attributes["type"].value == "recording": tmpfile = string.split(os.path.join(recordingpath, node.attributes["filename"].value), '/') else: tmpfile = string.split(node.attributes["filename"].value, '/') | tmpfile = string.split(node.attributes["filename"].value, '/') | def copyRemote(files,tmpPath): from shutil import copy localTmpPath = os.path.join(tmpPath, "localcopy") # Define remote filesystems remotefs = ['nfs','smbfs'] remotemounts = [] # What does mount say? mounts = os.popen('mount') # Go through each line of mounts output for line in mounts.readlines(): parts = line.split(... |
write("Copying file from " +os.path.join(recordingpath, node.attributes["filename"].value)) | write("Copying file from " + node.attributes["filename"].value) | def copyRemote(files,tmpPath): from shutil import copy localTmpPath = os.path.join(tmpPath, "localcopy") # Define remote filesystems remotefs = ['nfs','smbfs'] remotemounts = [] # What does mount say? mounts = os.popen('mount') # Go through each line of mounts output for line in mounts.readlines(): parts = line.split(... |
copy(os.path.join(recordingpath, node.attributes["filename"].value),os.path.join(localTmpPath, filename)) | copy(node.attributes["filename"].value, os.path.join(localTmpPath, filename)) | def copyRemote(files,tmpPath): from shutil import copy localTmpPath = os.path.join(tmpPath, "localcopy") # Define remote filesystems remotefs = ['nfs','smbfs'] remotemounts = [] # What does mount say? mounts = os.popen('mount') # Go through each line of mounts output for line in mounts.readlines(): parts = line.split(... |
recordingpath = defaultsettings.get("RecordFilePrefix", None) | def usage(): write(""" -h/--help (Show this usage) -j/--jobfile file (use file as the job file) -l/--progresslog file (log file to output progress messages) """) | |
titleset = dvddom.createElement("titleset") titles = dvddom.createElement("titles") titleset.appendChild(titles) dvdauthor_element.appendChild(titleset) | menus = dvdauthor_element.childNodes[1].childNodes[1] menu_pgc = menus.childNodes[1] | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
fileCount = 0 | if wantIntro: video = dvddom.createElement("video") video.setAttribute("format", videomode) if mainmenuAspectRatio == "4:3": video.setAttribute("aspect", "4:3") else: video.setAttribute("aspect", "16:9") video.setAttribute("widescreen", "nopanscan") menus.appendChild(video) pre = dvddom.createElement("pre") pre.appe... | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
if wantIntro: node = themeDOM.getElementsByTagName("intro")[0] introFile = node.attributes["filename"].value titles.appendChild(dvddom.createComment("Intro movie")) pgc = dvddom.createElement("pgc") vob = dvddom.createElement("vob") vob.setAttribute("file",os.path.join(getThemeFile(themeName, videomode + '_' + introFi... | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... | |
pgc = dvddom.createElement("pgc") | titleset = dvddom.createElement("titleset") dvdauthor_element.appendChild(titleset) menu = dvddom.createElement("menus") menupgc = dvddom.createElement("pgc") menu.appendChild(menupgc) menupgc.setAttribute("pause","0") titleset.appendChild(menu) | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
vob.setAttribute("file",os.path.join(getTempPath(),"details-%s.mpg" % itemNum)) pgc.appendChild(vob) fileCount +=1 del vob | vob.setAttribute("file", os.path.join(getTempPath(),"details-%s.mpg" % itemNum)) menupgc.appendChild(vob) post = dvddom.createElement("post") post.appendChild(dvddom.createTextNode("jump title 1;")) menupgc.appendChild(post) del post else: pre = dvddom.createElement("pre") pre.appendChild(dvddom.createTextNode("jump ... | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
if wantIntro: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 2))) else: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 1))) | post.appendChild(dvddom.createTextNode("g1=%d;call vmgm menu 2;" % (itemNum + 1))) | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
fileCount +=1 | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... | |
fatalError("Stream info file doesn't look right (%s)" % os.path.join(getItemTempPath(index), 'streaminfo.xml')) | fatalError("Stream info file doesn't look right (%s)" % os.path.join(folder, 'streaminfo.xml')) | def getAudioParams(folder): """Returns the audio bitrate and no of channels for a file from its streaminfo.xml""" #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.path.join(folder, 'streaminfo.xml')) #error out if its the wrong XML if infoDOM.documentElement.tagName != "file": f... |
totalaudiosize+=os.path.getsize(os.path.join(folder,"stream0.ac3")) / 1024 / 1024 | if doesFileExist(os.path.join(folder,"stream0.ac3")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream0.ac3")) / 1024 / 1024 if doesFileExist(os.path.join(folder,"stream0.mp2")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream0.mp2")) / 1024 / 1024 | def calculateFileSizes(files): """ Returns the sizes of all video, audio and menu files""" filecount=0 totalvideosize=0 totalaudiosize=0 totalmenusize=0 for node in files: filecount+=1 #Generate a temp folder name for this file folder=getItemTempPath(filecount) #Process this file file=os.path.join(folder,"stream.mv2")... |
os.rename(os.path.join(folder,'stream0.mp2'), os.path.join(folder,'stream0.ac3')) | write( "Audio track 1 is in mp2 format - NOT re-encoding to ac3") | def processAudio(folder): """encode audio to ac3 for better compression and compatability with NTSC players""" # process track 1 if not encodetoac3 and doesFileExist(os.path.join(folder,'stream0.mp2')): #don't re-encode to ac3 if the user doesn't want it os.rename(os.path.join(folder,'stream0.mp2'), os.path.join(folde... |
elif doesFileExist(os.path.join(folder,'stream0.ac3'))==True: write( "Audio is already in ac3 format") | def processAudio(folder): """encode audio to ac3 for better compression and compatability with NTSC players""" # process track 1 if not encodetoac3 and doesFileExist(os.path.join(folder,'stream0.mp2')): #don't re-encode to ac3 if the user doesn't want it os.rename(os.path.join(folder,'stream0.mp2'), os.path.join(folde... | |
os.rename(os.path.join(folder,'stream1.mp2'), os.path.join(folder,'stream1.ac3')) | write( "Audio track 1 is in mp2 format - NOT re-encoding to ac3") | def processAudio(folder): """encode audio to ac3 for better compression and compatability with NTSC players""" # process track 1 if not encodetoac3 and doesFileExist(os.path.join(folder,'stream0.mp2')): #don't re-encode to ac3 if the user doesn't want it os.rename(os.path.join(folder,'stream0.mp2'), os.path.join(folde... |
elif doesFileExist(os.path.join(folder,'stream1.ac3'))==True: write( "Audio is already in ac3 format") | def processAudio(folder): """encode audio to ac3 for better compression and compatability with NTSC players""" # process track 1 if not encodetoac3 and doesFileExist(os.path.join(folder,'stream0.mp2')): #don't re-encode to ac3 if the user doesn't want it os.rename(os.path.join(folder,'stream0.mp2'), os.path.join(folde... | |
assert doesFileExist(os.path.join(folder,'stream.mv2')) assert doesFileExist(os.path.join(folder,'stream0.ac3')) | def processFile(file, folder): """Process a single video/recording file ready for burning.""" write( "*************************************************************") write( "Processing file " + file.attributes["filename"].value + " of type " + file.attributes["type"].value) write( "************************************... | |
os.path.join(folder,'stream0.ac3'), os.path.join(folder,'stream1.ac3'), | os.path.join(folder,'stream0'), os.path.join(folder,'stream1'), | def processJob(job): """Starts processing a MythBurn job, expects XML nodes to be passed as input.""" global wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage global themeDOM, themeName, themeFonts media=job.getElementsByTagName("media") if media.length==1: themeName=job.attributes["theme"].value #Check the... |
if getText(node.attributes["static"])=="False": if int(node.attributes["x"].value) < boundarybox[0]: boundarybox = int(node.attributes["x"].value),boundarybox[1],boundarybox[2],boundarybox[3] if int(node.attributes["y"].value) < boundarybox[1]: boundarybox = boundarybox[0],int(node.attributes["y"].value),boundarybox[2... | if getText(node.attributes["static"]) == "False": if getScaledAttribute(node, "x") < boundarybox[0]: boundarybox = getScaledAttribute(node, "x"), boundarybox[1], boundarybox[2], boundarybox[3] if getScaledAttribute(node, "y") < boundarybox[1]: boundarybox = boundarybox[0], getScaledAttribute(node, "y"), boundarybox[2]... | def checkBoundaryBox(boundarybox, node): # We work out how much space all of our graphics and text are taking up # in a bounding rectangle so that we can use this as an automatic highlight # on the DVD menu if getText(node.attributes["static"])=="False": if int(node.attributes["x"].value) < boundarybox[0]: boundarybox ... |
fontsize = int(nodefont.attributes["size"].value) | fontsize = getScaledAttribute(nodefont, "size") | def loadFonts(themeDOM): global themeFonts #Find all the fonts nodelistfonts=themeDOM.getElementsByTagName("font") fontnumber=0 for nodefont in nodelistfonts: fontname = getText(nodefont) fontsize = int(nodefont.attributes["size"].value) themeFonts[fontnumber]=ImageFont.truetype(getFontPathName(fontname),fontsize ) w... |
picture = Image.open(imagefilename,"r").resize((int(node.attributes["w"].value), int(node.attributes["h"].value))) | picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
bgimage.paste(picture,(int(node.attributes["x"].value), int(node.attributes["y"].value)),picture) | bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
int(node.attributes["x"].value), int(node.attributes["y"].value), int(node.attributes["w"].value), int(node.attributes["h"].value), | getScaledAttribute(node, "x"), getScaledAttribute(node, "y"), getScaledAttribute(node, "w"), getScaledAttribute(node, "h"), | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
picture=Image.open(maskimagefilename,"r").resize((int(node.attributes["w"].value), int(node.attributes["h"].value))) | picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
bgimagemask.paste(picture,(int(node.attributes["x"].value), int(node.attributes["y"].value)),picture) | bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
button.setAttribute("x0","%s" % int(node.attributes["x"].value)) button.setAttribute("y0","%s" % int(node.attributes["y"].value)) button.setAttribute("x1","%s" % (int(node.attributes["x"].value)+int(node.attributes["w"].value))) button.setAttribute("y1","%s" % (int(node.attributes["y"].value)+int(node.attributes["h"].v... | button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
int(textnode.attributes["x"].value), int(textnode.attributes["y"].value), int(textnode.attributes["w"].value), int(textnode.attributes["h"].value), | getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
int(node.attributes["x"].value) - int(textnode.attributes["x"].value), int(node.attributes["y"].value) - int(textnode.attributes["y"].value), int(textnode.attributes["w"].value), int(textnode.attributes["h"].value), | getScaledAttribute(node, "x") - getScaledAttribute(textnode, "x"), getScaledAttribute(node, "y") - getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
bgimagemask.paste(textnode.attributes["colour"].value, (int(textnode.attributes["x"].value), int(textnode.attributes["y"].value)),textImage) | bgimagemask.paste(textnode.attributes["colour"].value, (getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y")), textImage) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.do... |
where filename='%s'""" % os.path.join(videopath, file.attributes["filename"].value) | where filename='%s'""" % filename | def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.cre... |
if record[8]!="" and record[8]!="No Cover": | if doesFileExist(record[8]): | def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.cre... |
top_element.appendChild(node) | else: node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) | def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.cre... |
command = path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput) result = runCommand(command) if result<>0: fatalError("Failed while running spumux - %s" % command) os.remove(tempvideo) os.remove(tempmovie) | if xmlfile != "": command = path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput) result = runCommand(command) if result<>0: fatalError("Failed while running spumux - %s" % command) else: os.rename(tempmovie, finaloutput) if os.path.exists(tempvideo): os.remove(tempvideo) if os.path.ex... | def encodeMenu(background, tempvideo, music, musiclength, tempmovie, xmlfile, finaloutput): if videomode=="pal": framespersecond=frameratePAL else: framespersecond=framerateNTSC totalframes=int(musiclength * framespersecond) command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a 3 -v 1 -f 8 -o '%s... |
os.path.join(getTempPath(),"detailsspumux-%s.xml" % itemnum), | "", | def createDetailsPage(screensize, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find detailspage... |
command = path_ffmpeg[0] + " -v 1 -i %s -r %s -target dvd -b 3000 -s %s -ab 192 -copyts " \ "-aspect %s %s" % (source, videomode, encoderesolution, aspectratio, destvideofile) | command = path_ffmpeg[0] + " -v 1 -i %s -r %s -target dvd -b 3000 -s %s " % \ (source, videomode, encoderesolution) if audio1[AUDIO_CODEC] != "AC3": command += "-ab 192 -ac 2 -copyts " else: command += "-acodec copy " command += "-aspect %s %s" % (aspectratio, destvideofile) | def encodeVideoToMPEG2(source, destvideofile, video, audio1, audio2, aspectratio): """Encodes an unknown video source file eg. AVI to MPEG2 video and AC3 audio, use ffmpeg""" #MPEG-2 resolutions: 720x480, 720x576, 352x480, 352x576 if videomode=="ntsc": encoderesolution=dvdNTSCD1 else: encoderesolution=dvdPALD1 #192 i... |
return os.path.join(sharepath, "mytharchive", "themes", theme, file) | if os.path.exists(os.path.join(sharepath, "mytharchive", "themes", theme, file)): return os.path.join(sharepath, "mytharchive", "themes", theme, file) if os.path.exists(os.path.join(sharepath, "mytharchive", "images", file)): return os.path.join(sharepath, "mytharchive", "images", file) if os.path.exists(os.path.join... | def getThemeFile(theme,file): return os.path.join(sharepath, "mytharchive", "themes", theme, file) |
def encodeMenu(background, tempvideo, music, tempmovie, xmlfile, finaloutput): | def encodeMenu(background, tempvideo, music, musiclength, tempmovie, xmlfile, finaloutput): | def encodeMenu(background, tempvideo, music, tempmovie, xmlfile, finaloutput): if videomode=="pal": framespersecond=frameratePAL else: framespersecond=framerateNTSC #Generate 15 seconds of menu totalframes=int(15 * framespersecond) command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a 3 -v 1 -f 8... |
totalframes=int(15 * framespersecond) | totalframes=int(musiclength * framespersecond) | def encodeMenu(background, tempvideo, music, tempmovie, xmlfile, finaloutput): if videomode=="pal": framespersecond=frameratePAL else: framespersecond=framerateNTSC #Generate 15 seconds of menu totalframes=int(15 * framespersecond) command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a 3 -v 1 -f 8... |
imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) | imagefilename = getThemeFile(themeName, node.attributes["filename"].value) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item ... |
maskimagefilename = expandItemText(infoDOM,node.attributes["mask"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) | maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item ... |
getThemeFile(themeName,"menumusic.mp2"), | getThemeFile(themeName,menumusic), menulength, | def createMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[0] menuite... |
getThemeFile(themeName,"menumusic.mp2"), | getThemeFile(themeName,menumusic), menulength, | def createChapterMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menunode=menunod... |
getThemeFile(themeName,"menumusic.mp2"), | getThemeFile(themeName,menumusic), menulength, | def createDetailsPage(screensize, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find detailspage... |
write("Video id: %x, Audio1: %x (%s, %s), Audio2: %x (%s, %s)" % \ (video[VIDEO_ID], audio1[AUDIO_ID], audio1[AUDIO_CODEC], audio1[AUDIO_LANG], \ audio2[AUDIO_ID], audio2[AUDIO_CODEC], audio2[AUDIO_LANG])) | write("Video id: 0x%x, Audio1: [%d] 0x%x (%s, %s), Audio2: [%d] - 0x%x (%s, %s)" % \ (video[VIDEO_ID], audio1[AUDIO_INDEX], audio1[AUDIO_ID], audio1[AUDIO_CODEC], audio1[AUDIO_LANG], \ audio2[AUDIO_INDEX], audio2[AUDIO_ID], audio2[AUDIO_CODEC], audio2[AUDIO_LANG])) | def selectStreams(folder): """Choose the streams we want from the source file""" video = (-1, 'N/A', -1) # index, codec, ID audio1 = (-1, 'N/A', -1, 'N/A') # index, codec, ID, lang audio2 = (-1, 'N/A', -1, 'N/A') #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.p... |
if alwaysRunMythtranscode == True or getFileType(folder) == "mpegts": | if alwaysRunMythtranscode == True or (getFileType(folder) == "mpegts" and isFileOkayForDVD(folder)): | def processFile(file, folder): """Process a single video/recording file ready for burning.""" write( "*************************************************************") write( "Processing file " + file.attributes["filename"].value + " of type " + file.attributes["type"].value) write( "************************************... |
def createMenu(screensize, numberofitems): | def createMenu(screensize, screendpi, numberofitems): | def createMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[0] menuite... |
bgimage.save(os.path.join(getTempPath(),"background-%s.png" % page),"PNG",quality=99,optimize=0) bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0) | bgimage.save(os.path.join(getTempPath(),"background-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) | def createMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[0] menuite... |
def createChapterMenu(screensize, numberofitems): | def createChapterMenu(screensize, screendpi, numberofitems): | def createChapterMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menunode=menunod... |
bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0) | bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) | def createChapterMenu(screensize, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menunode=menunod... |
def createDetailsPage(screensize, numberofitems): | def createDetailsPage(screensize, screendpi, numberofitems): | def createDetailsPage(screensize, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find detailspage... |
bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0) | bgimage.save(os.path.join(getTempPath(),"details-%s.png" % itemnum),"PNG",quality=99,optimize=0,dpi=screendpi) | def createDetailsPage(screensize, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find detailspage... |
createMenu(format, files.length) | createMenu(format, dpi, files.length) | def processJob(job): """Starts processing a MythBurn job, expects XML nodes to be passed as input.""" global wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage global themeDOM, themeName, themeFonts media=job.getElementsByTagName("media") if media.length==1: themeName=job.attributes["theme"].value #Check the... |
createChapterMenu(format, files.length) | createChapterMenu(format, dpi, files.length) | def processJob(job): """Starts processing a MythBurn job, expects XML nodes to be passed as input.""" global wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage global themeDOM, themeName, themeFonts media=job.getElementsByTagName("media") if media.length==1: themeName=job.attributes["theme"].value #Check the... |
createDetailsPage(format, files.length) | createDetailsPage(format, dpi, files.length) | def processJob(job): """Starts processing a MythBurn job, expects XML nodes to be passed as input.""" global wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage global themeDOM, themeName, themeFonts media=job.getElementsByTagName("media") if media.length==1: themeName=job.attributes["theme"].value #Check the... |
int(node.attributes["ffmpegindex"].value) | index = int(node.attributes["ffmpegindex"].value) | def selectStreams(folder): """Choose the streams we want from the source file""" video = (-1, 'N/A', -1) # index, codec, ID audio1 = (-1, 'N/A', -1, 'N/A') # index, codec, ID, lang audio2 = (-1, 'N/A', -1, 'N/A') #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.p... |
if format == "AC3" and audio1[1] == "MP2": | if format == "AC3" and audio1[AUDIO_CODEC] == "MP2": | def selectStreams(folder): """Choose the streams we want from the source file""" video = (-1, 'N/A', -1) # index, codec, ID audio1 = (-1, 'N/A', -1, 'N/A') # index, codec, ID, lang audio2 = (-1, 'N/A', -1, 'N/A') #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.p... |
found = True | def selectStreams(folder): """Choose the streams we want from the source file""" video = (-1, 'N/A', -1) # index, codec, ID audio1 = (-1, 'N/A', -1, 'N/A') # index, codec, ID, lang audio2 = (-1, 'N/A', -1, 'N/A') #open the XML containing information about this file infoDOM = xml.dom.minidom.parse(os.p... | |
post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 1))) | if wantIntro: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 2))) else: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 1))) | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
def getIntroPath(): """This is the folder where all intro files are located.""" return os.path.join(sharepath, "mytharchive", "intro") | def getIntroPath(): """This is the folder where all intro files are located.""" return os.path.join(sharepath, "mytharchive", "intro") | |
vob.setAttribute("file",os.path.join(getIntroPath(), videomode + '_' + introFile)) | vob.setAttribute("file",os.path.join(getThemeFile(themeName, videomode + '_' + introFile))) | def createDVDAuthorXML(screensize, numberofitems): """Creates the xml file for dvdauthor to use the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find the menu element in the theme file") menunode=menunode[0] m... |
vob.setAttribute("file",os.path.join(getIntroPath(), videomode + '_' + introFile)) | vob.setAttribute("file",os.path.join(getThemFile(themeName, videomode + '_' + introFile))) | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD... |
command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \ % (totalframes, framespersecond, background, path_mpeg2enc[0], aspectratio, tempvideo) | command = path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \ % (totalframes, framespersecond, background, path_mpeg2enc[0], aspectratio, tempvideo) | def encodeMenu(background, tempvideo, music, musiclength, tempmovie, xmlfile, finaloutput, aspectratio): if videomode=="pal": framespersecond=frameratePAL else: framespersecond=framerateNTSC totalframes=int(musiclength * framespersecond) command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v... |
fatalError("Failed while running png2yuv - %s" % command) | fatalError("Failed while running jpeg2yuv - %s" % command) | def encodeMenu(background, tempvideo, music, musiclength, tempmovie, xmlfile, finaloutput, aspectratio): if videomode=="pal": framespersecond=frameratePAL else: framespersecond=framerateNTSC totalframes=int(musiclength * framespersecond) command = path_png2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v... |
'MythArchivePng2yuvCmd', | 'MythArchiveJpeg2yuvCmd', | def getDefaultParametersFromMythTVDB(): """Reads settings from MythTV database""" write( "Obtaining MythTV settings from MySQL database for hostname " + configHostname) #TVFormat is not dependant upon the hostname. sqlstatement="""select value, data from settings where value in('DBSchemaVer') or (hostname='""" + conf... |
imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage, chapternumber, chapterlist) if doesFileExist(imagefilename): picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage... | if node.attributes["filename"].value == "%movie": | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item ... |
write( "Image file does not exist '%s'" % imagefilename) | imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage, chapternumber, chapterlist) if doesFileExist(imagefilename) == False: if imagefilename == node.attributes["filename"].value: imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if doesFileEx... | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item ... |
write( "Menu page %s" % page) | write("Menu page %s" % page) write("Creating Preview Video") previewitem = itemnum itemsonthispage = 0 haspreview = False previewx = [] previewy = [] previeww = [] previewh = [] previewmask = [] while previewitem <= numberofitems and itemsonthispage < itemsperpage: menuitem=menuitems[ itemsonthispage ] itemsonthi... | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage) | overlayimage=Image.new("RGBA",screensize) draw=ImageDraw.Draw(overlayimage) | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
bgimagemask=Image.new("RGBA",bgimage.size) | bgimagemask=Image.new("RGBA",overlayimage.size) | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
itemnum, menuitem, bgimage, | itemnum, menuitem, overlayimage, | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
bgimage.save(os.path.join(getTempPath(),"background-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) | bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % page),"JPEG", quality=90) | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
itemsonthispage = 0 numframes=secondsToFrames(menulength) if haspreview == True: write( "Generating the preview images" ) framenum = 0 while framenum < numframes: previewitem = savedpreviewitem itemsonthispage = 0 while previewitem <= numberofitems and itemsonthispage < itemsperpage: itemsonthispage+=1 if previewx[... | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... | |
del overlayimage del previewx del previewy del previewmask | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... | |
encodeMenu(os.path.join(getTempPath(),"background-%s.png" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"spumux-%s.xml" % page), os.path.join(getTempPath(),"menu-%s.mpg" % page), aspect_ratio) | if haspreview == True: encodeMenu(os.path.join(getTempPath(),"background-%s-f%%06d.jpg" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"spumux-%s.xml" % page), os.path.join(getTempPath(),"menu-%s.mpg" % p... | def createMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("menu") if menunode.length!=1: fatalError("Cannot find menu element in theme file") menunode=menunode[... |
bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage) | overlayimage=Image.new("RGBA",screensize) draw=ImageDraw.Draw(overlayimage) | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menun... |
bgimagemask=Image.new("RGBA",bgimage.size) | bgimagemask=Image.new("RGBA",overlayimage.size) | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menun... |
drawThemeItem(page, itemsperpage, page, menuitem, bgimage, draw, | drawThemeItem(page, itemsperpage, page, menuitem, overlayimage, draw, | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menun... |
bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) | bgimage=Image.open(backgroundfilename,"r").resize(screensize) bgimage.paste(overlayimage, (0,0), overlayimage) bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=90) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=90,optimize=0) if hasprevie... | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menun... |
encodeMenu(os.path.join(getTempPath(),"chaptermenu-%s.png" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"chapterspumux-%s.xml" % page), os.path.join(getTempPath(),"chaptermenu-%s.mpg" % page), aspect_ra... | if haspreview == True: encodeMenu(os.path.join(getTempPath(),"chaptermenu-%s-f%%06d.jpg" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"chapterspumux-%s.xml" % page), os.path.join(getTempPath(),"chapterm... | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menun... |
bgimage=Image.open(backgroundfilename,"r").resize(screensize) draw=ImageDraw.Draw(bgimage) | previewfolder = createEmptyPreviewFolder(itemnum) haspreview = False previewx, previewy, previeww, previewh, previewmask = generateVideoPreview(itemnum, 1, detailnode, 0, menulength, previewfolder) if previewx != 9999: haspreview = True overlayimage=Image.new("RGBA",screensize) draw=ImageDraw.Draw(overlayimage... | def createDetailsPage(screensize, screendpi, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find ... |
drawThemeItem(0, 0, itemnum, detailnode, bgimage, draw, None, None, | drawThemeItem(0, 0, itemnum, detailnode, overlayimage, draw, None, None, | def createDetailsPage(screensize, screendpi, numberofitems): """Creates all the necessary images and files for the details page.""" write( "Creating details pages") #Get the detailspage node (we must only have 1) detailnode=themeDOM.getElementsByTagName("detailspage") if detailnode.length!=1: fatalError("Cannot find ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.