Hi, guys

On every machine installed STAF, there are the Chinese OS setup. So I have
to check the chinese string returned after
execute the STAF/STAX command. For instanse, I need to check if the targeted
machine install the svn and get the expeced response,
 I have to try type "SVN help" and then check the STAX result. However, I
fail to match the chinese characters for STAXResult variable, still the
english string always work fine.

Can anybody help me make the command below work well ? thanks in advance.

m = re.match(r'.*用法.*', ''.join(STAXResult[0][1].split()))


The STAXResut text is:
用法:svn<subcommand>[options][args]Subversion命令行客户端,版本1.6.3。使用“svnhelp<subcommand>”显示子命令的帮助信息。使用“svn--version”查看程序的版本号和版本库访问模块,或者使用“svn--version--quiet”只查看程序的版本号。大多数的子命令可接受文件或目录参数,对目录进行递归处理。如果没有指定参数,默认对当前目录(包含当前目录)递归处理。可用的子命令:addblame(praise,annotate,ann)catchangelist(cl)checkout(co)cleanupcommit(ci)copy(cp)delete(del,remove,rm)diff(di)exporthelp(?,h)importinfolist(ls)locklogmergemergeinfomkdirmove(mv,rename,ren)propdel(pdel,pd)propedit(pedit,pe)propget(pget,pg)proplist(plist,pl)propset(pset,ps)resolveresolvedrevertstatus(stat,st)switch(sw)unlockupdate(up)Subversion是版本控制工具。欲取得详细资料,请参阅
http://subversion.tigris.org/





<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function="main"/>
<function name="main">
<sequence>
<!--Ping Task-->

<process>
  <location>'local'</location>
  <command>'svn help'</command>
  <returnstdout/>
</process>

<log level="'error'">
'Process failed with RC=%s, Result=%s' % (RC, STAXResult[0][1])
</log>

<script>
import re
m = re.match(r'.*svnhelp.*', ''.join(STAXResult[0][1].split()))
f = open("d:\stdout.txt","w")
f.writelines(''.join(STAXResult[0][1].split()))
f.writelines('\n')
if m:s
    f.writelines('find')
else:
    f.writelines('unfind')

f.close()
</script>


</sequence>
</function>
</stax>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to