<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>evadeflow&#039;s external brain</title>
	<atom:link href="http://evadeflow.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://evadeflow.com</link>
	<description>Where I put stuff I&#039;ve learned... so I can promptly forget it!</description>
	<lastBuildDate>Tue, 07 May 2013 20:19:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>fasd, oh-my-zsh!</title>
		<link>http://evadeflow.com/2013/05/fasd-oh-my-zsh/</link>
		<comments>http://evadeflow.com/2013/05/fasd-oh-my-zsh/#comments</comments>
		<pubDate>Tue, 07 May 2013 20:19:30 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1143</guid>
		<description><![CDATA[I&#8217;ve been pretty annoyed today that zsh isn&#8217;t automagically TAB-completing the names of Python unittest modules for me on the commandline. But then again, I haven&#8217;t spent much time really learning zsh.  Well, that&#8217;s over! I&#8217;m gonna have my cake and eat it, too, dammit! I need to get these: https://github.com/clvv/fasd#readme https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins This guy has [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>I&#8217;ve been pretty annoyed today that zsh isn&#8217;t automagically TAB-completing the names of Python unittest modules for me on the commandline. But then again, I haven&#8217;t spent much time <em>really</em> learning zsh.  Well, that&#8217;s over! I&#8217;m gonna have my cake and eat it, too, dammit!</p>
<p>I need to get these:</p>
<ul>
<li><a href="https://github.com/clvv/fasd#readme">https://github.com/clvv/fasd#readme</a></li>
<li><a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins">https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins</a></li>
</ul>
<p><a href="http://blog.patshead.com/2011/02/why-i-finally-stuck-with-zsh.html">This guy</a> has convinced me that I&#8217;m barely scratching the surface of what zsh can do&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/05/fasd-oh-my-zsh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Subversion commit hook</title>
		<link>http://evadeflow.com/2013/05/another-subversion-commit-hook/</link>
		<comments>http://evadeflow.com/2013/05/another-subversion-commit-hook/#comments</comments>
		<pubDate>Wed, 01 May 2013 21:05:54 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1140</guid>
		<description><![CDATA[I recently set up a Subversion pre-commit hook at work to check for the presence of an issue reference in the commit message. It was tricky enough to figure out that I thought I&#8217;d post the end result here. Many thanks to this post for flattening the learning curve for me. It&#8217;s an old article, [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>I recently set up a Subversion pre-commit hook at work to check for the presence of an issue reference in the commit message. It was tricky enough to figure out that I thought I&#8217;d post the end result here. Many thanks to <a title="Seminal post on Subversion pre-commit hooks" href="http://wordaligned.org/articles/a-subversion-pre-commit-hook" target="_blank">this post </a>for flattening the learning curve for me. It&#8217;s an old article, but I was able to reuse a good chunk of the code it presents. And the ability to call it with <tt>--revision</tt> is really helpful for testing.</p>
<p>The tricky bit was dealing with our server&#8217;s slightly odd project layout. We have several repos that contain what amount to &#8216;sub-repos&#8217;, i.e., multiple directories that contain the conventional <tt>branches</tt>, <tt>tags</tt> and <tt>trunk</tt> sub-folders. We only wanted to enable the commit check on a subset of these &#8216;sub-repos&#8217;, so some futzing was required to do this filtering. I also made the script as generic as possible so that new types of checks can be added in the future. (The commented-out <tt>check_py_files_contain_no_tabs()</tt> call is an artifact of my proving to myself that I could, in fact, run a &#8216;battery&#8217; of checks, if desired.)</p>
<p>First, here&#8217;s the base <tt>pre-commit</tt> script that calls the main Python script:</p>
<pre class="brush: bash; gutter: false; toolbar: false; smart-tabs: false;">#!/bin/bash
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/local/bin/svnlook
/usr/local/bin/python /repo/my-project/hooks/pre-commit.py "$REPOS" "$TXN" &gt; /dev/null || exit 1
exit 0</pre>
<p>This calls the following:</p>
<pre class="brush: py; gutter: false; toolbar: false; smart-tabs: false;">#!/usr/bin/env python

#  Folders in this set will be subject to commit sanity-checks.
#  Update as needed...
COMMIT_CHECK_FOLDERS = frozenset([
    'SubProject-A/branches',
    'SubProject-A/tags',
    'SubProject-A/trunk',
    'SubProject-B/branches',
    'SubProject-B/tags',
    'SubProject-B/trunk',   
])

def capture(cmd):
    """Capture a command's standard output."""
    import subprocess
    return subprocess.Popen(
        cmd.split(), stdout=subprocess.PIPE
    ).communicate()[0]

def check_log_msg_contains_issue(look_cmd):
    """Check whether the commit message references an issue

    Returns 0 if the commit message contains an issue reference
    (e.g., '[NL-1234]'), otherwise returns 1

    """
    import re
    msg = capture(look_cmd.format("log"))
    pat = r'\[[A-Z]{2,8}-\d{1,6}\]'
    if re.search(pat, msg) is None:
        sys.stderr.write(
            '----------------------------------------'
            '----------------------------------------\n'
            'Please include an issue number in your commit message. (If no '
            'issue is relevant,\njust include "[NL-0000]" somewhere in the '
            'message...)\n'
        )

        return 1
    else:
        return 0

def files_updated(look_cmd):
    """ List the files touched by the current transaction.

    The `svnlook changed` can be pretty esoteric, looking something like:

    A  + moved_dir
    M  + moved_dir/README
    D    stuff/fish.c
    A    stuff/loot/bloo.h
    C    stuff/loot/lump.c
     C   stuff/loot/glub.c
    R    xyz.c
    U    trunk/file1.cpp
    A    trunk/file2.cpp

    The file status info is guaranteed to be only 4 characters wide, though,
    so we can get the file list just by snipping off the first four
    characters...

    """
    def filename(line):
        return line[4:]

    return [
        filename(f)
        for f in capture(look_cmd.format("changed")).split("\n")
        if f  #  0:
        sys.stderr.write(
            '----------------------------------------'
            '----------------------------------------\n'
            "Please remove TABs from these files before committing:"
            "\n  {0}\n".format(
                "\n  ".join(py_files_with_tabs)
            )
        )
    return len(py_files_with_tabs)

def main():
    retval = 0
    usage = """
    %prog &lt;SVN_REPO_PATH&gt; &lt;TRANSACTION_ID&gt;

    Run pre-commit options on a repository transaction.
    """

    from optparse import OptionParser
    from os.path import dirname
    parser = OptionParser(usage=usage)
    parser.add_option(
        "-r", "--revision",
        help="Test mode [TRANSACTION_ID actually refers to a revision]",
        action="store_true",
        default=False
    )
    try:
        (opts, args) = parser.parse_args()
        if len(args) != 2:
            parser.print_help()
            sys.exit(1)

        #  The `look_cmd` var below is a string-formatting template containing
        #  a '{0}' placeholder for whichever svnlook sub-command needs to be
        #  invoked.  It eventually winds up expanding to things like:
        #
        #    svnlook cat &lt;repos_path&gt; --transaction  
        #
        #  or:
        #
        #    svn log &lt;repos_path&gt; --revision 
        #
        # etc, etc...
        #
        repos, txnum_or_revnum = args
        if opts.revision:
            look_opt = "--revision"
        else:
            look_opt = "--transaction"

        look_cmd = "/usr/local/bin/svnlook {0}" + " {0} {1} {2}".format(
            repos, look_opt, txnum_or_revnum
        )

        #  Run our commit checks if *any* of the files touched by this commit
        #  reside in (sub-)folders listed in COMMIT_CHECK_FOLDERS
        if commit_touches_checked_folders(look_cmd):
            retval += check_log_msg_contains_issue(look_cmd)
            #retval += check_py_files_contain_no_tabs(look_cmd)

    except Exception as e:
        import traceback
        sys.stderr.write("Unhandled exception in pre-commit script: ")
        traceback.print_exc()
        retval += 1

    return retval

if __name__ == "__main__":
  import sys
  sys.exit(main())</pre>
<p>All in all, I&#8217;m pretty happy with the result. Adding the catchall <tt>except</tt> clause that prints a traceback turned out to be a nice debugging aid. (And I needed one, too!)</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/05/another-subversion-commit-hook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build System Redux</title>
		<link>http://evadeflow.com/2013/04/build-system-redux/</link>
		<comments>http://evadeflow.com/2013/04/build-system-redux/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 01:28:04 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[build automation]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1135</guid>
		<description><![CDATA[I recently came across this  blog post by Bill Hoffman of Kitware about parallel builds with CMake. Of particular interest were these utilities: Ninja jom CMake will work with both of these. Bill also mentions that the command: cmake -–build . –-config Debug can be used to build an IDE-based project in preference to, say, [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>I recently came across this  <a href="http://www.kitware.com/blog/home/post/434">blog post</a> by Bill Hoffman of Kitware about parallel builds with CMake. Of particular interest were these utilities:</p>
<ul>
<li><a href="http://martine.github.io/ninja/manual.html">Ninja</a></li>
<li><a href="http://qt-project.org/wiki/jom">jom</a></li>
</ul>
<p>CMake will work with both of these. Bill also mentions that the command:</p>
<pre>    cmake -–build . –-config Debug</pre>
<p>can be used to build an IDE-based project in preference to, say, <tt>msbuild</tt>. This ought to be a big help dealing with the various combinations of Visual Studio command line build tools. (I only verified that this works with Visual C++ 2010 Express, but it looks like it should work fine with the other versions.)</p>
<p>Finally, this build tool (mentioned in the Ninja docs) looks quite interesting:</p>
<ul>
<li><a href="https://github.com/apenwarr/redo">https://github.com/apenwarr/redo</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/04/build-system-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse and LIBRARY_OUTPUT_PATH</title>
		<link>http://evadeflow.com/2013/04/eclipse-and-library_output_path/</link>
		<comments>http://evadeflow.com/2013/04/eclipse-and-library_output_path/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 21:52:28 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cmake]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1130</guid>
		<description><![CDATA[Remember this: Eclipse gets heartburn if you set LIBRARY_OUTPUT_PATH to ${CMAKE_BINARY_DIR}, so disable this temporarily if you want to go spelunking around a CMake-based project in Eclipse. Failure to do will cause the IDE to spit out a confusing error message along the lines of: Error processing changed links in project description file. Cannot create [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>Remember <a href="http://public.kitware.com/Bug/view.php?id=13358">this</a>: Eclipse gets heartburn if you set <tt>LIBRARY_OUTPUT_PATH</tt> to <tt>${CMAKE_BINARY_DIR}</tt>, so disable this temporarily if you want to go spelunking around a CMake-based project in Eclipse. Failure to do will cause the IDE to spit out a confusing error message along the lines of:</p>
<pre>Error processing changed links in project description file.   Cannot create a link to
[blah-blah] because it overlaps the location of the project that contains the linked resource.</pre>
<p>That one gets me every time, since I use Eclipse so infrequently. Now it won&#8217;t any more. (Note: I think this caveat applies to <tt>EXECUTABLE_OUTPUT_PATH</tt> as well&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/04/eclipse-and-library_output_path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Python 2.6.8 on Ubuntu 12.04 without SSLv2</title>
		<link>http://evadeflow.com/2013/03/building-python-2-6-8-on-ubuntu-12-04-without-sslv2/</link>
		<comments>http://evadeflow.com/2013/03/building-python-2-6-8-on-ubuntu-12-04-without-sslv2/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 20:07:40 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1127</guid>
		<description><![CDATA[Holy @#?!, what a PITA. Thankfully, someone (a certain &#8216;schmichael&#8217;) had already gone through the pain and suffering of figuring this all this out. All I had to do was clone his fork and build/install it to $(HOME). Then I ran: % cd ~/projects/virtual_envs % python2.6 virtualenv-1.9.1/virtualenv.py --distribute mysql_sand % source mysql_sand/bin/activate (mysql_sand)% pip install [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>Holy @#?!, what a PITA. Thankfully, someone (a certain &#8216;schmichael&#8217;) had already gone through the pain and suffering of <a title="Building Python 2.6.8 on Ubuntu 12.04" href="http://blog.schmichael.com/2012/05/29/building-python-2-6-8-on-ubuntu-12-04/">figuring this all this out</a>. All I had to do was clone his <a title="Python NoSSLv2 Fork" href="https://bitbucket.org/schmichael/cpython-v2.6.8-nosslv2">fork</a> and build/install it to <tt>$(HOME)</tt>. Then I ran:</p>
<pre>% cd ~/projects/virtual_envs
% python2.6 virtualenv-1.9.1/virtualenv.py --distribute mysql_sand
% source mysql_sand/bin/activate
(mysql_sand)% pip install mysql-python</pre>
<p>Then, I was <em>finally</em> able to run Python scripts that use the MySQL bindings. Geesh&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/building-python-2-6-8-on-ubuntu-12-04-without-sslv2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kitware blog post on cross-compiling for RasPi</title>
		<link>http://evadeflow.com/2013/03/kitware-blog-post-on-cross-compiling-for-raspi/</link>
		<comments>http://evadeflow.com/2013/03/kitware-blog-post-on-cross-compiling-for-raspi/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 17:58:57 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cross]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1124</guid>
		<description><![CDATA[This is a really nice (and thorough) cross-compilation walk-through: http://www.kitware.com/blog/home/post/426 I might need to build a(nother) ARM toolchain soon, and this will save a lot of finger-mumbling&#8230;]]></description>
				<content:encoded><![CDATA[<p></p><p>This is a really nice (and <em>thorough</em>) cross-compilation walk-through:</p>
<ul>
<li><a title="Cross-Compiling for Raspberry Pi" href="http://www.kitware.com/blog/home/post/426" target="_blank">http://www.kitware.com/blog/home/post/426</a></li>
</ul>
<p>I might need to build a(nother) ARM toolchain soon, and this will save a lot of finger-mumbling&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/kitware-blog-post-on-cross-compiling-for-raspi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hang on to these links</title>
		<link>http://evadeflow.com/2013/03/hang-on-to-these-links/</link>
		<comments>http://evadeflow.com/2013/03/hang-on-to-these-links/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 15:40:45 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[protobuf]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1118</guid>
		<description><![CDATA[At some point, these might prove useful: http://stackoverflow.com/questions/11484700/python-example-for-reading-multiple-protobuf-messages-from-a-stream http://code.google.com/p/spinn3r-client/wiki/Protostream https://groups.google.com/forum/?fromgroups=#!topic/protobuf/xgmUqXVsK-o It boils down to: how can I implement CodedInputStream in Python. (Why I might want to is another story, too long to tell right now&#8230;)]]></description>
				<content:encoded><![CDATA[<p></p><p>At some point, these might prove useful:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/11484700/python-example-for-reading-multiple-protobuf-messages-from-a-stream">http://stackoverflow.com/questions/11484700/python-example-for-reading-multiple-protobuf-messages-from-a-stream</a></li>
<li><a href="http://code.google.com/p/spinn3r-client/wiki/Protostream">http://code.google.com/p/spinn3r-client/wiki/Protostream</a></li>
<li><a href="https://groups.google.com/forum/?fromgroups=#!topic/protobuf/xgmUqXVsK-o">https://groups.google.com/forum/?fromgroups=#!topic/protobuf/xgmUqXVsK-o</a></li>
</ul>
<p>It boils down to: how can I implement <tt>CodedInputStream</tt> in Python. (<em>Why</em> I might want to is another story, too long to tell right now&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/hang-on-to-these-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using &#8216;paste&#8217; in the shell</title>
		<link>http://evadeflow.com/2013/03/using-paste-in-the-shell/</link>
		<comments>http://evadeflow.com/2013/03/using-paste-in-the-shell/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 19:14:15 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1114</guid>
		<description><![CDATA[It turns out to be kind of a nuisance to sum a column of numbers in the shell. I needed to calculate the total &#8216;raw&#8217; file size of a file tree, which meant I needed to not count the 4096 bytes (on Linux) for the directory inodes. I could easily get the file sizes with: [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>It turns out to be kind of a nuisance to sum a column of numbers in the shell. I needed to calculate the total &#8216;raw&#8217; file size of a file tree, which meant I needed to <em>not</em> count the 4096 bytes (on Linux) for the directory inodes. I could easily get the file sizes with:</p>
<pre>% find -type f | xargs du -b | cut -f1</pre>
<p>But how to sum the output of this? <a href="http://stackoverflow.com/questions/3096259/bash-command-to-sum-a-column-of-numbers" target="_blank">This SO post</a> helped me figure out that the <tt>paste</tt> utility is my friend in this case:</p>
<pre>% find . -type f | xargs du -b | cut -f1 | paste -sd+ | bc</pre>
<p>Nice. How did I make it this many years without knowing about <tt>paste</tt>? `:-| (There&#8217;s probably some option to <tt>du</tt> that will do the same thing, but I couldn&#8217;t manage to figure it out—and now I don&#8217;t need to&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/using-paste-in-the-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building D-Bus on Microsoft Windows</title>
		<link>http://evadeflow.com/2013/03/building-d-bus-on-microsoft-windows/</link>
		<comments>http://evadeflow.com/2013/03/building-d-bus-on-microsoft-windows/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 02:56:10 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[dbus]]></category>

		<guid isPermaLink="false">https://evadeflow.com/?p=1110</guid>
		<description><![CDATA[We’re considering using D-Bus as the primary IPC mechanism for a new product at work, and we need to get and idea of how complete its Windows support is. So I don’t forget, here’s how I managed to build it on a Windows 7 box at home using Visual Studio 10 Express: Download and install [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>We’re considering using D-Bus as the primary IPC mechanism for a new product at work, and we need to get and idea of how complete its <a href="http://www.freedesktop.org/wiki/Software/dbus#Windows_port" target="_blank">Windows support</a> is. So I don’t forget, here’s how I managed to build it on a Windows 7 box at home using Visual Studio 10 Express:</p>
<ol>
<li>Download and install <a href="http://sourceforge.net/projects/expat/files/expat_win32/2.1.0/expat-win32bin-2.1.0.exe/download" target="_blank">expat_win32</a>. </li>
<li>Clone the D-Bus git repo:
<pre class="brush: dos; gutter: false; toolbar: false; smart-tabs: false;">c:\d&gt;cd projects
c:\d\projects&gt;git clone git://anongit.freedesktop.org/dbus/dbus    </pre>
</li>
<li>In a <em>Windows </em>command prompt, make a build folder somewhere and run these commands (or something similar):
<pre class="brush: dos; gutter: false; toolbar: false; smart-tabs: false;">c:\d\projects&gt;mkdir build\dbus &amp;&amp; cd build\dbus
c:\d\projects\build\dbus&gt;&quot;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd&quot; /x86 /Release
c:\d\projects\build\dbus&gt;cmake -DEXPAT_INCLUDE_DIR=&quot;C:/Program Files (x86)/Expat 2.1.0/Source/lib&quot; ^<br />&#160; -DEXPAT_LIBRARY=&quot;C:/Program Files (x86)/Expat 2.1.0/Bin/libexpat.lib&quot; ^<br />&#160; ..\..\dbus\cmake</pre>
<p>The <tt>SetEnv.Cmd</tt> script may live elsewhere, depending on your flavor of Windows and Visual Studio. Season to taste.</p>
</li>
<li>Type <tt>nmake</tt> to build everything. (For me, it built without errors.) </li>
</ol>
<p>Unfortunately, the tests didn&#8217;t all pass. When I ran the command suggested in the <tt>README.win</tt> file, I got got crash pretty quickly:</p>
<pre class="brush: dos; gutter: false; toolbar: false; smart-tabs: false;">c:\d\projects\build\dbus&gt;bin\dbus-test.exe c:\d\projects\dbus\test\data
Test data in c:\d\projects\dbus\test\data
dbus-test: running string tests
dbus-test: checking for memleaks
dbus-test: running sysdeps tests
dbus-test: checking for memleaks
dbus-test: running data-slot tests
dbus-test: checking for memleaks
dbus-test: running misc tests
dbus-test: checking for memleaks
dbus-test: running address tests
dbus-test: checking for memleaks
dbus-test: running server tests
dbus-test: checking for memleaks
dbus-test: running object-tree tests
dbus-test: checking for memleaks
dbus-test: running signature tests
dbus-test: checking for memleaks
dbus-test: running marshalling tests
dbus-test: checking for memleaks
dbus-test: running marshal-recursive tests
&gt;&gt;&gt; &gt;&gt;&gt; Each value by itself 120 iterations
 0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 120 this test (120 cumula
tive)
&gt;&gt;&gt; &gt;&gt;&gt; Each value by itself with arrays as blocks 120 iterations
 0%  10%  20%  30%  40%  50%  60%  70%  80%  90%  100% 120 this test (240 cumula
tive)
&gt;&gt;&gt; &gt;&gt;&gt; All values in one big toplevel 1 iteration</pre>
<p>A Window popped up saying “<tt>dbus-test.exe</tt> has stopped working,” after that.&#160; Not sure what that’s about. It’s possible that I’m just missing some setup steps, or that this crash is a known-but-harmless bug. Or the current <tt>HEAD</tt> on <tt>master</tt> is busted. It could be a lot of things. I’ll post updates as I figure it out. I’m just really encouraged that Windows support has been folded into the main development branch!</p>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/building-d-bus-on-microsoft-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Miscellaneous dbus-python example</title>
		<link>http://evadeflow.com/2013/03/miscellaneous-dbus-python-example/</link>
		<comments>http://evadeflow.com/2013/03/miscellaneous-dbus-python-example/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 22:24:30 +0000</pubDate>
		<dc:creator>Evade Flow</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[dbus]]></category>

		<guid isPermaLink="false">http://evadeflow.com/?p=1105</guid>
		<description><![CDATA[I keep needing to refer to this example, so I may as well put it here for safe-keeping. It&#8217;s not perfect, but it kinda/sort gives a feel for how the dbus-python bindings work: import sys import dbus if __name__ == '__main__': from os.path import basename if len(sys.argv) != 2: print "Usage: {0} ".format(basename(sys.argv[0])) sys.exit(1) devname [...]]]></description>
				<content:encoded><![CDATA[<p></p><p>I keep needing to refer to this example, so I may as well put it here for safe-keeping. It&#8217;s not perfect, but it kinda/sort gives a feel for how the dbus-python bindings work:</p>
<pre class="brush: py; gutter: false; toolbar: false; smart-tabs: false;">import sys
import dbus

if __name__ == '__main__':
    from os.path import basename
    if len(sys.argv) != 2:
        print "Usage: {0} ".format(basename(sys.argv[0]))
        sys.exit(1)

    devname = sys.argv[1]
    bus = dbus.SystemBus()
    obj = bus.get_object("org.freedesktop.UDisks", "/org/freedesktop/UDisks")
    iface = dbus.Interface(obj, 'org.freedesktop.UDisks')
    devices = iface.get_dbus_method('EnumerateDevices')()

    objpath = "/org/freedesktop/UDisks/devices/" + devname
    if dbus.ObjectPath(objpath) not in devices:
        print "Device '{0}' does not appear to exist...".format(devname)
        sys.exit(1)

    obj = bus.get_object("org.freedesktop.UDisks", objpath)
    iface = dbus.Interface(obj, 'org.freedesktop.UDisks.Device')
    files = iface.get_dbus_method('FilesystemListOpenFiles')()
    for fdata in files:
        if fdata[2]: print fdata[2].decode()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://evadeflow.com/2013/03/miscellaneous-dbus-python-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
