def invoke(self, tex): Command.invoke(self, tex) name = self.attributes['name'] type = self.attributes['type'] c = self.ownerDocument.context obj = c[type]() obj.parentNode = self.parentNode obj.ownerDocument = self.ownerDocument result = obj.invoke(tex) c.addGlobal(name, type(name, (self.DefinedURL,), {'result':result}))
def invoke(self, tex): Command.invoke(self, tex) name = str(self.attributes['name']) type = str(self.attributes['type']) c = self.ownerDocument.context obj = c[type]() obj.parentNode = self.parentNode obj.ownerDocument = self.ownerDocument result = obj.invoke(tex) c.addGlobal(name, new.classobj(name, (self.DefinedURL,), {'result':result}))
def invoke(self, tex): res = Command.invoke(self, tex) dir = os.path.dirname(tex.filename) file = os.path.join(dir, self.attributes['file']) try: status.info(' ( sampletableinteractive %s ' % file) self.attributes['messages'] = self.read_sample_interaction(file) status.info(') ') except (OSError, IOError): log.warning('\nProblem opening file "%s"', file)
def invoke(self, tex): res = Command.invoke(self, tex) dir = os.path.dirname(tex.filename) file1 = os.path.join(dir, self.attributes['file1']) file2 = os.path.join(dir, self.attributes['file2']) try: status.info(' ( verbatim %s ' % file1) self.attributes['data1'] = self.read_sample_file(file1) status.info(') ( verbatim %s ' % file2) self.attributes['data2'] = self.read_sample_file(file2) status.info(') ') except (OSError, IOError): log.warning('\nProblem opening files "%s" and "%s"', file1, file2)
def invoke(self, tex): res = Command.invoke(self, tex) basetex = self.ownerDocument.userdata['base_tex_instance'] f = self.attributes['file'] # Maybe more paths to look in? paths = [os.path.dirname(basetex.filename)] # Locate file for p in paths: fname = os.path.join(p, f) if os.path.isfile(fname): self.attributes['data'] = self.read_file(fname) break if 'data' not in self.attributes: log.warning('Problem opening file "%s"', f)
def invoke(self, tex): res = Command.invoke(self, tex) # Overcome plasTeX bug by looking for love in the right place basetex = self.ownerDocument.userdata['base_tex_instance'] f = self.attributes['file'] ext = self.ownerDocument.userdata.getPath( 'packages/graphicx/extensions', ['.png', '.jpg', '.jpeg', '.gif', '.pdf']) paths = self.ownerDocument.userdata.getPath( 'packages/graphicx/paths', [os.path.dirname(basetex.filename)]) img = None # Check for file using graphicspath for p in paths: for e in [''] + ext: fname = os.path.join(p, f + e) if os.path.isfile(fname): img = os.path.abspath(fname) break if img is not None: break # Check for file using kpsewhich if img is None: for e in [''] + ext: try: img = os.path.abspath(basetex.kpsewhich(f + e)) break except (OSError, IOError): pass if not os.path.isfile(img): log.warning('Could not identify image "%s"' % f) self.imageoverride = img return res
def invoke(self, tex): res = Command.invoke(self, tex) # Overcome plasTeX bug by looking for love in the right place basetex = self.ownerDocument.userdata['base_tex_instance'] f = self.attributes['file'] ext = self.ownerDocument.userdata.getPath( 'packages/graphicx/extensions', ['.png', '.jpg', '.jpeg', '.gif', '.pdf']) paths = self.ownerDocument.userdata.getPath( 'packages/graphicx/paths', [os.path.dirname(basetex.filename)]) img = None # Check for file using graphicspath for p in paths: for e in ['']+ext: fname = os.path.join(p, f+e) if os.path.isfile(fname): img = os.path.abspath(fname) break if img is not None: break # Check for file using kpsewhich if img is None: for e in ['']+ext: try: img = os.path.abspath(basetex.kpsewhich(f+e)) break except (OSError, IOError): pass if not os.path.isfile(img): log.warning('Could not identify image "%s"' % f) self.imageoverride = img return res
def invoke(self, tex): Command.invoke(self, tex) if not self.ownerDocument.userdata.has_key('tags'): self.ownerDocument.userdata['tags'] = self
def invoke(self, tex): res = Command.invoke(self, tex) timelimfile = os.path.join(os.path.dirname(tex.filename), '..', '.timelimit') if os.path.isfile(timelimfile): self.attributes['timelim'] = open(timelimfile, 'r').read()
def invoke(self, tex): res = Command.invoke(self, tex) id = self.attributes['id'] timelimfile = os.path.join(id, '.timelimit') if os.path.isfile(timelimfile): self.attributes['timelim'] = open(timelimfile, 'r').read()
def invoke(self, tex): Command.invoke(self, tex) name = str(self.attributes['name']) c = self.ownerDocument.context c.addGlobal(name, new.classobj(name, (url,), {}))
def invoke(self, tex): Command.invoke(self, tex) name = str(self.attributes['name']) c = self.ownerDocument.context c.addGlobal(name, type(name, (url,), {}))
def invoke(self, tex): Command.invoke(self, tex) if not self.ownerDocument.userdata.has_key('category'): self.ownerDocument.userdata['category'] = self