473,702 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

idutils and Python

Dear All,

Has anybody tried to use ID Utils
(http://www.gnu.org/software/idutils/46) with Python? I've googled, searched
the mailing list, and have found nothing.

A silly, simple use of IDUtils with Python code does work, using a language
map that says *.py files are text files. But I am wondering if someone has
done something more sophisticated. (For instance, I get matches to
commented out functions, which I'd rather not, lots of extra stuff is
indexed which probably shouldn't, etc).

Thanks,

R.

P.D. ID utils is somewhat like [ce]tags, and has support under Emacs
(see section 5.2 of the ID utils manual:
http://www.gnu.org/software/idutils/...id-interface47
). One nice feature is that, when searching for matches, it shows the
results in a compilation buffer, so you can see where, in each file,
the identifier is used, and visit that if you want. I like this a lot
better than "tags-search".

--
Ramon Diaz-Uriarte
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Aug 22 '06 #1
5 2522
Ramon Diaz-Uriarte wrote:
Dear All,

Has anybody tried to use ID Utils
(http://www.gnu.org/software/idutils/46) with Python?
What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.

Aug 22 '06 #2
On 21 Aug 2006 22:56:13 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net53 --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.

Sorry for not being clear enough. I want the following:

a) have my editor go to the point where a function/whatever is defined

b) see all places where a function/whatever is used.

I've tried exuberant ctags and I do like it a lot. a) is done
wonderfully (within emacs, the editor I use, but also in other
editros, from what I've read). However, b) does not work exactly as
I'd like:

1. With Emacs and tags: using "tags-search" I can visit, one by one,
all places where a function is called, but I'd like to see where it is
called before visting that file and know, before visiting each file in
turn, whether I'll visit 1 or 20 files (or, to put it in another way,
I'd like to see like a poor-mans static callgraph).

2. From what I understand, there is a deeper difference than just how
results are shown: the tags file contains the places where, say, a
function is defined, but finding where it is used requires running
grep on every file looking for the tag. (I believe that is what
"tags-search" does in emacs). In contrast, ID utils does not do any
grep, but directly goes to the ID file, where all that is already
pre-stored, which also means that it will be a lot faster than
grepping for the tags.

A tool similar to IDutils is Global
http://www.gnu.no/software/global/, but it also does not incorporate
Python support. (Though defining other parsers might be simple; I
haven't looked at it closely).

I think the wish "do not use grep, just look at the index file, and
immediately display all matches" is reasonable and probably other
Python coders had thought about it before. But I am wondering if I am
missing something obvious, as most people seem to be very happy with
exuberant ctags.
Thanks,

R.

On 21 Aug 2006 22:56:13 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
Ramon Diaz-Uriarte wrote:
Dear All,

Has anybody tried to use ID Utils
(http://www.gnu.org/software/idutils/4652) with Python?

What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net53 --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.

--
http://mail.python.org/mailman/listinfo/python-list54

--
Ramon Diaz-Uriarte
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Aug 22 '06 #3
Ramon Diaz-Uriarte wrote:
On 21 Aug 2006 22:56:13 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net53 --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.


Sorry for not being clear enough. I want the following:

a) have my editor go to the point where a function/whatever is defined
That's usually ctags/etags
b) see all places where a function/whatever is used.
That's usually cscope http://cscope.sourceforge.net/ but I've not
tried to use it with Python before; from the web page it looks like it
may be worth a spin:
"The fuzzy parser supports C, but is flexible enough to be useful for
C++ and Java, and for use as a generalized 'grep database' (use it to
browse large text documents!"

The vim integration is very nice. It has emacs integration too, but I
haven't used it and can't comment on how good it is.
I think the wish "do not use grep, just look at the index file, and
immediately display all matches" is reasonable and probably other
Python coders had thought about it before. But I am wondering if I am
missing something obvious, as most people seem to be very happy with
exuberant ctags.
I am usually happy with grep, but we only have a medium-large size
project (320,000 lines of Python code); I can imagine on very large
codebases that would be too slow to be practical.

Aug 22 '06 #4
On 22 Aug 2006 10:04:12 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
That's usually cscope http://cscope.sourceforge.net/ but I've not
tried to use it with Python before; from the web page it looks like it
may be worth a spin:
"The fuzzy parser supports C, but is flexible enough to be useful for
C++ and Java, and for use as a generalized 'grep database' (use it to
browse large text documents!"
Thanks for your answer. I'll take a new look at cscope (I think I
looked at it, but discarded because it seemed to focus on C/C++; never
noticed it is possible use as a general browser for large text
collections).
I am usually happy with grep, but we only have a medium-large size
project (320,000 lines of Python code); I can imagine on very large
codebases that would be too slow to be practical.
I am generally happy with grep (and your code is much larger than
ours) but idutils' output offers both that and, by showing all
together, a kind of poor-man's static call graph, and can be of use
when refactoring.

Thanks again,

R.

On 22 Aug 2006 10:04:12 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
Ramon Diaz-Uriarte wrote:
On 21 Aug 2006 22:56:13 -0700, sj*******@yahoo .com <sj*******@yaho o.comwrote:
What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net53 --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.

Sorry for not being clear enough. I want the following:

a) have my editor go to the point where a function/whatever is defined

That's usually ctags/etags
b) see all places where a function/whatever is used.

That's usually cscope http://cscope.sourceforge.net/ but I've not
tried to use it with Python before; from the web page it looks like it
may be worth a spin:
"The fuzzy parser supports C, but is flexible enough to be useful for
C++ and Java, and for use as a generalized 'grep database' (use it to
browse large text documents!"

The vim integration is very nice. It has emacs integration too, but I
haven't used it and can't comment on how good it is.
I think the wish "do not use grep, just look at the index file, and
immediately display all matches" is reasonable and probably other
Python coders had thought about it before. But I am wondering if I am
missing something obvious, as most people seem to be very happy with
exuberant ctags.

I am usually happy with grep, but we only have a medium-large size
project (320,000 lines of Python code); I can imagine on very large
codebases that would be too slow to be practical.

--
http://mail.python.org/mailman/listinfo/python-list

--
Ramon Diaz-Uriarte
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Aug 23 '06 #5
Thanks for the answer. I had read about PyDev and its extenssions but,
if at all possible, I'd like to keep working with Emacs (or Vim)
instead of Eclipse, and I'd rather use free/open source software.

Best,

R.

On 8/23/06, Fabio Zadrozny <fa*****@gmail. comwrote:
>
What exactly are you trying to accomplish? If you want to index
function/class names, variables, etc then you should take a look at
"exuberant ctags" http://ctags.sourceforge.net53 --although it started
off as a C indexer, it has excellent Python support, it's free, and as
a bonus its indices are well supported from inside major editors (vim,
emacs, etc) so you can easily follow code flow, find function/class
definitions, etc.

Sorry for not being clear enough. I want the following:

a) have my editor go to the point where a function/whatever is defined


Pydev Extensions (http://www.fabioz.com/pydev) should do that without any
problems with F3 (it first tries a 'context-sensitive' match, trying to find
it in locals, globals, current class, etc and if not found like that, it
goes and looks for the signature in a context-insensitive way, as if it was
a simple text-search)

b) see all places where a function/whatever is used.


This can be handed pretty well with the search that is builtin into Eclipse
(ctrl+h).

Cheers,

Fabio

--
Ramon Diaz-Uriarte
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Aug 23 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
8738
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6575
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5907
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4412
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.