<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/atagar/exitmap, branch master</title>
<subtitle>Damian's exitmap repository</subtitle>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/'/>
<entry>
<title>Taking advantage of stem's new stem.util.test_tools</title>
<updated>2014-02-13T17:37:46+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-13T17:37:46+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=d38ade4811cd0288f671fd53e7dac5328e04a3eb'/>
<id>d38ade4811cd0288f671fd53e7dac5328e04a3eb</id>
<content type='text'>
Clearing out a big chunk of code we copied from stem now that it's available in
its utils.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clearing out a big chunk of code we copied from stem now that it's available in
its utils.
</pre>
</div>
</content>
</entry>
<entry>
<title>Invoking subcommands via a daemon thread</title>
<updated>2014-02-02T21:55:23+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T21:55:23+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=3fe04ef471f1d0763a807930b21bf11d6e03b6bc'/>
<id>3fe04ef471f1d0763a807930b21bf11d6e03b6bc</id>
<content type='text'>
Another thread without the daemon flag set. Also some minor non-functional
tweaks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Another thread without the daemon flag set. Also some minor non-functional
tweaks.
</pre>
</div>
</content>
</entry>
<entry>
<title>Prompting tester to install pyflakes or pep8 if unavailailable</title>
<updated>2014-02-02T21:53:52+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T21:50:23+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=8973bf95b535e394c0c820d88aabd844b9f578a1'/>
<id>8973bf95b535e394c0c820d88aabd844b9f578a1</id>
<content type='text'>
On reflection we shouldn't just silently pass if pyflakes and pep8 are
unavailable. We should notify the user that we didn't do anything instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On reflection we shouldn't just silently pass if pyflakes and pep8 are
unavailable. We should notify the user that we didn't do anything instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewriting get_exits()</title>
<updated>2014-02-02T21:53:44+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T21:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=2079df41972025231e1e03a74450fb591318206a'/>
<id>2079df41972025231e1e03a74450fb591318206a</id>
<content type='text'>
This function is essentially doing a series of filters so simply opting for
that instead. The only functional change is that we now only do the
can_exit_to() filter if we have some hosts. From my read the prior code would
reject everything instead which I suspect was a bug.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function is essentially doing a series of filters so simply opting for
that instead. The only functional change is that we now only do the
can_exit_to() filter if we have some hosts. From my read the prior code would
reject everything instead which I suspect was a bug.
</pre>
</div>
</content>
</entry>
<entry>
<title>Running queue_reader in a daemon thread</title>
<updated>2014-02-02T21:27:41+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T21:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=48b0fa8e99ece0303bfafc844be011a48ba120e1'/>
<id>48b0fa8e99ece0303bfafc844be011a48ba120e1</id>
<content type='text'>
There's no reason for this to be a non-daemon thread. Especially since we
aren't joining on it for shutdown.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no reason for this to be a non-daemon thread. Especially since we
aren't joining on it for shutdown.
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplifying exitselector conditionals</title>
<updated>2014-02-02T21:15:05+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T21:15:05+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=03657ece06e39e070e12f68ce0ffef3bfeb327dd'/>
<id>03657ece06e39e070e12f68ce0ffef3bfeb327dd</id>
<content type='text'>
It's been too long since my CS courses. This conditionals made my head hurt...

  not ((address and address in desc.address) or (not address))

... is equal to...

  (not (address and address in desc.address)) and address

... which in turn is equal to...

  (not address or address not in desc.address) and address

The initial 'not address' is obviously pointless so this can finally be
distilled to the far more intuitive...

  address and address not in desc.address

The desc.address is a string. There's no reason to do substring comparison here
so swapping to equality...

  address and address != desc.address

I was tempted to just jump to that since it was clearly what the code was going
for, but that initial consitional was so weird I wanted to prove to myself it
was the same. :)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's been too long since my CS courses. This conditionals made my head hurt...

  not ((address and address in desc.address) or (not address))

