当前位置: 首页>>代码示例>>Python>>正文


Python Utils.toSmartLink方法代码示例

本文整理汇总了Python中utils.Utils.toSmartLink方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.toSmartLink方法的具体用法?Python Utils.toSmartLink怎么用?Python Utils.toSmartLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.Utils的用法示例。


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

示例1: Keyword

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]
class Keyword(BaseExtension):

    def __init__(self):
        BaseExtension.__init__(self)
        self.utils = Utils()

    def excute(self, form_dict):
        url = form_dict['url'].encode('utf8')
        print url
        selection = form_dict['selection']
        print selection
        keywords = []
        keyword_dict = {}
        if selection != None:
            engins = ['google', 'bing', 'amazon', 'youtube']
            for e in engins:
                r = requests.get('http://tools.seochat.com/components/com_seotools/tools/suggest-tool/' + e + 'all.php?q=' + selection)
                jobj = json.loads(r.text)
                for item in jobj:
                   if type(item) != type([]) and item.find('fieldset>') == -1:
                        if keyword_dict.has_key(item.strip()) == False:
                            keyword_dict[item.strip()] = item.strip()
                            keywords.append(item.strip())
            html = '<div class="ref"><ol>'
            count = 0
            ref_divID = form_dict['divID']
            key = form_dict['rID']
            for k in keywords:
                count += 1
                ref_divID += '-' + str(count)
                linkID = 'a-' + ref_divID[ref_divID.find('-') + 1 :]
                appendID = str(count)
                script = self.utils.genMoreEnginScript(linkID, ref_divID, "loop-" + key.replace(' ', '-') + '-' + str(appendID), k, '', '-')
                print k
                html += '<li><span>' + str(count) + '.</span>'
                html += '<p>' + self.utils.toSmartLink(k)
                if script != '':
                    html += self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', ref_divID, '', False);
                html +='</p></li>'
            return html + '</ol></div>'
        return 'nothing'

        

    def check(self, form_dict):
	return form_dict['rID'] != None and form_dict['rID'].startswith('loop') == False
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:48,代码来源:keyword.py

示例2: Outline

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]
class Outline(BaseExtension):

    def __init__(self):
	   BaseExtension.__init__(self)
	   self.utils = Utils()

    def excute(self, form_dict):
        url = form_dict['url'].encode('utf8')
        url = url.replace('#space', ' ')
        divID = form_dict['divID']
        rID = form_dict['rID']
        cmd = './outline.py -i "' + url + '"'
        output = subprocess.check_output(cmd, shell=True).strip()
        html = '<div class="ref"><ol>'
        count = 0
        for line in output.split('\n'):
            if line.strip() == '':
                continue
            count += 1
            html += '<li><span>' + str(count) + '.</span>'
            html += '<p>' + self.utils.toSmartLink(line.strip())

            divID += '-' + str(count)
            linkID = 'a-' + divID[divID.find('-') + 1 :]
            appendID = str(count)
            script = self.utils.genMoreEnginScript(linkID, divID, "loop-o-" + rID.replace(' ', '-') + '-' + str(appendID) , line, '', '-', hidenEnginSection=Config.bookmark_hiden_engin_section)
            html += self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', divID, '', False);


            html += '</p></li>'

        html += '</ol></div>'
        return html


    def check(self, form_dict):
        url = form_dict['url'].encode('utf8').strip()
        print url
        #print url.startswith('http') == False
        print url != '' and url.startswith('http') == False and url.endswith('.pdf')
        return url != '' and url.startswith('http') == False and url.endswith('.pdf')
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:43,代码来源:outline.py

示例3: Preview

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]

#.........这里部分代码省略.........
                    urls.append(url + self.preview_url_args + str(page))

            return self.previewPages(texts, urls)


        if url.find('[') != -1 and url.find(']') != -1:
            keys = []
            value = ''

            if url.startswith('['):
                keys = self.utils.splitText(url[1:url.find(']')])
                value = url[url.find('(') + 1 : url.find(')')]
            else:
                part1 = url[0 : url.find('[')]
                part2 = url[url.find(']') + 1 : ]
                keys = self.utils.splitText(url[url.find('[') + 1 : url.find(']')])
                value = part1 + '%s' + part2

            for k in keys:
                texts.append(k.replace('%20', ' '))
                if value.startswith('http'):
                    urls.append(value.replace('%s', k))
                else:
                    urls.append(self.utils.toQueryUrl(self.utils.getEnginUrl(value), k))

            return self.previewPages(texts, urls)
        elif url.find(',') != -1:
            urls = url.split(',')
            return self.previewPages(urls, urls)



        if url == '':
            url = self.utils.toSmartLink(form_dict['rTitle'].encode('utf8'))
	src = ''
	width = str(int(screenWidth) / 3 + 50)
	height = str(int(screenHeight) / 3 + 50)
	column = form_dict['column']
        if url.startswith('file') or url.startswith('/User'):
            subprocess.check_output("/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome " + url, shell=True)
            return 'ok'
    
        if column == '1':
            width = str(int(screenWidth) - 70)
            height = str(int(screenHeight) - 150)
        elif column == '2':
            width = str(int(screenWidth) / 2 - 20)
            height = str(int(screenHeight) / 2 - 50)


	if url.find('youtube') != -1 and url.find('watch') != -1:
	    src = "https://www.youtube.com/embed/" + url[url.rfind('v=') + 2 :]
	    if column == '1':
	        width = str(int(screenWidth) / 3 + 200)
	        height = str(int(screenHeight) / 2)
        elif url.find('163') != -1:
            src = url.replace('open', 'v')
        elif rID.find('arxiv') != -1:
            arxiv_id = rID[rID.find('arxiv-') + 6 :].replace('-', '.')
            version = self.utils.get_last_arxiv_version(arxiv_id)
            src = 'http://arxiv.org/pdf/' + arxiv_id + version
	else:
	    src = url
	    if self.utils.suportFrame(url, 5) == False:
		return url
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:69,代码来源:preview.py

示例4: Milestone

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]
class Milestone(BaseExtension):

    record_milestone = {}
    html = ''

    def __init__(self):
        BaseExtension.__init__(self)
        self.utils = Utils()

    def loadMilestone(self, filename, rID):
        print 'loadMilestone ' + filename
        #if len(self.record_milestone) != 0 and self.record_milestone.has_key(rID):
        #    return
        name = 'extensions/milestone/data/' + filename + '-milestone'
        record_milestone_back = {}
        if os.path.exists(name):
            f = open(name, 'rU')
            all_lines = f.readlines()
            for line in all_lines:
                if line.startswith('#'):
                    continue
                record = Record(line)
                key = record.get_id().strip()
                if key != rID:
                    continue

                if record_milestone_back.has_key(key):
                    record_milestone_back[key].append(record)
                else:
                    record_milestone_back[key] = [record]

        if record_milestone_back.has_key(rID) and len(record_milestone_back[rID]) > 0:
            #if len(record_milestone_back[rID]) > 20:
            record_milestone_back[rID] = reversed(record_milestone_back[rID])

            self.record_milestone[rID] = record_milestone_back[rID]
        

        #for (k, v) in self.record_milestone.items():
        #    print k

    def excute(self, form_dict):
      
        fileName = form_dict['fileName'].encode('utf8')
        rID = form_dict['rID'].encode('utf8')

        self.loadMilestone(self.formatFileName(fileName), rID)
        #print self.record_milestone
        if self.record_milestone.has_key(rID):
            return self.genMilestoneHtml(rID, form_dict['divID'].encode('utf8'))

        return 'not found'


    def check(self, form_dict):
        fileName = form_dict['fileName'].encode('utf8')
        rID = form_dict['rID'].encode('utf8')
        self.loadMilestone(self.formatFileName(fileName), rID)
        return self.record_milestone.has_key(rID)
                

    def genMilestoneHtml(self, rID, ref_divID):
        return self.genMetadataHtml(rID, ref_divID)

    def genMetadataHtml(self, key, ref_divID):
        if self.record_milestone.has_key(key):
            self.html = '<div class="ref"><ol>'
            count = 0
            print 'sdsd'
            for r in self.record_milestone[key]:
                count += 1
                ref_divID += '-' + str(count)
                linkID = 'a-' + ref_divID[ref_divID.find('-') + 1 :]
                appendID = str(count)
                script = self.utils.genMoreEnginScript(linkID, ref_divID, "loop-" + key.replace(' ', '-') + '-' + str(appendID), self.utils.clearHtmlTag(r.get_title().strip()), r.get_url().strip(), '-')

                title = r.get_title().strip()
                id = title[0 : title.find(' ')].strip()
                self.html += '<li><span>' + id + '.</span>'
                if len(id) > 4:
                    self.html += '<br>'

                if script != "" and len(title[title.find(' ') + 1 :].strip()) < 20:
                    self.html += '<p>' + self.utils.toSmartLink(title[title.find(' ') + 1 :].strip())
                    self.html += self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', ref_divID, '', False);
                else:
                    self.html += '<p>' + title[title.find(' ') + 1 :].strip()
                self.html += '</p></li>'
            return self.html + "</ol></div>"
        else:
            return ''
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:93,代码来源:milestone.py

示例5: Filefinder

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]
class Filefinder(BaseExtension):
    form_dict = None
    def __init__(self):
        BaseExtension.__init__(self)
        self.utils = Utils()


    def excute(self, form_dict):
        self.form_dict = form_dict
        rTitle = form_dict['rTitle'].encode('utf8').replace('%20', ' ').strip()
        if rTitle.strip() == '' or len(rTitle.strip()) < 3:
            return ''
        rID = form_dict['rID']
        fileName = form_dict['fileName'].encode('utf8')
        originFileName = form_dict['originFileName'].encode('utf8')
        url = ''
        if form_dict.has_key('url'):
            url = form_dict['url'].replace('#space', ' ')
        nocache = True
        if form_dict.has_key('nocache'):
            nocache = form_dict['nocache'].encode('utf8')
        use_cache = nocache == False
        html = ''
        record = None
        if rID.startswith('loop-h-'):
            path = originFileName[0 : originFileName.find('db')] + 'extensions/history/data/' + originFileName[originFileName.rfind('/') + 1 :] + '-history'
            print path
            record = self.utils.getRecord(rTitle, path=path, log=True, use_cache=False, matchType=2, accurate=False)
        elif rID.startswith('loop-hc-'):
            path = fileName[0 : fileName.find('db')] + 'extensions/content/data/' + fileName[fileName.rfind('/') + 1 :] + '-history-content'
            print path
            record = self.utils.getRecord(rTitle, path=path, log=True, use_cache=False, matchType=2, accurate=False)

        elif rTitle.startswith('library/'):
            record = self.utils.crossref2Record(rTitle.replace('==', '->'))
            rTitle = record.get_title().strip()

            print record.line
        else:
            record = self.utils.getRecord(rID.strip(), path=form_dict['fileName'], log=True, use_cache=use_cache)


        aliasList = self.getAliasList(record)
        divID = form_dict['divID'].encode('utf8')

        if divID.find('-dbfile-') != -1:
            #keywords = aliasList + [rTitle.replace('%20', ' ')]
            keyword = rTitle.replace('%20', ' ').strip()
            dbFileList = self.genFileList(self.getMatchFiles2(keyword, [form_dict['originFileName'][form_dict['originFileName'].find('db/') :], form_dict['fileName'][form_dict['fileName'].find('db/') :]], 'db'))
            if dbFileList != '':
                html += 'matched db files(' + str(keyword) + '):<br>' + dbFileList
            return html


        if form_dict.has_key('selection') and form_dict['selection'] != '':
            rTitle = form_dict['selection'].strip()
        
        localFiles = self.genFileList(self.getMatchFiles(rTitle.strip(), url=url).split('\n'), divID=divID, rID=rID, url=url, higtLightText=rTitle.strip())
        #print localFiles
        if localFiles != '':
            if form_dict.has_key('extension_count') and int(form_dict['extension_count']) > 12:
                html += '<br>'
            html += localFiles

        
        count = 0
        if self.isDir(url) == False:
            for alias in aliasList:
                #print alias
                count += 1
                result = self.genFileList(self.getMatchFiles(alias.strip()).split('\n'),divID=divID + '-alias-' + str(count), rID=rID, higtLightText=alias.lower().strip())
                if result != '':
                    html += '<br>' + alias + ':<br>' + result

        if fileName.find('exclusive') != -1:
            keyword = rTitle.replace('%20', ' ').strip()
            dbFileList = self.genFileList(self.getMatchFiles2(keyword, [], 'db/library'))
            if dbFileList != '':
                html += 'matched library files(' + str(keyword) + '):<br>' + dbFileList

        for netdisk in Config.filefinder_netdisk_engin:

            html += '<div class="ref"><br>Search ' + netdisk + '<br>' + self.utils.toSmartLink(rTitle, engin=netdisk, showText='<font size="2">' + rTitle.replace('%20', ' ') + '</font>', rid=self.form_dict['rID'], library=self.form_dict['originFileName'], module='filefinder') + ' '
            count = 1
            for alias in aliasList:
                count += 1
                html += self.utils.toSmartLink(alias.strip(), engin=netdisk, showText=str('<font size="2">' + alias + '</font>'), rid=self.form_dict['rID'], library=self.form_dict['originFileName'], module='filefinder') + ' '
                #html += '&nbsp;'
            html += '</div>'
        if rID.startswith('loop') == False:
            
            fileDivID = divID + '-dbfile-' + str(random.randint(0, 1000))
            fileLinkID = divID + '-dbfile-a-' + str(random.randint(0, 1000))

            html += '<div id="' + fileDivID + '" class="ref">'

            if len(aliasList) == 0:
                script = "var postArgs = {name : 'filefinder', rID : '" + rID + "', rTitle : '" + rTitle +"', check: 'false', fileName : '" + fileName + "', divID : '" + fileDivID + "', originFileName : '" + form_dict['originFileName'] + "'};";
                script += "$('#' + '" + fileDivID +"').load('/extensions', postArgs, function(data) { });$('#' + '" + fileDivID +"').html('Loading...');"
                html += '<a id="' + fileLinkID + '" href="javascript:void(0);" onclick="' + script + '" style="font-size:12pt;">Search Local DB</a><br> '
#.........这里部分代码省略.........
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:103,代码来源:filefinder.py

示例6: Reference

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]

#.........这里部分代码省略.........
        obj = sp.find('span', class_='stat view-count')
        views = ''
        font_size = 0
        if obj != None:
            views = sp.find('span', class_='stat view-count').text.strip().strip()
            views = views[0 : views.find(' ')]
            font_size = len(views.replace(',', ''))
        if font_size - 2 > 0:
	        font_size -= 2
        title += '<font size="' + str(font_size) + '" color="rgb(212, 51, 51)">' + views + '</font> views'
        return self.utils.removeDoubleSpace(title)

    def check(self, form_dict):
        fileName = form_dict['fileName'].encode('utf8')
        rID = form_dict['rID'].encode('utf8')
        url = form_dict['url'].encode('utf8')
        if url == '':
            return False
        self.loadReference(self.formatFileName(fileName), rID)
        if self.record_reference.has_key(rID) or fileName.find('papers') != -1 or form_dict['url'] != '' and form_dict['url'].startswith('http'):
            return True
        return False
                

    def genReferenceHtml2(self, alist, divid, defaultLinks, rID):
        return self.genMetadataHtml2(alist, divid, defaultLinks, rID)
    
    def genMetadataHtml2(self, alist, ref_divID, defaultLinks, rID):
            self.html = '<div class="ref"><ol>'
            count = 0
            for r in alist:
                if self.passItem(r[0], r[1]):
                    continue
                count += 1
                ref_divID += '-' + str(count)
                linkID = 'a-' + ref_divID[ref_divID.find('-') + 1 :]
                appendID = str(count)
                if rID.startswith('loop'):
                    appendID = rID[rID.rfind('-') + 1 :].replace('R', '.') + '.' + str(count) 
                    self.html += '<li><span>' + appendID + '.</span>'
                    if len(appendID) >= 5:
                        self.html += '<br/>'
                    appendID = appendID.replace('.','R')
                else:
                    self.html += '<li><span>' + str(count) + '.</span>'
                script = self.utils.genMoreEnginScript(linkID, ref_divID, "loop-" + rID.replace(' ', '-') + '-' + str(appendID), r[0], r[1], '-', hidenEnginSection=Config.reference_hiden_engin_section)
                if r[1] != '':
                    self.html += '<p>' + self.utils.enhancedLink(r[1], self.utils.formatTitle(r[0], Config.reference_smart_link_br_len), module='reference', rid=rID, library=self.form_dict['originFileName'])
                else:
                    self.html += '<p>' + self.utils.toSmartLink(r[0], Config.reference_smart_link_br_len, module='reference', rid=rID, library=self.form_dict['originFileName'])
                #self.html += self.utils.getDefaultEnginHtml(r[0], defaultLinks)
                if script != "":
                    self.html += self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', ref_divID, '', False);
                #title = a.text.strip()
                self.html += '</p></li>'
            return self.html + "</ol></div>"


    def genReferenceHtml(self, rID, ref_divID):
        return self.genMetadataHtml(rID, ref_divID)

    def genMetadataHtml(self, key, ref_divID):
        if self.record_reference.has_key(key):
            self.html = '<div class="ref"><br><ol>'
            if self.form_dict['column'] == '1':
                self.html = '<div class="ref"><ol>'
            count = 0
            for r in self.record_reference[key]:
                count += 1
                ref_divID += '-' + str(count)
                linkID = 'a-' + ref_divID[ref_divID.find('-') + 1 :]
                appendID = str(count)
                script = self.utils.genMoreEnginScript(linkID, ref_divID, "loop-" + key.replace(' ', '-') + '-' + str(appendID), self.utils.clearHtmlTag(r.get_title().strip()), r.get_url().strip(), '-', hidenEnginSection=Config.reference_hiden_engin_section)

                self.html += '<li><span>' + str(count) + '.</span>'
                self.html += '<p>' + self.genMetadataLink(r.get_title().strip(), r.get_url().strip(), rID=key)
                if script != "":
                    self.html += self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', ref_divID, '', False);
                self.html += '</p></li>'
            return self.html + "</ol></div>"
        else:
            return ''


    def genMetadataLink(self, title, url, rID=''):
        if url.find('[') != -1:
            ft = url.replace('[', '').replace(']', '').strip()
            r = self.utils.getRecord(ft, '','', False, False)
            key = r.get_path()[r.get_path().find(default_subject) + len(default_subject) + 1 :]
            url = 'http://' + Config.ip_adress + '?db=' + default_subject + '/&key=' + key + '&filter=' + ft  + '&desc=true'

        return self.genMetadataLinkEx(title, url, rID=rID)


    def genMetadataLinkEx(self, title, url, rID=''):
        if title.find('<a>') != -1:
            title = title.replace('<a>', '<a target="_blank" href="' + url + '">')
        else:
            title = self.utils.enhancedLink(url, self.utils.formatTitle(title, Config.reference_smart_link_br_len), module='reference', rid=rID, library=self.form_dict['originFileName'])
        return title
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:104,代码来源:reference.py

示例7: Content

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import toSmartLink [as 别名]

#.........这里部分代码省略.........
            if contentref != None:

                return contentref.strip()
        return ''


    def write(self, html):
        f = open('temp/test.html', 'w')
        for line in html:
            f.write(line)
        #print 'write ' + html + ' to file'
        f.close

    def genContentHtml(self, key, content_divID, defaultLinks, library):
        return self.genMetadataHtml(key, content_divID, defaultLinks, library)

    def genMetadataHtml(self, key, content_divID, defaultLinks, library):
        html = '<div class="ref"><ol>'
        if self.form_dict['column'] == '3' and int(self.form_dict['extension_count']) > 10:
            html = '<div class="ref"><br><ol>'

        count = 0
        #print 'key:' + key
        #print self.datafile_content
        if self.datafile_content.has_key(key):
            self.record_content = self.datafile_content
        elif self.optional_content.has_key(key):
            self.record_content = self.optional_content

        if self.record_content.has_key(key):
            #print key
            for r in self.record_content[key]:
                count += 1
                format_index = ''
                pRecord = None
                pid = r.get_parentid().strip()
                if self.record_content.has_key(pid) and key.find('-') != -1:
                    pRecord = self.record_content[pid] 
		    if content_divID.find(self.data_type) == content_divID.rfind(self.data_type):
                        format_index = str(count)
		    else:
                        format_index = pid[pid.rfind('-') + 1 :] + '.' + str(count)
                elif r.get_id().find('-') != -1:
                    format_index = r.get_id()[r.get_id().rfind('-') + 1 : ].strip()
		while format_index.find('-') != -1:
		    format_index = format_index[format_index.find('-') + 1 :]
                html += '<li><span>' + format_index + '</span>'
                if len(format_index) > 5:
                    html += '</li><br/><li>'
                
                content_divID += '-' + str(count)
                linkID = 'a-' + content_divID[content_divID.find('-') + 1 :]
                title = r.get_title().strip().replace(' ', '%20')
                desc = r.get_describe().strip()
                script = self.utils.genMoreEnginScript(linkID, content_divID, r.get_id().strip(), self.utils.clearHtmlTag(title), r.get_url().strip(), '-', hidenEnginSection=Config.content_hiden_engin_section)
                
                descHtml = ''

                if desc != '':

                    descHtml = self.utils.genDescHtml(desc, Config.course_name_len, self.tag.tag_list, iconKeyword=True, fontScala=1, module='history')
            


                moreHtml = self.utils.genMoreEnginHtml(linkID, script.replace("'", '"'), '...', content_divID, '', False, descHtml=descHtml);
                if self.record_content.has_key(r.get_id().strip()) or r.get_url().strip() == '':
                    if r.get_url().strip() != '':
                        html += '<p>' + self.genMetadataLink(r.get_title().strip(), r.get_url().strip())
                    else:
                        html += '<p>' + self.utils.toSmartLink(r.get_title().strip(), 45, module='content', rid=self.form_dict['rID'], library=library)
                    #html += self.utils.getDefaultEnginHtml(title, defaultLinks)
                    if moreHtml != "":
                        html += moreHtml
                    html += '</p>'
                elif r.get_url().strip() != '':
                    html += '<p>' + self.genMetadataLink(r.get_title().strip(), r.get_url().strip())  + moreHtml + '</p>'
                html += '</li>'
        else:
            return ''

        html += "</ol></div>"
        return html


    def genMetadataLink(self, title, url):
        if url.find('[') != -1:
            ft = url.replace('[', '').replace(']', '').strip()
            r = self.utils.getRecord(ft, '','', False, False)
            key = r.get_path()[r.get_path().find(default_subject) + len(default_subject) + 1 :]
            url = 'http://' + Config.ip_adress + '?db=' + default_subject + '/&key=' + key + '&filter=' + ft  + '&desc=true'

        return self.genMetadataLinkEx(title, url)


    def genMetadataLinkEx(self, title, url):
        if title.find('<a>') != -1:
            title = title.replace('<a>', '<a target="_blank" href="' + url + '">')
        else:
            title = self.utils.enhancedLink(url, self.utils.formatTitle(title, 45), module='content', rid=self.form_dict['rID'], library=self.form_dict['originFileName'])
        return title
开发者ID:wowdd1,项目名称:xlinkBook,代码行数:104,代码来源:content.py


注:本文中的utils.Utils.toSmartLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。