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


Python Project.find_declaration_type方法代码示例

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


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

示例1: find_public_methods

# 需要导入模块: from Project import Project [as 别名]
# 或者: from Project.Project import find_declaration_type [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: goto_definition

# 需要导入模块: from Project import Project [as 别名]
# 或者: from Project.Project import find_declaration_type [as 别名]
def goto_definition():
    """
    go to definition/declaration of the pointer we are looking at
    """
    fname=lisp.buffer_file_name()
    a = Project(fname)
    thing, start = thing_at_point(RIGHT1, LEFT1)
    lisp.message(thing)
    pos = lisp.point()
    type, pos = a.find_declaration_type(thing, fname, pos)
    lisp.goto_char(pos)
开发者ID:hamed3210,项目名称:kod,代码行数:13,代码来源:pyjde.py

示例3: Project

# 需要导入模块: from Project import Project [as 别名]
# 或者: from Project.Project import find_declaration_type [as 别名]
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"
print re.sub(r'/\w*.java$',"/UserDao"+".java", s)

t = Project(currdir + "/./test")
s = t.find_file_for_thing("C", currdir + "/test/test/bla/B.java")
开发者ID:hamed3210,项目名称:kod,代码行数:32,代码来源:testmyclass.py


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