473,796 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any tools to print source code call hierarchy

I'm sure I'm not using the conventional names for this tool, more of a
cross-referencer?. I couldn't find it on Google, I think for this reason.

I need a tool that will go through a python module (ClientForm in this case)
and allow me to specify a starting module to parse and tell me what all it
uses.

What I'm trying to do is to take ClientForm apart enough to pull out just the
html form parsing code in it and use it elsewhere. It would be MUCH easier
when approaching someone elses code if I could see what all functions are
called by a given function, etc.

TIA,
Scott
Jul 18 '05 #1
5 3604
Scott Chapman <sc********@mis chko.com> wrote in message news:<ma******* *************** ************@py thon.org>...
I'm sure I'm not using the conventional names for this tool, more of a
cross-referencer?. I couldn't find it on Google, I think for this reason.

I need a tool that will go through a python module (ClientForm in this case)
and allow me to specify a starting module to parse and tell me what all it
uses.

What I'm trying to do is to take ClientForm apart enough to pull out just the
html form parsing code in it and use it elsewhere. It would be MUCH easier
when approaching someone elses code if I could see what all functions are
called by a given function, etc.


Because python is a dynamical typed non image language there is no
tool that can do this and there never will be any (at least one that
is not using heuristics or sampled data from previous runs).
Jul 18 '05 #2
On Sat, 06 Sep 2003 16:34:21 -0700, Lothar Scholz wrote:

....

Because python is a dynamical typed non image language there is no
tool that can do this and there never will be any (at least one that
is not using heuristics or sampled data from previous runs).


hmmm... I think (some) static analysis may be possible. The main
thing to exclude is eval/exec but even then, yes you're right, some
programs would just have to be run to find out what they do.

I remember reading some interesting things here:
http://www.python.org/doc/essays/cp4e.html

In particular:
"Cormac Flanagan and Matthias Felleisen.
Componential Set-Based Analysis.
ACM Transactions of Programming Languages and Systems"

Simon.


Jul 18 '05 #3

"Simon Burton" <si****@webone. com.au> schrieb im Newsbeitrag
news:pa******** *************** *****@webone.co m.au...
On Sat, 06 Sep 2003 16:34:21 -0700, Lothar Scholz wrote:

...

Because python is a dynamical typed non image language there is no
tool that can do this and there never will be any (at least one that
is not using heuristics or sampled data from previous runs).
hmmm... I think (some) static analysis may be possible. The main
thing to exclude is eval/exec but even then, yes you're right, some
programs would just have to be run to find out what they do.


It it is not only eval/exec. You can create methods dynamically. And static
analysis will already run into trouble when you import moduls dynamically.

What I do very often is "rename" a procedure, e.g. in cases as:
def pVersion1(): ...
def pVersion2(): ...

if....
p=pVersion1

This is not even tricky.
Kindly
Michael P

I remember reading some interesting things here:
http://www.python.org/doc/essays/cp4e.html

In particular:
"Cormac Flanagan and Matthias Felleisen.
Componential Set-Based Analysis.
ACM Transactions of Programming Languages and Systems"

Simon.

Jul 18 '05 #4
Simon Burton <si****@webone. com.au> wrote in message news:<pa******* *************** ******@webone.c om.au>...
hmmm... I think (some) static analysis may be possible. The main
thing to exclude is eval/exec but even then, yes you're right, some
programs would just have to be run to find out what they do.


Whats with code like:

if foo:
def myfunc():
... do something
else:
def myfunc():
... calling your_func()
A Language where the program calling hierarchie depends on runtime
calculations is not able to provide good refactoring tools or static
flow analysis. This is the huge difference to a language like
Smalltalk where we live in an image.

And if you say that this is a hack, then you are making a big mistake,
look at currently used code and you will find so much uses of this
style (or even worse styles) that it seems to be a common paradigm.
Jul 18 '05 #5
On 7 Sep 2003 03:21:25 -0700, ll*****@web.de (Lothar Scholz) wrote:
Simon Burton <si****@webone. com.au> wrote in message news:<pa******* *************** ******@webone.c om.au>...
hmmm... I think (some) static analysis may be possible. The main
thing to exclude is eval/exec but even then, yes you're right, some
programs would just have to be run to find out what they do.


Whats with code like:

if foo:
def myfunc():
... do something
else:
def myfunc():
... calling your_func()
A Language where the program calling hierarchie depends on runtime
calculations is not able to provide good refactoring tools or static
flow analysis. This is the huge difference to a language like
Smalltalk where we live in an image.

And if you say that this is a hack, then you are making a big mistake,
look at currently used code and you will find so much uses of this
style (or even worse styles) that it seems to be a common paradigm.


Which only begins to hint at what is possible with metaclasses ;-)

Regards,
Bengt Richter
Jul 18 '05 #6

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

Similar topics

9
5340
by: FISH | last post by:
Ever have one of those days when you're not sure if it's you who's gone mad, or the rest of the world? I have an Open Source project on SourceForge for communication with YSMG - Yahoo's IM protocol. I keep the project source in three directories, based upon the code's function: one for the network API code itself, one for the support APIs (basic chat spam filtering, Swing models, rich text decoders, etc), and one for the test client...
2
6722
by: Edward Berard | last post by:
I am looking for tools that will analyze Java source code: -> I am primarily looking for metrics tools, e.g., tools that will tell me things like - Total lines of code - Total blank lines of code - Total commented lines of code
17
2140
by: flupke | last post by:
Hi, i create my GUIs mainly via wxGlade. However when you start of to program and want to do some rearranging to the gui, wxglade overwrites your file and you've got to put your own code back in. I think i can work around that (at least a bit) by making a second file that imports the gui generated by wxglade and make classes that extend the original ones. For instance i could have a class MainForm that extends the wxFrame
3
1311
by: Steven T. Hatton | last post by:
Are there any tools (preferably available for linux) which will display the concatanated source code representative of an entire translation unit? Something that would simply provide a graphical representation of the various files and how they connect would be of interest as well. -- STH Hatton's Law: "There is only One inviolable Law" KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com Mozilla: http://www.mozilla.org
4
2308
by: Stuart Clark | last post by:
Hi, I am having quite a major problem with an access database. Basically, under "Tools => Startup", there are options to disable the Menu's (e.g. - file, tools etc), the toolbars, the main window, and in fact, everything. A vital database has had everything disabled, and so the menus and windows no longer load when I open the database. This means I can't get to the
0
2099
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to allow it ro run then it will execute, the code execution depends on the permission provided to the assembly. If the code is not trusted wnough to run or it attempts to perform an action which doe not have the required permissions then its execution...
3
2113
by: James J. Besemer | last post by:
I would like to champion a proposed enhancement to Python. I describe the basic idea below, in order to gage community interest. Right now, it's only an idea, and I'm sure there's room for improvement. And of course it's possible there's some serious "gotcha" I've overlooked. Thus I welcome any and all comments. If there's some agreement that this proposal is worth further consideration then I'll re-submit a formal document in...
14
1464
by: call_me_anything | last post by:
Our group uses Vi editor for writing code and "grep" to understand the working of the code. Seems like we are living 20 years behind the current age. I have searched for some good tools on the net which can atleast help to understand a complex huge project by making function call generators, class relationship diagrams etc. But I haven't really found any good tool. Does anybody know of some such good tool.
12
3543
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to print the report three times, but do not know how
0
9685
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...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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
6795
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
5446
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
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.