annotate sikuli/CP.sikuli/CP.html @ 2:46fb79167a61 tip

Main Code
author Victor Padilla <victor.padilla.mc@gmail.com>
date Mon, 04 May 2015 22:56:18 +0200
parents
children
rev   line source
victor@2 1
victor@2 2 <html>
victor@2 3 <head>
victor@2 4 <style type="text/css">
victor@2 5 .sikuli-code {
victor@2 6 font-size: 20px;
victor@2 7 font-family: "Osaka-mono", Monospace;
victor@2 8 line-height: 1.5em;
victor@2 9 display:table-cell;
victor@2 10 white-space: pre-wrap; /* css-3 */
victor@2 11 white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
victor@2 12 white-space: -pre-wrap; /* Opera 4-6 */
victor@2 13 white-space: -o-pre-wrap; /* Opera 7 */
victor@2 14 word-wrap: break-word; /* Internet Explorer 5.5+ */
victor@2 15 width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
victor@2 16 }
victor@2 17 .sikuli-code img {
victor@2 18 vertical-align: middle;
victor@2 19 margin: 2px;
victor@2 20 border: 1px solid #ccc;
victor@2 21 padding: 2px;
victor@2 22 -moz-border-radius: 5px;
victor@2 23 -webkit-border-radius: 5px;
victor@2 24 -moz-box-shadow: 1px 1px 1px gray;
victor@2 25 -webkit-box-shadow: 1px 1px 2px gray;
victor@2 26 }
victor@2 27 .kw {
victor@2 28 color: blue;
victor@2 29 }
victor@2 30 .skw {
victor@2 31 color: rgb(63, 127, 127);
victor@2 32 }
victor@2 33
victor@2 34 .str {
victor@2 35 color: rgb(128, 0, 0);
victor@2 36 }
victor@2 37
victor@2 38 .dig {
victor@2 39 color: rgb(128, 64, 0);
victor@2 40 }
victor@2 41
victor@2 42 .cmt {
victor@2 43 color: rgb(200, 0, 200);
victor@2 44 }
victor@2 45
victor@2 46 h2 {
victor@2 47 display: inline;
victor@2 48 font-weight: normal;
victor@2 49 }
victor@2 50
victor@2 51 .info {
victor@2 52 border-bottom: 1px solid #ddd;
victor@2 53 padding-bottom: 5px;
victor@2 54 margin-bottom: 20px;
victor@2 55 display: none;
victor@2 56 }
victor@2 57
victor@2 58 a {
victor@2 59 color: #9D2900;
victor@2 60 }
victor@2 61
victor@2 62 body {
victor@2 63 font-family: "Trebuchet MS", Arial, Sans-Serif;
victor@2 64 }
victor@2 65
victor@2 66 </style>
victor@2 67 </head>
victor@2 68 <body>
victor@2 69 <div class="info">
victor@2 70 <h2>CP.sikuli\CP.sikuli</h2> <a href="CP.sikuli\CP.zip">(Download this script)</a>
victor@2 71 </div>
victor@2 72 <pre class="sikuli-code">
victor@2 73 params = sys.argv[<span class="dig">1</span>:]
victor@2 74 path=params[<span class="dig">0</span>]
victor@2 75 strIMGs=<span class="str">""</span>
victor@2 76
victor@2 77 <span class="skw">click</span>(<img src="1415710175004.png" />)
victor@2 78 <span class="skw">wait</span>(<img src="1415710207538.png" />,FOREVER)
victor@2 79 <span class="skw">click</span>(<img src="1415710242258.png" />)
victor@2 80 <span class="skw">wait</span>(<img src="1415710292754.png" />,FOREVER)
victor@2 81 <span class="skw">type</span>(Key.BACKSPACE)
victor@2 82
victor@2 83 <span class="skw">click</span>(<img src="1415791421283.png" />)
victor@2 84 strPath=path.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
victor@2 85 paste(strPath[:-<span class="dig">1</span>])
victor@2 86 <span class="skw">click</span>(<img src="1415791723329.png" />)
victor@2 87 <span class="skw">sleep</span>(<span class="dig">1</span>)
victor@2 88 <span class="skw">type</span>(Key.BACKSPACE)
victor@2 89 <span class="kw">for</span> i <span class="kw">in</span> range(<span class="dig">1</span>,len(params)):
victor@2 90 strIMGs=strIMGs+<span class="str">" \""</span>+params[i]+<span class="str">"\""</span>
victor@2 91 strInput=strIMGs
victor@2 92 strInput=strInput.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
victor@2 93 paste(strInput)
victor@2 94 <span class="skw">click</span>(<img src="1415791723329.png" />)
victor@2 95 <span class="skw">click</span>(<img src="1415710897800.png" />)
victor@2 96 <span class="skw">wait</span>(Pattern(<img src="1415711761225.png" />).similar(<span class="dig">0.90</span>),FOREVER)
victor@2 97 <span class="skw">click</span>(<img src="1415711065949.png" />)
victor@2 98 <span class="skw">wait</span>(<img src="1415711940063.png" />,FOREVER)
victor@2 99 <span class="skw">wait</span>(<span class="dig">1</span>)
victor@2 100 <span class="skw">type</span>(Key.BACKSPACE)
victor@2 101 <span class="skw">click</span>(<img src="1415791774505.png" />)
victor@2 102 strOUT=path+<span class="str">"CP.xml"</span>
victor@2 103 strOUT=strOUT.replace(<span class="str">"/"</span>,<span class="str">"\\"</span>)
victor@2 104 paste(strOUT)
victor@2 105 <span class="skw">click</span>(<img src="1415791801451.png" />)
victor@2 106 <span class="kw">if</span> exists(<img src="1415700984115.png" />):
victor@2 107 <span class="skw">click</span>(<img src="1415700984115.png" />)
victor@2 108 <span class="kw">if</span> exists(<img src="cerrar.png" />):
victor@2 109 <span class="skw">click</span>(<img src="cerrar.png" />)
victor@2 110 </pre>
victor@2 111 </body>
victor@2 112 </html>