Help on module fcp2shk: NAME fcp2shk - A customizable script for converting a Final Cut Pro XML File to a Shake script. FILE fcp2shk.pyc DESCRIPTION This resultant Shake script is intended to be a starting point for the final Digitial Intermediate, not a complete conversion of a Final Cut Pro Sequence to a Shake file. A cut list is also generated for error checking and reparsing purposes. CLASSES xmllib.XMLParser fcpParser shkFileCreator class fcpParser(xmllib.XMLParser) | This Final Cut Pro XML Parser is based on xmllib.XMLParser which is now obsolete?!? This needs to be converted to use xml.sax instead. | | Methods defined here: | | __init__(self) | Initialise the XMLParser object and data needed for this parser. | | findReelPath(self, name) | If a clip is used more than once, it will not have the reel and filename listed more than once, so we need to find it from a previous clip. | | getclips(self) | Returns the array of clips | | handle_data(self, data) | Handle the textual 'data' that is inside the xml tags. | | parse(self, s) | Parse the given string 's'. | | push(self) | This pushes a clip into an internal clip array | | unknown_endtag(self, tag, attrs=None) | Detects end tags like | | unknown_starttag(self, tag, attrs=None) | Detects start tags like| | ---------------------------------------------------------------------- | Methods inherited from xmllib.XMLParser: | | close(self) | # Interface -- handle the remaining data | | feed(self, data) | # Interface -- feed some data to the parser. Call this as | # often as you want, with as little or as much text as you | # want (may include '\n'). (This just saves the text, all the | # processing is done by goahead().) | | finish_endtag(self, tag) | # Internal -- finish processing of end tag | | finish_starttag(self, tagname, attrdict, method) | # Internal -- finish processing of start tag | | getnamespace(self) | # Interface - return a dictionary of all namespaces currently valid | | goahead(self, end) | # Internal -- handle data as far as reasonable. May leave state | # and data to be processed by a subsequent call. If 'end' is | # true, force handling all data as if followed by EOF marker. | | handle_cdata(self, data) | # Example -- handle cdata, could be overridden | | handle_charref(self, name) | # Example -- handle character reference, no need to override | | handle_comment(self, data) | # Example -- handle comment, could be overridden | | handle_doctype(self, tag, pubid, syslit, data) | # Overridable -- handle DOCTYPE | | handle_endtag(self, tag, method) | # Overridable -- handle end tag | | handle_proc(self, name, data) | # Example -- handle processing instructions, could be overridden | | handle_starttag(self, tag, method, attrs) | # Overridable -- handle start tag | | handle_xml(self, encoding, standalone) | # Overridable -- handle xml processing instruction | | parse_attributes(self, tag, i, j) | # Internal -- parse attributes between i and j | | parse_cdata(self, i) | # Internal -- handle CDATA tag, return length or -1 if not terminated | | parse_comment(self, i) | # Internal -- parse comment, return length or -1 if not terminated | | parse_doctype(self, res) | # Internal -- handle DOCTYPE tag, return length or -1 if not terminated | | parse_endtag(self, i) | # Internal -- parse endtag | | parse_proc(self, i) | # Internal -- handle a processing instruction tag | | parse_starttag(self, i) | # Internal -- handle starttag, return length or -1 if not terminated | | reset(self) | # Interface -- reset this instance. Loses all unprocessed data | | setliteral(self, *args) | # For derived classes only -- enter literal mode (CDATA) | | setnomoretags(self) | # For derived classes only -- enter literal mode (CDATA) till EOF | | syntax_error(self, message) | # Example -- handle relatively harmless syntax errors, could be overridden | | translate_references(self, data, all=1) | # Interface -- translate references | | unknown_charref(self, ref) | | unknown_entityref(self, name) | | ---------------------------------------------------------------------- | Data and other attributes inherited from xmllib.XMLParser: | | attributes = {} | | elements = {} | | entitydefs = {'amp': '&', 'apos': ''', 'gt': '>', 'lt': '&... class shkFileCreator | This class creates a customized Shake file by passing an array of clips that have been parsed from a file. | The array of clips should contain a dictionary with this data in it: | clipinfo['in'], clipinfo['out'] in and out of the clip | clipinfo['start'], clipinfo['end'] start and end in the track | clipinfo['name'] unique name of the clip (fcpParser names them 'clipname_shotnumber', i.e. apartment_2_shot54) | clipinfo['cutnum'] shot or cut number in the track | clipinfo['filename'] the complete path and filename of the file(s) being cut in | clipinfo['reel'] which reel this footage came from | | Methods defined here: | | __init__(self) | Initialise the the shkFileCreator object and data needed for this parser. | | addclip(self, clip) | Generates SFileIn and IRetime nodes. | | addclips(self, clips) | Main Function. Call from main procedure of program. | | removeForbiddenChars(self, text) | Lots of shady characters make it into clip names, well this gets rid of them! | | sortByReel(self, a, b) | Internal clip sorter. | | sortSelectDataByFrame(self, a, b) | Internal select data sorter. | | writeFile(self, outputfile) | Internal function to assemble the shake components and output the file DATA DEBUG = 0 SORTBYREEL = 1 __usage__ = '\nfcp2shk [xmlfile] [shakeoutput] [cutlistoutput]...otorc...