My first two SecureDrop patches
Got my first two SecureDrop patches merged, wheeeehttps://github.com/freedomofpress/securedrop/commits?author=legoktm
Got my first two SecureDrop patches merged, wheeeehttps://github.com/freedomofpress/securedrop/commits?author=legoktm
Python 3.10 is a fantastic trap for everyone who uses YAML/Toml to configure CI, because writing an unquoted 3.10 will happily be normalized to 3.1.
https://hynek.me/articles/semver-will-not-save-you/ matches up exactly with how I feel about versioning and semver. Semver is great, but at the end of the day it's a best effort by maintainers and not perfect. It's also not applicable to literally everything and shouldn't be used as such.
Over the past two weeks I significantly sped up two of my Toolforge tools by using Redis, a key-value database. The two tools, checker and shorturls were slow for different reasons, but now respond instantaneously. Note that I didn't do any proper benchmarking, it's just noticably faster. If you're not…
mwparserfromhell is now fully on wheels. Well...not those wheels - Python wheels! If you're not familiar with it, mwparserfromhell is a powerful parser for MediaWiki's wikitext syntax with an API that's really convenient for bots to use. It is primarily developed and maintained by Earwig, who originally wrote it for…
I finally had the opportunity to give pytest a real try (I'm porting tests from ruby to Python), and it's amazing! Waaay better than unittest/nosetests. I especially liked the parametrization feature, which I think PHPUnit could probably benefit from. Specifically, I like how I could specify two parameters separately, and…
Today I found a legitimate use for https://github.com/danielquinn/python-phpPython's default ConfigParser requires each ini file to have a [section]. PHP doesn't, so to read a PHP-formatted INI file in Python requires some kind of custom parser (maybe it would be possible to extend ConfigParser?), where the python-php project came in handy.…
I've recently been using SQLAlchemy's ORM for a Python web app I'm developing. I really like the idea of declaring tables using a class, which provides you with an object class too.For querying, I'm still a bit undecided. I like .filter_by(), .first(), and .all(), but I'm worried that losing visibility…
My Toolforge (formerly "Tool Labs") tools will now start requiring HTTPS, and redirecting any HTTP traffic. It's a little bit of common code for each tool, so I put it in a shared "toolforge" library. from flask import Flask import toolforge app = Flask(__name__) app.before_request(toolforge.redirect_to_https) And that's it! Your tool…
Pelican theming isn't actually that difficult. It's based on jinja2 templates, and there were enough themes already out there to pick one and just start forking it. I'm not too happy that they want themes installed into your system python path (or a virtualenv in my case), but since you…