本文整理匯總了Python中modulefinder.ModuleFinder.any_missing方法的典型用法代碼示例。如果您正苦於以下問題:Python ModuleFinder.any_missing方法的具體用法?Python ModuleFinder.any_missing怎麽用?Python ModuleFinder.any_missing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類modulefinder.ModuleFinder
的用法示例。
在下文中一共展示了ModuleFinder.any_missing方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: spider
# 需要導入模塊: from modulefinder import ModuleFinder [as 別名]
# 或者: from modulefinder.ModuleFinder import any_missing [as 別名]
def spider(self):
print '-' * 40
while len(self.full_path) != 0:
full_path = self.full_path.pop()
self.full_path_discard.append(full_path)
finder = ModuleFinder()
finder.run_script(full_path)
for name, mod in finder.modules.iteritems():
full_path = str(mod.__file__).replace('.', '/')
if full_path not in self.full_path_discard:
if full_path.startswith('/home/alfred/pipline/code/'):
self.result.append(name.replace('.', '/'))
if not full_path.startswith('/home/alfred/pipline/code/U'):
self.full_path.append(full_path)
else:
self.full_path_discard.append(full_path)
names = finder.any_missing()
for name in names:
for folder in self.all_path:
try:
full_path = folder + name + '.py'
if os.path.isfile(full_path):
if full_path not in self.full_path_discard:
self.full_path.append(full_path)
self.result.append(full_path)
except:
pass
for item in sorted(set(self.result)):
print item
print '='*100