本文整理匯總了Python中Project.Project.find_file_for_import方法的典型用法代碼示例。如果您正苦於以下問題:Python Project.find_file_for_import方法的具體用法?Python Project.find_file_for_import怎麽用?Python Project.find_file_for_import使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Project.Project
的用法示例。
在下文中一共展示了Project.find_file_for_import方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: find_imports
# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import find_file_for_import [as 別名]
def find_imports():
print "test hello"
fname=lisp.buffer_file_name()
print "remember:" + lisp.buffer_name()
os.environ['BUFFER'] = lisp.buffer_name()
remember_where = lisp.point()
try:
fname=lisp.buffer_file_name()
project = Project(fname)
thing, start = thing_at_point_regex("\W", "\W")
print "thing:"+thing
imports = project.find_file_for_import(thing)
if (len(imports) > 1):
ready_output()
lisp.insert("\n")
for item in imports:
lisp.insert(item)
lisp.insert("\n")
elif (len(imports) == 1):
put_import(fname, imports[0])
elif (len(imports) == 0):
lisp.message("No import found for " + imports[0])
lisp.goto_char(remember_where)
except Exception, e:
lisp.message(e)