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


Python Project.find_file_for_thing方法代碼示例

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


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

示例1: find_public_methods

# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import find_file_for_thing [as 別名]
def find_public_methods(): 
    """
    retrieves all public methods of class
    """
    try:        
        fname=lisp.buffer_file_name()
        print "remember:" + lisp.buffer_name()
        os.environ['BUFFER'] = lisp.buffer_name()

        project = Project(fname)

        thing, start = thing_at_point(RIGHT3, LEFT3)
        thing = thing.replace(".","")
        print "thing:"+thing

        pos = lisp.point()
        type, foundpos = project.find_declaration_type(thing, fname, pos)

        typefile = project.find_file_for_thing(type, fname)
        c = Class(project, typefile)
        public_methods = c.list_all_public() 

        if (len(public_methods) == 0): 
            lisp.message("No public methods found")
        else:
            ready_output()    
            lisp.insert("\n")
            for item in public_methods:
                lisp.insert(item)
                lisp.insert("\n")
    except Exception, e:
        lisp.message(e)
開發者ID:hamed3210,項目名稱:kod,代碼行數:34,代碼來源:pyjde.py

示例2: find_file_at_symbol

# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import find_file_for_thing [as 別名]
def find_file_at_symbol():
    """
    finds file at point
    """
    fname=lisp.buffer_file_name()
    a = Project(fname)
    thing, start = thing_at_point(RIGHT1, LEFT1)
    file = a.find_file_for_thing(thing, fname)    
    lisp.message(file)
    lisp.find_file(file)
開發者ID:hamed3210,項目名稱:kod,代碼行數:12,代碼來源:pyjde.py

示例3: Project

# 需要導入模塊: from Project import Project [as 別名]
# 或者: from Project.Project import find_file_for_thing [as 別名]
try:
    print a.find_prj_el("/tmp")
except Exception:
    print "exception raised"

print a.get_src_dir(currdir + "/./test")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_all_descendants("A")

print t.run_command('ls')

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("C", currdir + "/test/test/bla/B.java")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
type, pos = t.find_declaration_type("anani", currdir + "/test/test/bla/B.java", 423)

os.system("cp " + currdir + "/test/lib/commons-logging.jar /tmp/")
t = Project(currdir + "/./test")
print t.top_src_dir
t.unjar()

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("D", currdir + "/test/test/bla/B.java")

s = "/home/burak/kod/pocketbudda/src/java/com/pocketbudda/UserHandlerBean.java"
開發者ID:hamed3210,項目名稱:kod,代碼行數:33,代碼來源:testmyclass.py


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