This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Workaround Boost.Filesystem V3 behaviour change in boost 1.56. | |
* See original at http://thisthread.blogspot.com/2011/07/using-recursivedirectoryiterator.html | |
*/ | |
void plainListTree(boost::filesystem::path path) // 1. | |
{ | |
dump(path, 0); | |
boost::filesystem::recursive_directory_iterator it = createRIterator(path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import calendar | |
import dateutil.parser | |
import time | |
def parseIso8601(timestr): | |
"""Parse `timestr` into UTC seconds since epoch.""" | |
dt = dateutil.parser.parse(timestr) | |
if dt.tzinfo: | |
return calendar.timegm(dt.utctimetuple()) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# readline 6.0 emits unexpected escape characters | |
# in rl_initialize() if TERM=xterm (and some variants). | |
# The python readline module calls rl_initialize() at | |
# module import, which triggers the issue. | |
# RHEL/CentOS 6.x uses readline 6.0. | |
# Workaround the issue by changing the TERM type if | |
# it starts with "xterm" before any module import. | |
# | |
# @see http://bugs.python.org/issue19884 |