[no subject]

2006-12-17 Thread Divya Prakash
Hello ,
 
I would like to parse java files and detect class name's, attributes
name's type's and visibility (and or list of
methods).
Is there any module who can parse easily a java file using jython?

 

Regards 

Divya

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

creating generic class

2006-12-18 Thread Divya Prakash
Hi,

 

 

 

I want to create a generic class to convert ". java
"  file  into xml file (validated against xsd / dtd).

 

 What is the best approach to do this with jython or python ?

 

 

 

 

 

Regards 

 

Divya

 

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

RE:

2006-12-18 Thread Divya Prakash
Hi

I don't know how to implement these API's .When I use the method
"Parse   (file object) " it gives error. 
So, I m blank how to implement it in order to get all the info of java file
and thn represent them in xml format..

Regards
Divya 

-Original Message-
From: Gabriel Genellina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 6:21 AM
To: Divya Prakash
Cc: [email protected]
Subject: Re:

At Monday 18/12/2006 03:34, Divya Prakash wrote:


> I would like to parse java files and detect class name's, 
> attributes name's type's and visibility (and or list of
> methods).
> Is there any module who can parse easily a java file using jython?

You could try javadoc (the java package), it is easier to use than a 
pure reflection approach.

-- 
Gabriel Genellina
Softlab SRL 

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam !gratis! 
!Abrm tu cuenta ya! - http://correo.yahoo.com.ar

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


getting subchild of a tree through xerces

2006-12-19 Thread Divya Prakash
Hi 

 

 

 

 I m able to parse xml file using xerces as well as JAXP but I am unable to
parse the sub- child of my tree

 

 

 

Eg : 

 

  

 

   

 

...(not able
to parse this)

 

   

 

  

 

 

 

   

 

  

 

 

 

 

 

 But I m unable to parse the child of   class"hello"  .but I m able to parse
the .sibling of class

 

What should I do...

 

 

 

 

 

Regards 

 

Divya

 

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

FW: [Jython-users] ERROR : parsing xml in jython

2006-12-19 Thread Divya Prakash
Hi

 But I am unable to parse all the nodes of the tree .especially the
subtree of the  main tree 

It displays only the sibling not the  subtree


Regards 
Divya

-Original Message-
From: Matthias Berth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 3:18 PM
To: Divya Prakash
Subject: Re: [Jython-users] ERROR : parsing xml in jython

Hi,

looks like you have to make an InputSource from the file, like so:


from java.io import File, FileReader, StringReader

textReader = FileReader(File(filename))
inputSource = InputSource(textReader)
dp.parse(inputSource)

Hope this helps

Matthias

Divya Prakash schrieb:

> Hi All,
> 
>  
> 
> I m facing the problem while parsing xml  file ..
> 
>  
> 
> My code is :-
> 
>  
> 
>  
> 
> import sys
> 
> from org.apache.xerces.parsers import DOMParser as dp
> 
> import javax.xml.parsers
> 
> infilename = open("mos.xml","r")
> 
> print infilename

> def test(infilename):
> 
> """Parse XML document and show attributes and names.
> 
> """
> 
> print infilename
> 
> parser = dp()
> 
> print parser
> 
> gh = parser.parse(infilename)
> 
> print gh
> 
> doc = parser.getDocument()
> 
> node = doc.getFirstChild()
> 
> print "Attributes:"
> 
> show_attrs(node)
> 
> print "Names:"
> 
> show_names(node)
> 

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


Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-23 Thread Divya Prakash
Hello
thats excellant !!


On 1/23/09, Russ P.  wrote:
>
> On Jan 23, 4:57 am, Bruno Desthuilliers  [email protected]> wrote:
> > Russ P. a écrit :
>
> > > As I said before, if you have the source code you can always change
> > > private attributes to public in a pinch if the language enforces
> > > encapsulation.
> >
> > And then have to maintain a fork. No, thanks.
>
> For crying out loud, how many private attributes do you need to
> access? If it's a dozen, then you and your library developer are
> obviously not on the same page. If it's one or two, then it's hardly a
> "fork." Just take note of the one or two places where you needed to
> remove the access restriction and you're done. Heck, you don't even
> need to do that, because you will be warned automatically anyway when
> you get the new version of the library (unless those private
> attributes are changed to public).
>
> > > But if you are working on a team project, you can't
> > > change the code that another member of a team checks in.
> >
> > Why on earth couldn't I change the code of another member of my team if
> > that code needs changes ? The code is the whole team's ownership.
>
> OK, fine, you can change the code of another member of the team. Are
> you going to check with him first, or just do it? The point is that
> changing an interface requires agreement of the team members who use
> that interface, whether on the calling or the implementation side of
> it. If you change interfaces without getting agreement with the other
> team members, you probably won't be on the team for long. And without
> access restrictions, accessing _private is equivalent to changing the
> interface.
>
> > Now and FWIW,  in this case (our own code), I just don't need to "mess
> > with internals" - I just just change what needs to be changed.
> >
> > > That is how
> > > enforced data hiding helps teams of developers manage interfaces.
> >
> > I totally fails to find any evidence of this assertion in the above
> > "demonstration".
> >
> > > The
> > > bigger the team and the bigger the project, the more it helps.
> >
> > Your opinion.
> >
> > > Mr. D'Aprano gave an excellent example of a large banking program.
> > > Without enforced encapsulation, anyone on the development team has
> > > access to the entire program and could potentially sneak in fraudulent
> > > code much more easily than if encapsulation were enforced by the
> > > language.
> >
> > My my my. If you don't trust your programmers, then indeed, don't use
> > Python. What can I say (and what do I care ?). But once again, relying
> > on the language's access restriction to manage *security* is, well, kind
> > of funny, you know ?
>
> Are you seriously saying that if you were managing the production of a
> major financial software package with hundreds of developers, you
> would just "trust" them all to have free access to the most sensitive
> and critical parts of the program? Now *that's*, well, kind of funny,
> you know?
>
> Would you give all those developers your password to get into the
> system? No? Wait a minute ... you mean you wouldn't "trust" them with
> your password? But what about "openness"? Are you some sort of fascist
> or what?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list