Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (91 sloc) 3.36 KB
<style type="text/css">
.sikuli-code {
font-size: 20px;
font-family: "Osaka-mono", Monospace;
line-height: 1.5em;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
.sikuli-code img {
vertical-align: middle;
margin: 2px;
border: 1px solid #ccc;
padding: 2px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 1px 1px 1px gray;
-webkit-box-shadow: 1px 1px 2px gray;
.kw {
color: blue;
.skw {
color: rgb(63, 127, 127);
.str {
color: rgb(128, 0, 0);
.dig {
color: rgb(128, 64, 0);
.cmt {
color: rgb(200, 0, 200);
h2 {
display: inline;
font-weight: normal;
.info {
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
margin-bottom: 20px;
display: none;
a {
color: #9D2900;
body {
font-family: "Trebuchet MS", Arial, Sans-Serif;
<div class="info">
<h2>apps-extension.sikuli\example.sikuli</h2> <a href="apps-extension.sikuli\">(Download this script)</a>
<pre class="sikuli-code">
<span class="str">""" is used to load all the libraries / tests into the
main context for processing.
<span class="kw">import</span> glob
<span class="kw">def</span> execdir(path, separator, directory):
<span class="str">"""execdir recurses a directory and calls execfile on each python file"""</span>
pythonfiles = path + directory + separator + <span class="str">"*.py"</span>
listing = glob.glob(pythonfiles)
<span class="kw">for</span> infile <span class="kw">in</span> listing:
execfile(infile, GLOBDICT)
<span class="kw">def</span> importjava(path, separator, directory):
<span class="str">"""import any java libraries that are necessary"""</span>
jarfiles = path + directory + separator + <span class="str">"*.jar"</span>
<span class="kw">print</span> jarfiles
jars = glob.glob(jarfiles)
<span class="kw">for</span> jar <span class="kw">in</span> jars:
<span class="kw">print</span> <span class="str">"adding "</span> + jar + <span class="str">" to the system path"</span>
GLOBDICT = globals()
<span class="kw">def</span> importfiles(path, separator):
<span class="str">"""importfiles takes a path and a separator"""</span>
execdir(path, separator, <span class="str">'lib'</span>)
execdir(path, separator, <span class="str">'tests'</span>)
importjava(path, separator, <span class="str">'java'</span>)
Jump to Line
Something went wrong with that request. Please try again.