... is equal to...

  (not (address and address in desc.address)) and address

... which in turn is equal to...

  (not address or address not in desc.address) and address

The initial 'not address' is obviously pointless so this can finally be
distilled to the far more intuitive...

  address and address not in desc.address

The desc.address is a string. There's no reason to do substring comparison here
so swapping to equality...

  address and address != desc.address

I was tempted to just jump to that since it was clearly what the code was going
for, but that initial consitional was so weird I wanted to prove to myself it
was the same. :)
</pre>
</div>
</content>
</entry>
<entry>
<title>Authenticate to tor via cookie auth</title>
<updated>2014-02-02T20:59:19+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T03:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=fdbb1722d4ae02554f29436c8ae33adda6e3249b'/>
<id>fdbb1722d4ae02554f29436c8ae33adda6e3249b</id>
<content type='text'>
No reason not to include authentication. Stem can transparently handle anything
except for password authentication.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No reason not to include authentication. Stem can transparently handle anything
except for password authentication.
</pre>
</div>
</content>
</entry>
<entry>
<title>Static tests and shifting to PEP8 conventions</title>
<updated>2014-02-02T01:07:36+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T01:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=57e0be340d91d47b7b82ec214bb3107d8141616b'/>
<id>57e0be340d91d47b7b82ec214bb3107d8141616b</id>
<content type='text'>
Adding a run_tests.py executable that runs pyflakes and pep8 checks on our
project. Also shifting exitmap's conventions to be PEP8 compliant.

None of these changes should have a functional impact, and indeed a quick
sanity test of exitmap still works.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adding a run_tests.py executable that runs pyflakes and pep8 checks on our
project. Also shifting exitmap's conventions to be PEP8 compliant.

None of these changes should have a functional impact, and indeed a quick
sanity test of exitmap still works.
</pre>
</div>
</content>
</entry>
<entry>
<title>Renaming variables and functions to the underscore convention</title>
<updated>2014-02-02T01:06:57+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T01:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=59db48de6853afb1e7789f52ec54203a5d181c06'/>
<id>59db48de6853afb1e7789f52ec54203a5d181c06</id>
<content type='text'>
Python's conventions are to use camelcase for classes (MyClass) but underscore
for everything else (my_function() and my_variable). Actually, just a little
while ago I spent over a week fixing this for arm (I was originally a java
developer, so camelcase was an old habbit). Thankfully exitmap is a *lot*
smaller.

Did bulk renaming with...

  grep -ilr 'oldName' ./* | xargs -i@ sed -i 's/oldName/new_name/g' @
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python's conventions are to use camelcase for classes (MyClass) but underscore
for everything else (my_function() and my_variable). Actually, just a little
while ago I spent over a week fixing this for arm (I was originally a java
developer, so camelcase was an old habbit). Thankfully exitmap is a *lot*
smaller.

Did bulk renaming with...

  grep -ilr 'oldName' ./* | xargs -i@ sed -i 's/oldName/new_name/g' @
</pre>
</div>
</content>
</entry>
<entry>
<title>Removing spaces from around keywords and variables</title>
<updated>2014-02-02T00:27:25+00:00</updated>
<author>
<name>Damian Johnson</name>
<email>atagar@torproject.org</email>
</author>
<published>2014-02-02T00:23:24+00:00</published>
<link rel='alternate' type='text/html' href='https://gitweb.torproject.org/user/atagar/exitmap.git/commit/?id=727940ebe3a3f16e1e83b2172333319b6464ad0f'/>
<id>727940ebe3a3f16e1e83b2172333319b6464ad0f</id>
<content type='text'>
Yet another bit of PEP8 that exitmap follows but I don't. Removing E251 from
the blacklist and fixing the occurances.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Yet another bit of PEP8 that exitmap follows but I don't. Removing E251 from
the blacklist and fixing the occurances.
</pre>
</div>
</content>
</entry>
</feed>
