• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python common.getExportDocType函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中exe.webui.common.getExportDocType函数的典型用法代码示例。如果您正苦于以下问题:Python getExportDocType函数的具体用法?Python getExportDocType怎么用?Python getExportDocType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getExportDocType函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent, idevice):
        """
        Pre-create our field ids
        """
        Block.__init__(self, parent, idevice)
        
       
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.instructionsForLearners.idevice is None: 
            idevice.instructionsForLearners.idevice = idevice
        if idevice.content.idevice is None: 
            idevice.content.idevice = idevice
        if idevice.feedback.idevice is None: 
            idevice.feedback.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        idevice.instructionsForLearners.htmlTag = sectionTag
        idevice.instructionsForLearners.class_ = "block instructions"
        idevice.feedback.htmlTag = sectionTag            

        self.instructionElement = TextAreaElement(idevice.instructionsForLearners)
        self.instructionElement.field.content_w_resourcePaths = c_(self.instructionElement.field.content_w_resourcePaths)
        self.listaElement = ListaElement(idevice.content)
        self.feedbackElement = \
            TextAreaElement(idevice.feedback)
        self.previewing        = False # In view or preview render
        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:33,代码来源:listablock.py


示例2: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage, pages):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<"+navTag+" class=\"pagination noprt\">"+lb
        ext = 'html'
        if G.application.config.cutFileName == '1':
            ext = 'htm'

        if prevPage:
            html += "<a href=\"" + quote(prevPage.name) + '.' + ext + "\" class=\"prev\"><span>"
            html += "<span>&laquo; </span>%s</span></a>" % c_('Previous')

        if self.node.package.get_addPagination():
            if prevPage:
                html += ' <span class="sep">| </span>'
            html += "<span class=\"page-counter\">" + c_('Page %s of %s') % ('<strong>'+str(pages.index(self) + 1)+'</strong>','<strong>'+str(len(pages))+'</strong>')+ "</span>"

        if nextPage:
            if self.node.package.get_addPagination() or prevPage:
                html += ' <span class="sep">| </span>'
            html += "<a href=\"" + quote(nextPage.name) + '.' + ext + "\" class=\"next\"><span>"
            html += "%s<span> &raquo;</span></span></a>" % c_('Next')

        html += lb + "</" + navTag + ">" + lb
        return html
开发者ID:exelearning,项目名称:iteexe,代码行数:31,代码来源:websitepage.py


示例3: renderView

 def renderView(self, preview=False):
     """
     Returns an XHTML string for viewing this element
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     titleTag1 = "h3"
     titleTag2 = "h4"
     if dT == "HTML5":
         sectionTag = "section"
         titleTag1 = "h1"
         titleTag2 = "h1"        
     html  = ''
     html += '<'+sectionTag+' class="question">'+lb
     html += '<'+titleTag1+' class="js-sr-av">' + c_("Question")+'</'+titleTag1+'>'+lb        
     if preview: 
         html += self.questionElement.renderPreview()
     else:
         html += self.questionElement.renderView()
     # Answers
     html += '<'+sectionTag+' class="iDevice_answers">'+lb
     html += '<'+titleTag2+' class="js-sr-av">' + c_("Answers")+'</'+titleTag2+'>'+lb        
     for element in self.options:
         if preview: 
             html += element.renderPreview()      
         else:
             html += element.renderView()      
     html += "</"+sectionTag+">"+lb
     
     html += "</"+sectionTag+">"+lb
     
     return html
开发者ID:Rafav,项目名称:iteexe,代码行数:33,代码来源:testquestionelement.py


示例4: renderFeedbackView

 def renderFeedbackView(self, is_preview=False):
     """
     return xhtml string for display this option's feedback
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     titleTag = "h4"
     if dT == "HTML5":
         sectionTag = "section"
         titleTag = "h1"     
     
     if is_preview:
         content = self.question_feedback.field.content_w_resourcePaths
     else:
         content = self.question_feedback.field.content_wo_resourcePaths        
     
     html = '<'+sectionTag+' id="s'+self.id+'" class="feedback js-feedback js-hidden">'+lb
     html += '<'+titleTag+' class="js-sr-av">'+c_("Feedback")+'</'+titleTag+'>'+lb
     if self.question.isCorrect:
         html += '<p><strong id="s'+self.id+'-result" class="right">'+c_("True")+'</strong></p>'+lb
     else:
         html += '<p><strong id="s'+self.id+'-result" class="wrong">'+c_("False")+'</strong></p>'+lb
     html += content+lb
     html += '</'+sectionTag+'>'+lb   
     
     return html
