Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias identifier ImportFrom alias alias alias Assign NameStore Str Assign NameStore Call AttributeLoad Str attr Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Str attr attr Str Str attr Str Str FunctionDef arguments args defaults body Expr Str Assign NameStore ListLoad If Call AttributeLoad AttributeLoad NameLoad attr attr Str body For NameStore TupleLoad Str Str body Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str orelse If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str orelse If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str If CompareIsNot Call NameLoad NameLoad body Return NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr ListLoad Str Str Return NameLoad handlers ExceptHandler type NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore IfExp Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TryExcept body For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore TupleLoad Str Str Str Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad body Break Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str BinOpSub Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Raise decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num FunctionDef arguments args NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Str Call NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Str Num Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str TupleLoad Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Str AugAssignAdd NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If NameLoad body AugAssignAdd NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse TryExcept body Expr Call AttributeLoad NameLoad attr ListLoad Str Str Assign NameStore Str handlers ExceptHandler type NameLoad body Pass If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore ListLoad NameLoad Str Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore TupleLoad Str Str Str If Call NameLoad ListComp CompareIn BinOpAdd NameLoad Str AttributeLoad NameLoad attr comprehension NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str BinOpAdd Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpAdd Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore TupleLoad Str Str Str Str Str Str Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad For TupleStore NameStore NameStore ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad body With Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str AugAssignAdd NameStore IfExp Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Assign NameStore Call NameLoad Assign NameStore Str If NameLoad body If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str orelse Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str For NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad Str attr attr attr body If Call AttributeLoad Call AttributeLoad NameLoad attr attr Str body Assign NameStore BinOpAdd Str Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr Break Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore ListComp NameLoad comprehension NameStore NameLoad UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad For NameStore BinOpAdd NameLoad SubscriptLoad NameLoad Slice Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Pass If NameLoad body If BoolOpOr UnaryOpNot NameLoad CompareLt SubscriptLoad NameLoad Index Num NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad AugAssignAdd NameStore Str orelse Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotIn Str NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body Raise Call NameLoad Str If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Str For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn Str NameLoad body Continue If BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Str Str Call AttributeLoad NameLoad attr NameLoad Str Str Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad With Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Str Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Str Str decorator_list decorator_list
N/A N/A  Web runtime based on XUL (i.e. Mozilla's Firefox browser engine)

This is the best developed runtime, with tested good behavior on
Windows, OSX, Linux and Raspberry Pi.

Developer notes
---------------

We keep track of runtimes in appdata/flexx/webruntimes, Xul runtimes
have a 'xul_' prefix. In principle we have just one, the one that is
most up to date. We can use firefox as a runtime, in case we symlink to
it (or on Windows copy the whole runtime). Later we may also download
the xulrunner runtime automatically.

After selecting the runtime, we create an executable to run it in a way
that avoids taskbar grouping (e.g. with firefox), and provides a more
meaningful process name in the task manager. Handling of this bit differs
per platform. On Linux we make a symlink, and on Windows a copy of the
xulrunner/firefox executable. On OSX we make a new xulrunner.app that
mimics the entire runtime via symlinks.

Xul wants a specific directory structure with a few files that define
the app. We write this on the fly to appdata/flexx/temp_apps. We create
a new app for each time we launch an application. We also take good
care to clean up the old ones. On Linux and OSX the runtime app
(symlink) is also stored in this directory.

 N/A os N/A sys N/A time N/A shutil N/A logging N/A subprocess N/A os.path op common DesktopRuntime create_temp_app_dir appdata_dir N/A APPLICATION_INI 
[App]
Vendor={vendor}
Name={name}
Version={version}
BuildID={buildid}
ID={id}

[Gecko]
MinVersion=1.8
MaxVersion=200.*
 N/A MAIN_XUL N/A N/A 
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    id="{windowid}"
    title="{title}"
    windowtype="flexxui:main"
    width="640"
    height="480"
    sizemode="normal"
    >
    <script type="application/javascript"
            src="chrome://{name}/content/main.js" />
    <!-- content or content-primary ? -->
    <browser src="{url}"
             id="content"
             type="content"
             flex="1"
             disablehistory="true" />
</window>
 lstrip N/A MAIN_JS 
window.addEventListener("load", startup, false);
window.addEventListener("resize", resizefunc, false);

var thebrowser;

function startup() {
    //thebrowser = document.createElement("browser");
    //window.document.body.appendChild(thebrowser);

    document.getElementById("content").open = function() {
    window.alert('haha open ' + arguments[0]);
        //window.open(arguments[0], arguments[1], "chrome," + arguments[2]);
    };
    //document.getElementById("thebrowser").open = window.open;
    //window.open("http://python.org", "hello", "chrome,width=400,height=300");
}

var resizefunc = function(ev) {
    window.resizeTo(100, 100);
    window.alert("resize");
};


 N/A PREFS_JS 
// This tells xulrunner what xul file to use
pref("toolkit.defaultChromeURI", "chrome://{name}/content/main.xul");

// This line is needed to let window.open work
pref("browser.chromeURL", "chrome://{name}/content/main.xul");

// Set features - setting width, height, maximized, etc. here
pref("toolkit.defaultChromeFeatures", "{windowfeatures}");

// debugging prefs, disable these before you deploy your application!
pref("browser.dom.window.dump.enabled", false);
pref("javascript.options.showInConsole", false);
pref("javascript.options.strict", false);
pref("nglayout.debug.disable_xul_cache", false);
pref("nglayout.debug.disable_xul_fastload", false);
 N/A INFO_PLIST N/A N/A N/A N/A N/A N/A 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" NONL
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleIconFile</key>
    <string>app.icns</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>xulrunner</string>
    <key>CFBundleName</key>
    <string>{name}</string>
</dict>
</plist>
 lstrip replace replace NONL
 get_firefox_exe N/A N/A N/A N/A N/A  Get the path of the Firefox executable

    If the path could not be found, returns None. You may still be able
    to launch using "firefox" though.
     N/A paths N/A N/A N/A N/A N/A sys platform startswith win N/A N/A basepath N/A C:\Program Files\ C:\Program Files (x86)\ N/A N/A N/A N/A paths append N/A basepath Mozilla Firefox\firefox.exe N/A N/A N/A paths append N/A basepath Mozilla\Firefox\firefox.exe N/A N/A N/A paths append N/A basepath Firefox\firefox.exe N/A N/A N/A N/A N/A sys platform startswith linux N/A N/A N/A N/A paths append /usr/lib/firefox/firefox N/A N/A N/A paths append /usr/lib64/firefox/firefox N/A N/A N/A paths append /usr/lib/iceweasel/iceweasel N/A N/A N/A paths append /usr/lib64/iceweasel/iceweasel N/A N/A N/A N/A N/A sys platform startswith darwin N/A N/A N/A N/A paths append /Applications/Firefox.app/Contents/MacOS/firefox N/A path paths N/A N/A N/A N/A op isfile path N/A N/A path N/A N/A None N/A has_firefox N/A N/A N/A N/A N/A  Get whether firefox is installed.
     N/A N/A N/A get_firefox_exe None N/A N/A True N/A N/A N/A N/A N/A subprocess check_output N/A firefox --version N/A True N/A N/A N/A Exception N/A N/A False N/A copy_xul_runtime N/A N/A dir1 dir2 N/A N/A N/A  Copy the firefox/xulrunner runtime to a new folder, in which
    we rename the firefox exe to xulrunner. This thus creates a xul
    runtime in a location where we have write access. Used to be able
    to set the process name on Windows, and maybe used to distribute
    apps *with* the runtime.
     N/A t0 N/A N/A time time N/A ext N/A N/A N/A N/A sys platform startswith win .exe N/A N/A N/A op isdir N/A N/A op join dir1 xulrunner N/A N/A dir1 N/A N/A op join dir1 xulrunner N/A N/A N/A op isdir dir2 N/A N/A N/A N/A shutil rmtree dir2 N/A N/A N/A os mkdir dir2 N/A N/A N/A fname N/A N/A os listdir dir1 N/A N/A filename1 N/A N/A op join dir1 fname N/A filename2 N/A N/A op join dir2 fname N/A N/A N/A op isfile filename1 N/A N/A N/A N/A shutil copy2 filename1 filename2 N/A exe_name N/A firefox iceweasel xulrunner firefox N/A N/A exe N/A N/A op join dir1 N/A exe_name ext N/A N/A N/A op isfile exe N/A N/A N/A N/A N/A shutil copy2 exe N/A N/A op join dir2 N/A xulrunner ext N/A N/A N/A logging info N/A Copied firefox (in %1.2f s) N/A N/A N/A time time t0 N/A N/A N/A Exception N/A N/A N/A N/A shutil rmtree dir2 N/A N/A XulRuntime N/A DesktopRuntime N/A N/A  Desktop runtime based on Mozilla's XUL framework. Xul is
    available wherever Firefox is installed, and uses same engine (Gecko).
    Requires Firefox or the Xul binaries to be installed.

    This runtime is currently the best supported way to create a desktop
    app, with full support for title, window position, icon and custom
    process name.
     N/A _app_count 0 _launch N/A N/A self N/A N/A N/A N/A XulRuntime _app_count 1 N/A N/A N/A self _check_compat N/A app_path N/A create_temp_app_dir xul N/A str N/A XulRuntime _app_count N/A id N/A N/A N/A N/A N/A op basename app_path split _ 1 N/A 1 N/A size N/A N/A N/A self _kwargs get size N/A 640 480 N/A pos N/A N/A N/A self _kwargs get pos None N/A windowfeatures resizable, N/A windowfeatures N/A width=%i, height=%i N/A N/A size N/A 0 N/A size N/A 1 N/A pos N/A N/A windowfeatures N/A , top=%i, left=%i N/A N/A pos N/A 0 N/A pos N/A 1 N/A N/A N/A self _kwargs N/A title N/A N/A N/A self _kwargs get title XUL runtime N/A N/A N/A self _create_xul_app app_path id windowfeatures windowfeatures N/A self _kwargs N/A xul_exe N/A N/A self _get_xul_runtime N/A exe None N/A N/A xul_exe N/A N/A op isfile N/A N/A op realpath xul_exe N/A N/A exe N/A N/A self _get_app_exe xul_exe app_path N/A N/A N/A N/A N/A N/A subprocess check_output N/A firefox --version N/A exe firefox N/A N/A N/A Exception N/A N/A N/A N/A exe None N/A N/A N/A RuntimeError Could not find XUL runtime. Please install firefox. N/A cmd N/A exe -app N/A N/A op join app_path application.ini N/A N/A N/A self _start_subprocess cmd N/A _check_compat N/A N/A self N/A N/A N/A qts N/A PySide PyQt4 PyQt5 N/A N/A any N/A N/A N/A name .QtCore N/A sys modules N/A name qts N/A N/A N/A N/A logging warn Using Flexx' Xul runtime and Qt (PySide/PyQt4/PyQt5) together may cause problems. N/A _create_xul_app N/A N/A self path id N/A kwargs N/A N/A  Create the files that determine the XUL app to launch.
         N/A D N/A dict vendor None name flexx_ui_app version 1.0 buildid 1 id some.app@flexx.io windowid xx title XUL app runtime url http://example.com windowfeatures N/A N/A N/A D update kwargs N/A N/A D N/A windowid N/A W id N/A N/A D N/A name N/A app_ id N/A N/A D N/A id N/A N/A app_ id @flexx.io N/A manifest_link manifest chrome/chrome.manifest N/A manifest N/A N/A content {name} content/ format D N/A application_ini N/A N/A APPLICATION_INI format D N/A main_xul N/A N/A MAIN_XUL format D N/A main_js MAIN_JS N/A prefs_js N/A N/A PREFS_JS format D N/A N/A N/A op isdir path N/A N/A N/A N/A shutil rmtree path N/A subdir N/A chrome chrome/content chrome/icons chrome/icons/default defaults defaults/preferences N/A N/A N/A N/A os mkdir N/A N/A op join path subdir N/A N/A fname text N/A N/A chrome.manifest manifest_link N/A chrome/chrome.manifest manifest N/A application.ini application_ini N/A defaults/preferences/prefs.js prefs_js N/A chrome/content/main.js main_js N/A chrome/content/main.xul main_xul N/A N/A N/A open N/A N/A op join path fname wb f N/A N/A N/A N/A f write N/A N/A text encode N/A N/A N/A kwargs get icon N/A N/A icon N/A N/A kwargs get icon N/A icon_name N/A N/A op join path N/A chrome/icons/default/ N/A D N/A windowid N/A N/A N/A icon write N/A icon_name .ico N/A N/A N/A icon write N/A icon_name .png N/A _get_xul_runtime N/A N/A self N/A N/A N/A  Get path to executable of a xul runtime. The returned path
        is in a writable directory. On Unix/OSX it may be a symlink,
        on Windows it is a real file. Returns None if no XUL runtime
        could be found.
         N/A exe_name xulrunner N/A exe_name N/A N/A N/A N/A sys platform startswith win .exe N/A ff_exe N/A get_firefox_exe N/A ff_version N/A ff_exe N/A N/A N/A Contents/MacOS/ ff_exe N/A N/A inifile N/A N/A op join N/A N/A op dirname ff_exe ../Resources/application.ini N/A N/A inifile N/A N/A op join N/A N/A op dirname ff_exe application.ini N/A line N/A N/A N/A N/A N/A N/A N/A open inifile rb read decode splitlines N/A N/A N/A N/A N/A N/A line lower startswith version N/A N/A ff_version N/A xul_ N/A N/A N/A N/A N/A line split = N/A 1 strip N/A N/A xuldir N/A N/A op join N/A appdata_dir flexx webruntimes N/A N/A N/A N/A op isdir xuldir N/A N/A N/A N/A os mkdir xuldir N/A dnames N/A d N/A d N/A sorted N/A N/A os listdir xuldir N/A N/A d startswith xul N/A obsolete N/A d N/A d dnames N/A N/A N/A op isfile N/A N/A op realpath N/A N/A op join xuldir d exe_name N/A dnames N/A d N/A d dnames N/A d obsolete N/A dname N/A obsolete N/A dnames N/A -1 N/A N/A N/A N/A logging info N/A Clearing XUL runtime at %s dname N/A N/A N/A N/A N/A shutil rmtree N/A N/A op join xuldir dname N/A N/A N/A N/A OSError IOError N/A N/A N/A ff_version N/A N/A N/A N/A dnames N/A N/A dnames N/A -1 ff_version N/A N/A N/A N/A self _install_ff_locally N/A N/A op join xuldir ff_version ff_exe N/A N/A N/A dnames append ff_version N/A dnames N/A N/A N/A N/A op join xuldir N/A dnames N/A -1 exe_name N/A _install_ff_locally N/A N/A self path ff_exe N/A N/A N/A  Make a local "copy" of the firefox runtime. This should put
        a 'xulrunner' executable in the given path.

        On Windows we must make a copy, so that we can make a copy of
        the runtime exe with the name of our choice, to thereby change
        the process name and avoid taskbar grouping with firefox. On
        other systems we use symlinks. On Windows, when symlinks are
        supported (Python 3.2+, Vista+) they hardly ever work because
        the process has no sufficient privileges.

        On OSX we will create an application "X.app", that symlinks all
        files in the firefox runtime. The symlink that we create here
        is only for reference, and does not actually work.
         N/A N/A N/A N/A sys platform startswith win N/A N/A N/A copy_xul_runtime N/A N/A op dirname ff_exe path N/A N/A N/A N/A os mkdir path N/A stub_exe N/A N/A op join path xulrunner N/A N/A N/A os symlink ff_exe stub_exe N/A stub_exe N/A _get_app_exe N/A N/A self xul_exe app_path N/A N/A N/A  Get the executable to run our app. This should take care
        that the runtime process shows up in the task manager with the
        correct exe_name.

        * xul_exe: the location of the xul executbale (can be a symlink)
        * app_path: the location of the xul app (the application.ini etc.)

         N/A N/A N/A N/A sys platform startswith darwin N/A N/A exe N/A N/A op join app_path xulrunner.app N/A title N/A N/A self _kwargs N/A title N/A N/A N/A self _osx_create_app N/A N/A op realpath xul_exe exe title N/A exe /Contents/MacOS/xulrunner N/A N/A N/A exe_name ext N/A N/A op splitext N/A N/A op basename N/A sys executable N/A exe_name N/A N/A exe_name -ui ext N/A N/A N/A N/A sys platform startswith win N/A N/A exe N/A N/A op join N/A N/A op dirname xul_exe exe_name N/A N/A N/A N/A op isfile exe N/A N/A N/A N/A shutil copy2 xul_exe exe N/A N/A exe N/A N/A op join app_path exe_name N/A N/A N/A N/A op isfile exe N/A N/A N/A N/A os symlink N/A N/A op realpath xul_exe exe N/A exe N/A _osx_create_app N/A N/A self xul_path path title N/A N/A N/A  Create osx app

        * xul_path: path to executable of xulrunner (not the symlink)
        * path: location of the .app directory to create.
        * title: the title of the window *and* the process name
         N/A N/A Contents/MacOS xul_path N/A N/A N/A NotImplementedError Cannot deal with real xulrunner yet N/A xul_app N/A N/A op dirname N/A N/A op dirname N/A N/A op dirname xul_path N/A N/A N/A N/A xul_app endswith .app N/A N/A N/A TypeError The xulrunner application must end in .app. N/A N/A N/A op isdir path N/A N/A N/A N/A shutil rmtree path N/A N/A N/A os mkdir path N/A N/A N/A os mkdir N/A N/A op join path Contents N/A N/A N/A os mkdir N/A N/A op join path Contents MacOS N/A N/A N/A os mkdir N/A N/A op join path Contents Resources N/A N/A dirpath dirnames filenames N/A N/A os walk xul_app N/A N/A relpath N/A N/A op relpath dirpath xul_app N/A N/A .app relpath N/A N/A N/A N/A N/A N/A relpath endswith MacOS N/A N/A relpath endswith Resources N/A N/A fname filenames N/A N/A filename1 N/A N/A op join xul_app relpath fname N/A filename2 N/A N/A op join path relpath fname N/A N/A N/A os symlink filename1 filename2 N/A N/A N/A os symlink N/A N/A op join xul_app Contents MacOS firefox N/A N/A op join path Contents MacOS xulrunner N/A info N/A N/A INFO_PLIST format name title N/A N/A open N/A N/A op join path Contents info.plist wb f N/A N/A N/A N/A f write N/A N/A info encode N/A N/A N/A N/A self _kwargs get icon N/A N/A icon N/A N/A N/A self _kwargs get icon N/A N/A N/A icon write N/A N/A op join path Contents Resources app.icns N/A N/A