Re: Is there any python lib for calling CVS api?

2006-11-06 Thread Kevien Lee
Paul :

Thanks ,but the viewvc lib so simple useable for python:(

Paul Boddie wrote:
 [EMAIL PROTECTED] wrote:
  Hi everyone, this should be a quick question.  I'm writing some scripts
  to take some file and move them into a CVS repository, but it's pretty
  slow, because it uses system calls to execute the CVS commands.

 [...]

  anyway, if anyone knows of a useful module, I'd love to hear about it.

 You might get some ideas from ViewVC if you're accessing the repository
 directly:

 http://www.viewvc.org/

 There may be scripts out there which import data from various other
 revision control systems into CVS, although the focus these days seems
 to be on *exporting* data from CVS and putting it into things like
 Subversion, Bazaar, Mercurial and so on, but I believe the scripts for
 the latter two are Python programs and may also provide some
 inspiration.
 
 Paul

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


How to paras such echo string effection?

2006-10-17 Thread Kevien Lee
Hi everyone,

When i decide to paras a string,which return from running a CVS command,it's amaze that i want to get some file of the echo string ,how to make paras process more effect?

the problem detail as follow that:

run command:cvs status -r it will return all the file list in as follow?


===File: file01.xlsStatus: Up-to-date
 Working revision:1.1 Repository revision:1.1/msg/file01.xls,v Sticky Tag:(none) Sticky Date:(none) Sticky Options:-kb
cvs status: Examining 20060815===File: file02.xlsStatus: Up-to-date
 Working revision:1.1 Repository revision:/msg/file02.xls ,v Sticky Tag:(none) Sticky Date:(none) Sticky Options:-kb
cvs status: Examining 20060816===
Now ,i just what to know the file of Status,if paras all should be
coast expenses,is there any effect way?
PS:is there any python lib for CVS ?

Thanks 
Best regards
Kevin Lee
-- 
http://mail.python.org/mailman/listinfo/python-list

How to print the CDATA of .xml file?

2006-10-13 Thread Kevien Lee
Hi,
 Recently ,I just turn to Python from C#.However ,as a dynamic language .
Python and C# was so different.

Now ,I want to get some record from an XML file,The format of the XML file as follow:
...
Doc rID=T1  DName![CDATA[Release Truck]]/DName Res![CDATA[Res18]]/Res

 DT rID=T2 NodeArgs eType=Table icon=2 nRep=5 filter=False  Disp![CDATA[Run-Time Data]]/Disp
 BtmPane vType=Table Path![CDATA[Default.xls]]/Path /BtmPane /NodeArgs /DT

 NodeArgs eType=StartTest icon=1 nRep=4 status=Failed  Disp![CDATA[Test Release Truck Summary]]/Disp
 /NodeArgs

/Doc


when iuse the minidom to parase the XML file,it would ignored the section of ![CDATA[...]
the code is:

_document=minidom.parse(filePath)
_documnetList=_document.getElementsByTagName(NodeArgs)
for _argNode in _documnetList: 
 print _argNode.nodeValue,_argNode.localName

when it run. The nodeValue of the CDATA Sectionis always None,Is my code error?
and how should i do when i want to get the value of the in the CDATA section?


 

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

A question about call Wincvs

2006-10-13 Thread Kevien Lee
Hi,
In the Wincvs,if want to get commitable file list in local file list,it could click flat mode-show commitable 
But ,if i want to through command line ,how show it do?
Is there any CVS lib?

Thanks.
Kevin Lee
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: How to print the CDATA of .xml file?

2006-10-13 Thread Kevien Lee

-- Forwarded message --From:Fredrik Lundh [EMAIL PROTECTED]To:python-list@python.org
Date:Fri, 13 Oct 2006 11:03:45 +0200Subject:Re: How to print the CDATA of .xml file?Kevien Lee wrote: when i use the minidom to parase the XML file,it would ignored the section of ![CDATA[...]
 the code is: _document=minidom.parse(filePath) _documnetList=_document.getElementsByTagName(NodeArgs) for _argNode in _documnetList:  print _argNode.nodeValue,_argNode.localName
 when it run. The nodeValue of the CDATA Section is always None,Is my code error?here's one way to do it, under Python 2.5: import xml.etree.ElementTree as ET tree = ET.parse
(filename) for elem in tree.findall(.//NodeArgs):   print elem.findtext(Disp)   print elem.findtext(BtmPane/Path)/F


use Python 2.5 is easy and good, but is there any others way under version 2.4?
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: A problem about File path encode

2006-10-10 Thread Kevien Lee
Hi ,
I agree with the problem caue of the the escape character,but when i folllow
these meth,it still didn't work.
It is so strang that the code work on another computer (OS is WinXP),but throw
error on mine.Why?plese help me
On 10/10/06, Gabriel Genellina [EMAIL PROTECTED] wrote:
At Monday 9/10/2006 22:14, Kevien Lee wrote: There is a problem about File path encode ,when i want to parse
 an xml file. xmldoc=minidom.parse(D:\Downloads\1.xml)IOError: [Errno 2] No such file or directory: 'D:\\Downloads\x01.xml'See the red line.the
 file pathD:\Downloads\1.xml autochanged'D:\\Downloads\x01.xml'I think may be the version cause the problem (version2.4) at thebeginning,but when i changed the 
version2.5 ,\ is a escape character. Use D:\\Downloads\\1.xml orrD:\Downloads\1.xml or D:/Downloads/1.xml(I wrote this same message a few hours ago...!)
--Gabriel GenellinaSoftlab SRL__Preguntá. Respondé. Descubrí.Todo lo que querías saber, y lo que ni imaginabas,está en Yahoo! Respuestas (Beta).
¡Probalo ya!http://www.yahoo.com.ar/respuestas
-- 
http://mail.python.org/mailman/listinfo/python-list

A problem about File path encode

2006-10-09 Thread Kevien Lee
Hi everyone,
 There is a problem about File path encode ,when i want to parse an xml file.
 The code as follow:
 --
from xml.dom import minidomdef ReadXml():xmldoc=minidom.parse(D:\Downloads\1.xml) print xmldoc.toxml()

if __name__ == __main__: ReadXml()
--
there throw an error:
Traceback (most recent call last): File D:/Downloads/test, line 8, in module ReadXml() File D:/Downloads/test, line 4, in ReadXml xmldoc=minidom.parse(D:\Downloads\1.xml) 
 File D:\Program Files\Python25\lib\xml\dom\minidom.py, line 1913, in parse return expatbuilder.parse(file) File D:\Program Files\Python25\lib\xml\dom\expatbuilder.py, line 922, in parse 
 fp = open(file, 'rb')IOError: [Errno 2] No such file or directory: 'D:\\Downloads\x01.xml'
--
See the red line.the file pathD:\Downloads\1.xml auto changed 'D:\\Downloads\x01.xml'
I think may be the version cause the problem (version2.4) at the beginning,but when i changed the version2.5 ,
the error still exist.and the code run on another PC is OK.Why this error happen?how could i fix that?
-- 
http://mail.python.org/mailman/listinfo/python-list