开发者ID:RichDijk,项目名称:eXe,代码行数:27,代码来源:truefalseelement.py


示例5: render

    def render(self, package, for_print=0):
        """
        Returns an XHTML string rendering this page.
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        sectionTag = "div"
        headerTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            headerTag = "header"
            
        if package.title!='':
            title = escape(package.title)
        else:
            title = escape(package.root.titleLong)
        html  = self.renderHeader(title, for_print)
        if for_print:
            # include extra onload bit:
            html += u'<body class="exe-single-page" onload="print_page()">'
        else:
            html += u'<body class="exe-single-page">'
        html += u'<script type="text/javascript">document.body.className+=" js"</script>'+lb
        html += u"<div id=\"content\">"+lb
        html += u"<"+headerTag+" id=\"header\">"
        html += "<h1>"+escape(package.title)+"</h1>"
        html += u"</"+headerTag+">"+lb
        html += u"<"+sectionTag+" id=\"main\">"+lb
        html += self.renderNode(package.root, 1)
        html += u"<"+sectionTag+" id=\"lmsubmit\"></"+sectionTag+"><script type=\"text/javascript\" language=\"javascript\">doStart();</script>"
        html += u"</"+sectionTag+">"+lb
        html += self.renderLicense()+lb
        html += self.renderFooter()+lb
        html += u"</div>"+lb # Close content
        # Some styles might have their own JavaScript files (see their config.xml file)
        style = G.application.config.styleStore.getStyle(self.node.package.style)
        if style.hasValidConfig:
            html += style.get_extra_body()        
        html += u'</body>'
        html += u'<script type="text/javascript" src="lernmodule_net_custom.js"></script>'+lb
        html += u'</html>'
        
        # JR: Eliminamos los atributos de las ecuaciones
        aux = re.compile("exe_math_latex=\"[^\"]*\"")
        html = aux.sub("", html)
        aux = re.compile("exe_math_size=\"[^\"]*\"")
        html = aux.sub("", html)
        #JR: Cambio la ruta de los enlaces del glosario y el &
        html = html.replace("../../../../../mod/glossary", "../../../../mod/glossary")
        html = html.replace("&concept", "&amp;concept")
        # Remove "resources/" from data="resources/ and the url param
        html = html.replace("video/quicktime\" data=\"resources/", "video/quicktime\" data=\"")
        html = html.replace("application/x-mplayer2\" data=\"resources/", "application/x-mplayer2\" data=\"")
        html = html.replace("audio/x-pn-realaudio-plugin\" data=\"resources/", "audio/x-pn-realaudio-plugin\" data=\"")
        html = html.replace("<param name=\"url\" value=\"resources/", "<param name=\"url\" value=\"")

        return html
开发者ID:tquilian,项目名称:exelearningTest,代码行数:57,代码来源:singlepage.py


示例6: genItemResStr

    def genItemResStr(self, page):
        """
        Returning xml string for items and resources
        """
        itemId = "ITEM-" + unicode(self.idGenerator.generate())
        resId = "RES-" + unicode(self.idGenerator.generate())
        filename = page.name + ".html"

        self.itemStr += '<item identifier="' + itemId + '" isvisible="true" '
        self.itemStr += 'identifierref="' + resId + '">\n'
        self.itemStr += "    <title>"
        self.itemStr += escape(page.node.titleShort)
        self.itemStr += "</title>\n"

        self.resStr += '<resource identifier="' + resId + '" '
        self.resStr += 'type="webcontent" '

        self.resStr += 'href="' + filename + '"> \n'
        self.resStr += (
            """\
    <file href="%s"/>
    <file href="base.css"/>
    <file href="content.css"/>"""
            % filename
        )
        self.resStr += "\n"
        fileStr = ""

        dT = common.getExportDocType()
        if dT == "HTML5" or common.nodeHasMediaelement(page.node):
            self.resStr += '    <file href="exe_html5.js"/>\n'

        resources = page.node.getResources()
        my_style = G.application.config.styleStore.getStyle(page.node.package.style)
        if common.nodeHasMediaelement(page.node):
            resources = resources + [f.basename() for f in (self.config.webDir / "scripts" / "mediaelement").files()]
        if common.hasGalleryIdevice(page.node):
            self.resStr += '    <file href="exe_lightbox.js"/>\n'
            self.resStr += '    <file href="exe_lightbox.css"/>\n'
            self.resStr += '    <file href="exe_lightbox_close.png"/>\n'
            self.resStr += '    <file href="exe_lightbox_loading.gif"/>\n'
            self.resStr += '    <file href="exe_lightbox_next.png"/>\n'
            self.resStr += '    <file href="exe_lightbox_prev.png"/>\n'
        if my_style.hasValidConfig:
            if my_style.get_jquery() == True:
                self.resStr += '    <file href="exe_jquery.js"/>\n'
        else:
            self.resStr += '    <file href="exe_jquery.js"/>\n'

        for resource in resources:
            fileStr += '    <file href="' + escape(resource) + '"/>\n'

        self.resStr += fileStr
        self.resStr += "</resource>\n"
开发者ID:RichDijk,项目名称:eXe,代码行数:54,代码来源:imsexport.py


示例7: renderFooter

    def renderFooter(self):
        """
        Returns an XHTML string rendering the footer.
        """
        dT = common.getExportDocType()
        footerTag = "div"
        if dT == "HTML5":
            footerTag = "footer"

        html = ""
        if self.node.package.footer != "":
            html += '<' + footerTag + ' id="siteFooter">'
            html += self.node.package.footer + "</" + footerTag + ">"

        return html
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:15,代码来源:pages.py


示例8: renderViewContent

 def renderViewContent(self):
     """
     Returns an XHTML string for previewing this block
     """
     lb = "\n" #Line breaks
     dT = common.getExportDocType()   
     if dT == "HTML5":
         html = '<div class="iDevice_content" style="width:100%">'+lb
         if self.idevice.url:
             html += '<iframe src="'+self.idevice.url+'" width="600" height="'+self.idevice.height+'" style="width:100%"></iframe>'+lb
     else:        
         html = '<div class="iDevice_content">'+lb
         if self.idevice.url:
             html += '<iframe src="'+self.idevice.url+'" width="100%" height="'+self.idevice.height+'px"></iframe>'+lb
     html += '</div>'+lb
     return html
开发者ID:Rafav,项目名称:iteexe,代码行数:16,代码来源:externalurlblock.py


示例9: renderQuestion

    def renderQuestion(self, is_preview):
        """
        Returns an XHTML string for viewing and previewing this question element
        """
        log.debug("renderPreview called in the form of renderQuestion")
        
        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        titleTag = "h3"
        if dT == "HTML5":
            titleTag = "h1"
        
        if is_preview:
            html = '<'+titleTag+' class="js-sr-av">' + c_("Question")+' '+str(self.index+1)+'</'+titleTag+'>'+lb
            html += self.question_question.renderPreview()
            if self.question_hint.field.content:
                html += common.ideviceHint(self.question_hint.field.content,"preview","h4")
        else: 
            html = '<form name="true-false-form-'+self.id+'" action="#" class="activity-form">'+lb        
            html += '<'+titleTag+' class="js-sr-av">' + c_("Question")+' '+str(self.index+1)+'</'+titleTag+'>'+lb
            html += self.question_question.renderView()
            if self.question_hint.field.content:
                html += common.ideviceHint(self.question_hint.field.content,"view","h4")



        html += "<fieldset data-role='controlgroup' data-type='horizontal' >"+lb
        html += '<p class="iDevice_answer js-required">'+lb
        html += '<label for="true'+self.id+'">'
        html += self.__option(0, 2, "true")+' '
        html += c_("True")
        html += '</label> '+lb
        html += '<label for="false'+self.id+'">'
        html += self.__option(1, 2, "false")+' '
        html += c_("False")
        html += '</label>'+lb
        html += '</p>'+lb
        html += "</fieldset>"+lb
        
        if not is_preview:
            html += '</form>'+lb
       
        return html
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:43,代码来源:truefalseelement.py


示例10: renderView

    def renderView(self, style):
        """
        Returns an XHTML string for viewing this block
        """     

        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        figureTag = "div"
        if dT == "HTML5":
            figureTag = "figure"        
        
        html = common.ideviceHeader(self, style, "view")
        
        html += '<div class="iDevice_content">'+lb
        html += '<'+figureTag+' class="image_text" style="width:'+str(self.idevice.imageMagnifier.width)+'px;float:'+self.idevice.float+';'
        if self.idevice.float == 'left':
            html += 'margin:0 20px 20px 0'
        if self.idevice.float == 'right':
            html += 'margin:0 0 20px 20px'
        html += '">'  
        html += lb
        html += self.imageMagnifierElement.renderView()
        if self.idevice.caption != '':
            html = html.replace(' alt="" ',' alt="'+self.idevice.caption.replace('"','&quot;')+'" ', 1)
            if dT == "HTML5":
                html += '<figcaption style="font-weight:bold">'+self.idevice.caption+'</figcaption>'+lb
            else:
                html += '<strong>'+self.idevice.caption+'</strong>'+lb
        html += '</'+figureTag+'>'+lb 
        text = self.textElement.renderView()
        if text:
            text = text.replace('"block iDevice_content"', '"iDevice_text"', 1)
            html += text
        else:
            html += '&nbsp;'
        html += '</div>'+lb # /.iDevice_content
        
        html += common.ideviceFooter(self, style, "view")

        return html
开发者ID:Rafav,项目名称:iteexe,代码行数:40,代码来源:imagemagnifierblock.py


示例11: __init__

    def __init__(self, index, idevice, question):
        """
        Initialize
        'index' is our number in the list of questions
        'idevice' is a case study idevice
        'question' is a exe.engine.casestudyidevice.Question instance
        """
        self.index        = index
        self.id           = "q" + unicode(index) + "b" + idevice.id        
        self.idevice      = idevice


        self.quesId       = "quesQuestion" + unicode(index) + "b" + idevice.id
        self.feedbackId   = "quesFeedback" + unicode(index) + "b" + idevice.id

        self.question     = question
        # also split out each part for a separate TextAreaElement:

        # but first....  
        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set: 
        if question.questionTextArea.idevice is None: 
            question.questionTextArea.idevice = idevice 
        if question.feedbackTextArea.idevice is None: 
            question.feedbackTextArea.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section" 
        question.questionTextArea.htmlTag = sectionTag

        self.question_question = TextAreaElement(question.questionTextArea)
        self.question_question.id = self.quesId 
        
        question.feedbackTextArea.htmlTag = "div"
        
        self.question_feedback = TextAreaElement(question.feedbackTextArea)
        self.question_feedback.id = self.feedbackId 
开发者ID:RichDijk,项目名称:eXe,代码行数:39,代码来源:questionelement.py


示例12: renderView

    def renderView(self, style):
        """
        Returns an XHTML string for viewing this block
        """
        lb = "\n" #Line breaks
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        html = common.ideviceHeader(self, style, "view")
        html += self.instructionElement.renderView()
        
        for element in self.questionElements:
            html += "<"+sectionTag+" class=\"question\">"+lb
            html += element.renderQuestionView()
            html += element.renderFeedbackView()
            html += "</"+sectionTag+">"+lb
            
        html += common.ideviceFooter(self, style, "view")

        return html
开发者ID:Rafav,项目名称:iteexe,代码行数:22,代码来源:truefalseblock.py


示例13: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n" #Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<"+navTag+" class=\"pagination noprt\">"+lb

        if prevPage:
            html += "<a href=\""+quote(prevPage.name)+".html\" class=\"prev\">"
            html += "<span>&laquo; </span>%s</a>" % c_('Previous')

        if nextPage:
            if prevPage:
                html += " | "
            html += "<a href=\""+quote(nextPage.name)+".html\" class=\"next\">"
            html += " %s<span> &raquo;</span></a>" % c_('Next')
            
        html += lb+"</"+navTag+">"+lb
        return html
开发者ID:kohnle-lernmodule,项目名称:KITexe201based,代码行数:23,代码来源:websitepage.py


示例14: getNavigationLink

    def getNavigationLink(self, prevPage, nextPage):
        """
        return the next link url of this page
        """
        dT = common.getExportDocType()
        lb = "\n"  # Line breaks
        navTag = "div"
        if dT == "HTML5":
            navTag = "nav"
        html = "<" + navTag + ' class="pagination noprt">' + lb

        if prevPage:
            html += '<a href="' + quote(prevPage.name) + '.html" class="prev">'
            html += "<span>&laquo; </span>%s</a>" % c_("Previous")

        if nextPage:
            if prevPage:
                html += " | "
            html += '<a href="' + quote(nextPage.name) + '.html" class="next">'
            html += " %s<span> &raquo;</span></a>" % c_("Next")

        html += lb + "</" + navTag + ">" + lb
        return html
开发者ID:kohnle-lernmodule,项目名称:exe201based,代码行数:23,代码来源:websitepage.py


示例15: renderView

 def renderView(self, preview=False):
     """
     Returns an XHTML string for viewing this option element
     """
     log.debug("renderView called")
     
     lb = "\n" #Line breaks
     dT = common.getExportDocType()
     sectionTag = "div"
     if dT == "HTML5":
         sectionTag = "section"
     
     html = '<'+sectionTag+' class="iDevice_answer">'+lb
     
     # Checkbox
     fieldId = self.keyId+unicode((self.index+1));
     html += '<p class="iDevice_answer-field js-required">'+lb
     html += '<label for="'+fieldId+'" class="sr-av"><a href="#answer-'+fieldId+'">' + c_("Option")+' '+unicode((self.index+1))+'</a></label>'
     html += '<input type="radio" name="'+self.keyId+'" id="'+fieldId+'" value="'+unicode(self.index)+'" />'
     html += lb
     html += '</p>'+lb       
     
     # Answer content
     html += '<div class="iDevice_answer-content" id="answer-'+fieldId+'">'
     if dT != "HTML5":
         html += '<a name="answer-'+fieldId+'"></a>'
     html += lb
     if preview: 
         html += self.answerElement.renderPreview()
     else:
         html += self.answerElement.renderView()
     html += '</div>'+lb
     
     html += "</"+sectionTag+">"+lb
    
     return html    
开发者ID:Rafav,项目名称:iteexe,代码行数:36,代码来源:testoptionelement.py


示例16: __init__

    def __init__(self, parent, idevice):
        """
        Initialize a new Block object
        """
        Block.__init__(self, parent, idevice)
        self.idevice           = idevice
        self.questionElements  = []

        # to compensate for the strange unpickling timing when objects are 
        # loaded from an elp, ensure that proper idevices are set:
        if idevice.storyTextArea.idevice is None: 
            idevice.storyTextArea.idevice = idevice
            
        dT = common.getExportDocType()
        sectionTag = "div"
        if dT == "HTML5":
            sectionTag = "section"
            
        idevice.storyTextArea.htmlTag = sectionTag
        idevice.storyTextArea.class_ = "block story"

        self.storyElement      = TextAreaElement(idevice.storyTextArea)

        self.questionInstruc   = idevice.questionInstruc
        self.storyInstruc      = idevice.storyInstruc
        self.feedbackInstruc   = idevice.feedbackInstruc
        self.previewing        = False # In view or preview render 

        if not hasattr(self.idevice,'undo'): 
            self.idevice.undo = True

        i = 0
        
        for question in idevice.questions:
            self.questionElements.append(QuestionElement(i, idevice, question))
            i += 1
开发者ID:Rafav,项目名称:iteexe,代码行数:36,代码来源:ejercicioresueltofpdblock.py


示例17: copyFiles

    def copyFiles(self, package):
        """
        Copy all the files used by the website.
        """
        # Copy the style sheet files to the output dir
        # But not nav.css
        if os.path.isdir(self.stylesDir):
            # Copy the style sheet files to the output dir
            styleFiles  = [self.stylesDir/'..'/'base.css']
            styleFiles += [self.stylesDir/'..'/'popup_bg.gif']
            styleFiles += self.stylesDir.files("*.css")
            if "nav.css" in styleFiles:
                styleFiles.remove("nav.css")
            styleFiles += self.stylesDir.files("*.jpg")
            styleFiles += self.stylesDir.files("*.gif")
            styleFiles += self.stylesDir.files("*.png")
            styleFiles += self.stylesDir.files("*.js")
            styleFiles += self.stylesDir.files("*.html")
            styleFiles += self.stylesDir.files("*.ico")
            styleFiles += self.stylesDir.files("*.ttf")
            styleFiles += self.stylesDir.files("*.eot")
            styleFiles += self.stylesDir.files("*.otf")
            styleFiles += self.stylesDir.files("*.woff")
            self.stylesDir.copylist(styleFiles, self.outputDir)
            
        # copy the package's resource files
        package.resourceDir.copyfiles(self.outputDir)

        # copy script files.
        my_style = G.application.config.styleStore.getStyle(package.style)
        
        # jQuery
        if my_style.hasValidConfig:
            if my_style.get_jquery() == True:
                jsFile = (self.scriptsDir/'exe_jquery.js')
                jsFile.copyfile(self.outputDir/'exe_jquery.js')
        else:
            jsFile = (self.scriptsDir/'exe_jquery.js')
            jsFile.copyfile(self.outputDir/'exe_jquery.js')
            
        jsFile = (self.scriptsDir/'common.js')
        jsFile.copyfile(self.outputDir/'common.js')
        jsFile = (self.scriptsDir/'lernmodule_net.js')
        jsFile.copyfile(self.outputDir/'lernmodule_net.js')
        dT = common.getExportDocType()
        if dT == "HTML5":
            jsFile = (self.scriptsDir/'exe_html5.js')
            jsFile.copyfile(self.outputDir/'exe_html5.js')
            
        # Incluide eXe's icon if the Style doesn't have one
        themePath = Path(G.application.config.stylesDir/package.style)
        themeFavicon = themePath.joinpath("favicon.ico")
        if not themeFavicon.exists():
            faviconFile = (self.imagesDir/'favicon.ico')
            faviconFile.copyfile(self.outputDir/'favicon.ico')

        #JR Metemos los reproductores necesarios
        self.compruebaReproductores(self.page.node)


        if package.license == "license GFDL":
            # include a copy of the GNU Free Documentation Licence
            (self.templatesDir/'fdl.html').copyfile(self.outputDir/'fdl.html')
开发者ID:kohnle-lernmodule,项目名称:exe201based,代码行数:63,代码来源:singlepageexport.py


示例18: compruebaReproductores

    def compruebaReproductores(self, node):
        """
        Comprobamos si hay que meter algun reproductor
        """
        
    	# copy players for media idevices.                
        hasFlowplayer     = False
        hasMagnifier      = False
        hasXspfplayer     = False
        hasGallery        = False
        hasWikipedia      = False
        hasInstructions   = False
        hasMediaelement   = False

    	for idevice in node.idevices:
    	    if (hasFlowplayer and hasMagnifier and hasXspfplayer and hasGallery and hasWikipedia and hasInstructions and hasMediaelement):
    	    	break
    	    if not hasFlowplayer:
    	    	if 'flowPlayer.swf' in idevice.systemResources:
    	    		hasFlowplayer = True
    	    if not hasMagnifier:
    	    	if 'mojomagnify.js' in idevice.systemResources:
    	    		hasMagnifier = True
    	    if not hasXspfplayer:
    		    if 'xspf_player.swf' in idevice.systemResources:
    			    hasXspfplayer = True
            if not hasGallery:
                hasGallery = common.ideviceHasGallery(idevice)
            if not hasWikipedia:
    			if 'WikipediaIdevice' == idevice.klass:
    				hasWikipedia = True
            if not hasInstructions:
    			if 'TrueFalseIdevice' == idevice.klass or 'MultichoiceIdevice' == idevice.klass or 'VerdaderofalsofpdIdevice' == idevice.klass or 'EleccionmultiplefpdIdevice' == idevice.klass:
    				hasInstructions = True
            if not hasMediaelement:
                    hasMediaelement = common.ideviceHasMediaelement(idevice)
                            
        if hasFlowplayer:
            videofile = (self.templatesDir/'flowPlayer.swf')
            videofile.copyfile(self.outputDir/'flowPlayer.swf')
            controlsfile = (self.templatesDir/'flowplayer.controls.swf')
            controlsfile.copyfile(self.outputDir/'flowplayer.controls.swf')
        if hasMagnifier:
            videofile = (self.templatesDir/'mojomagnify.js')
            videofile.copyfile(self.outputDir/'mojomagnify.js')
        if hasXspfplayer:
            videofile = (self.templatesDir/'xspf_player.swf')
            videofile.copyfile(self.outputDir/'xspf_player.swf')
        if hasGallery:
            imageGalleryCSS = (self.cssDir/'exe_lightbox.css')
            imageGalleryCSS.copyfile(self.outputDir/'exe_lightbox.css') 
            imageGalleryJS = (self.scriptsDir/'exe_lightbox.js')
            imageGalleryJS.copyfile(self.outputDir/'exe_lightbox.js') 
            self.imagesDir.copylist(('exe_lightbox_close.png', 'exe_lightbox_loading.gif', 'exe_lightbox_next.png', 'exe_lightbox_prev.png'), self.outputDir)
        if hasWikipedia:
            wikipediaCSS = (self.cssDir/'exe_wikipedia.css')
            wikipediaCSS.copyfile(self.outputDir/'exe_wikipedia.css')
        if hasInstructions:
            common.copyFileIfNotInStyle('panel-amusements.png', self, self.outputDir)
            common.copyFileIfNotInStyle('stock-stop.png', self, self.outputDir)
        if hasMediaelement:
            mediaelement = (self.scriptsDir/'mediaelement')
            mediaelement.copyfiles(self.outputDir)
            dT = common.getExportDocType()
            if dT != "HTML5":
                jsFile = (self.scriptsDir/'exe_html5.js')
                jsFile.copyfile(self.outputDir/'exe_html5.js')

        for child in node.children:
            self.compruebaReproductores(child)
开发者ID:kohnle-lernmodule,项目名称:exe201based,代码行数:70,代码来源:singlepageexport.py


示例19: render

    def render(self, prevPage, nextPage, pages):
        """
        Returns an XHTML string rendering this page.
        """
        lenguaje = G.application.config.locale
        if self.node.package.dublinCore.language!="":
            lenguaje = self.node.package.dublinCore.language
        
        dT = common.getExportDocType()
        themeHasXML = common.themeHasConfigXML(self.node.package.style)
        lb = "\n" #Line breaks
        sectionTag = "div"
        articleTag = "div"
        headerTag = "div"
        navTag = "div"
        if dT == "HTML5":
            html = '<!doctype html>'+lb
            html += '<html lang="'+lenguaje+'">'+lb
            sectionTag = "section"
            articleTag = "article"
            headerTag = "header"
            navTag = "nav"
        else:
            html = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+lb
            html += u"<html lang=\"" + lenguaje + "\" xml:lang=\"" + lenguaje + "\" xmlns=\"http://www.w3.org/1999/xhtml\">"+lb
        html += u"<head>"+lb
        html += u"<link rel=\"stylesheet\" type=\"text/css\" href=\"base.css\" />"+lb
        if common.hasWikipediaIdevice(self.node):
            html += u"<link rel=\"stylesheet\" type=\"text/css\" href=\"exe_wikipedia.css\" />"+lb    
        if common.hasGalleryIdevice(self.node):
            html += u"<link rel=\"stylesheet\" type=\"text/css\" href=\"exe_lightbox.css\" />"+lb
        html += u"<link rel=\"stylesheet\" type=\"text/css\" href=\"content.css\" />"+lb
        html += u"<link rel=\"stylesheet\" type=\"text/css\" href=\"nav.css\" />"+lb
        html += u"<meta http-equiv=\"content-type\" content=\"text/html; "
        html += u" charset=utf-8\" />"+lb        
        html += u"<title>"
        if self.node.id=='0':
            if self.node.package.title!='':
                html += escape(self.node.package.title)
            else:
                html += escape(self.node.titleLong)
        else:
            if self.node.package.title!='':
                html += escape(self.node.titleLong)+" | "+escape(self.node.package.title)
            else:
                html += escape(self.node.titleLong)
        html += u" </title>"+lb
        html += u"<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />"+lb
        if dT != "HTML5" and self.node.package.dublinCore.language!="":
            html += '<meta http-equiv="content-language" content="'+lenguaje+'" />'+lb
        if self.node.package.author!="":
            html += '<meta name="author" content="'+self.node.package.author+'" />'+lb
        html += '<meta name="generator" content="eXeLearning '+release+' - exelearning.net" />'+lb
        if self.node.id=='0':
            if self.node.package.description!="":
                html += '<meta name="description" content="'+self.node.package.description+'" />'+lb
        if dT == "HTML5" or common.nodeHasMediaelement(self.node):
            html += u'<!--[if lt IE 9]><script type="text/javascript" src="exe_html5.js"></script><![endif]-->'+lb
        style = G.application.config.styleStore.getStyle(self.node.package.style)
        
        # jQuery
        if style.hasValidConfig:
            if style.get_jquery()==True:
                html += u'<script type="text/javascript" src="exe_jquery.js"></script>'+lb
            else:
                html += u'<script type="text/javascript" src="'+style.get_jquery()+'"></script>'+lb
        else:
            html += u'<script type="text/javascript" src="exe_jquery.js"></script>'+lb
        
        if common.hasGalleryIdevice(self.node):
            html += u'<script type="text/javascript" src="exe_lightbox.js"></script>'+lb
        html += common.getJavaScriptStrings()+lb
        html += u'<script type="text/javascript" src="common.js"></script>'+lb
        html += u'<script type="text/javascript" src="lernmodule_net.js"></script>'+lb
        if common.hasMagnifier(self.node):
            html += u'<script type="text/javascript" src="mojomagnify.js"></script>'+lb
        # Some styles might have their own JavaScript files (see their config.xml file)
        if style.hasValidConfig:
            html += style.get_extra_head()
        html += u"</head>"+lb
        html += u'<body class="exe-web-site"><script type="text/javascript">document.body.className+=" js"</script>'+lb
        html += u"<div id=\"content\">"+lb
        html += '<p id="skipNav"><a href="#main" class="sr-av">' + c_('Skip navigation')+'</a></p>'+lb

        if self.node.package.backgroundImg or self.node.package.title:
            html += u"<"+headerTag+" id=\"header\" "

            if self.node.package.backgroundImg:
                html += u" style=\"background-image: url("
                html += quote(self.node.package.backgroundImg.basename())
                html += u"); "

                if self.node.package.backgroundImgTile:
                    html += "background-repeat: repeat-x;"
                else:
           

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python common.hasGalleryIdevice函数代码示例发布时间:2022-05-24
下一篇:
Python common.formField函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap