當前位置: 首頁>>代碼示例>>Python>>正文


Python StringUtils.getFileNameFromURL方法代碼示例

本文整理匯總了Python中StringUtils.StringUtils.getFileNameFromURL方法的典型用法代碼示例。如果您正苦於以下問題:Python StringUtils.getFileNameFromURL方法的具體用法?Python StringUtils.getFileNameFromURL怎麽用?Python StringUtils.getFileNameFromURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在StringUtils.StringUtils的用法示例。


在下文中一共展示了StringUtils.getFileNameFromURL方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: readChecksum

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def readChecksum(self,line,pkg):
     strUtils = StringUtils()
     line=pkg.decodeContents(line)
     data = line.strip();
     words=data.split(" ")
     nrWords = len(words)
     if (nrWords != 3):
         print "Error: Unable to parse line: "+line
         return False
     value=words[2].split("=")
     if (len(value) != 2):
         print "Error: Unable to parse line: "+line
         return False
     matchedSources=[]
     for source in pkg.sources:
         sourceName=strUtils.getFileNameFromURL(source)
         if (sourceName.startswith(value[0])):
             matchedSources.append(sourceName)
     if (len(matchedSources) == 0):
         print "Error: Can not find match for sha1 "+value[0]
         return False
     if (len(matchedSources) > 1):
         print "Error: Too many matches in sources: "+matchedSources+" for sha1 "+value[0]
         return False
     pkg.checksums[sourceName] = value[1]
     return True;
開發者ID:DheerajSShetty,項目名稱:photon,代碼行數:28,代碼來源:SpecParser.py

示例2: _readChecksum

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def _readChecksum(self, line, pkg):
     strUtils = StringUtils()
     line = self._replaceMacros(line)
     data = line.strip()
     words = data.split()
     nrWords = len(words)
     if nrWords != 3:
         print("Error: Unable to parse line: " + line)
         return False
     value = words[2].split("=")
     if len(value) != 2:
         print("Error: Unable to parse line: "+line)
         return False
     matchedSources = []
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         if sourceName.startswith(value[0]):
             matchedSources.append(sourceName)
     if not matchedSources:
         print("Error: Can not find match for sha1 " + value[0])
         return False
     if len(matchedSources) > 1:
         print("Error: Too many matched Sources:" +
               ' '.join(matchedSources) + " for sha1 " + value[0])
         return False
     pkg.checksums[sourceName] = value[1]
     return True
開發者ID:TiejunChina,項目名稱:photon,代碼行數:29,代碼來源:SpecParser.py

示例3: _getPatchNames

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def _getPatchNames(self):
     patchNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for patch in pkg.patches:
         patchName = strUtils.getFileNameFromURL(patch)
         patchNames.append(patchName)
     return patchNames
開發者ID:frapposelli,項目名稱:photon,代碼行數:10,代碼來源:SpecParser.py

示例4: _getSourceNames

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def _getSourceNames(self):
     sourceNames = []
     strUtils = StringUtils()
     pkg = self.packages.get('default')
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         sourceNames.append(sourceName)
     return sourceNames
開發者ID:frapposelli,項目名稱:photon,代碼行數:10,代碼來源:SpecParser.py

示例5: getPatchNames

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def getPatchNames(self):
     patchNames = []
     strUtils = StringUtils()
     pkg = self.spec.packages.get("default")
     if pkg is None:
         return None
     for patch in pkg.patches:
         patchName = strUtils.getFileNameFromURL(patch)
         patchNames.append(patchName)
     return patchNames
開發者ID:casualjim,項目名稱:photon,代碼行數:12,代碼來源:SpecUtils.py

示例6: getSourceNames

# 需要導入模塊: from StringUtils import StringUtils [as 別名]
# 或者: from StringUtils.StringUtils import getFileNameFromURL [as 別名]
 def getSourceNames(self):
     sourceNames = []
     strUtils = StringUtils()
     pkg = self.spec.packages.get("default")
     if pkg is None:
         return None
     for source in pkg.sources:
         sourceName = strUtils.getFileNameFromURL(source)
         sourceNames.append(sourceName)
     return sourceNames
開發者ID:casualjim,項目名稱:photon,代碼行數:12,代碼來源:SpecUtils.py


注:本文中的StringUtils.StringUtils.getFileNameFromURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。