Computer Games computing Python

Sorting Steam Screenshots

So Steam, by default, when asked to take a screenshot will merrily scatter them hither and yon across your hard-drive with unwarranted abandon. Specifically, it’ll put them in the app’s home directory. This isn’t great, because what with cloud-saves and game streaming, I tend to treat the hard-drive with my games on it as transient, and not backed up.

However, Steam also has developed a setting called “Save uncompressed screenshots”, and if you set that and a directory, it’ll put all your screenshots in one place! Hurrah!

Except now all your screenshots are called things like “306760_20160825142347_1.png”. Now, the bit before the underscore is a Steam app ID, so you can look up the game name and file things nicely into the right folders.

So here’s a python script to do that thing.

cevearn comics linux Python Shebang tv

Week Nine – it’s better than bad, it’s good

Quiet work week, so we’ll skip that. Decided that I’d had enough of print statements, and moved both Lifestream and Lampstand over to use Python logging instead for everything outputty. Lampstand also needs a pass to separate output into levels, right now everything’s at INFO.

Positive feedback on some creative writing I did recently – on tumblr, and in scraps elsewhere – has led me to want to carve out time to get the novel moving forward again. I need to suppress the urge to kill it with fire and start from scratch, but right now it’s plodding a bit.

Somewhere between Rest and Play lies Odyssey work this week. A good Story Team meeting at the weekend has set some flags out for the year, and indeed next, and then I spent a few hours putting together the Odyssey T-Shirt shop, to supplement our costume & props budget with mercenary goodness.

Somewhere over the last week I’ve also carved out 13 hours to watch the full first series of Daredevil on Netflix, which I enjoyed a lot, and should turn into another entry shortly…

aqWiki BrowserAngel Larp programming Projects Python

Week One

Daily posts are not interesting, and I’ve got the same problem as Norm, to some degree. I’ve got dozens of projects I’m working on, some of them professionally, so I’m going to try weekly updates, with the hope that with those come progress.


Project S is the company I’ve been working for, for the past year. They have a thing, and I’ll be explaining more about that thing the more public we are about it. The last week I’ve been mostly fixing communication issues with our API server (Beehive) and the Media server (Warehouse). Both are Flask-based python applications backing on to a shared CouchDB cluster, and I’ve been working on getting the transcoding services (Thumbnailing, indexing, that kind of thing) to communicate back to the main systems. It’s uncovered an interesting series of security context issues, and some horrible things around EXIF, where finding out if an image is the same way up it started has become troublesome.

My long running project for the other company continues. There is light at the end of the tunnel. I fear the light, now.

New things? Ansible, this month, and also looking at front-end javascript libraries like KnockoutJS. This year I have learnt a lot about Symfony 1.3. None of it good.


AqWiki Wetired

Over ten years ago, I created AqWiki, a PHP3 based, textile formatted basic wiki system. Originally as a replacement for BrowserAngel’s TCL-based wiki system, it contains structural flaws caused by being written for PHP3, conceptual flaws due to being written by me ten years ago, and security flaws due to being written by me in PHP3 ten years ago. However, one of those flaws is a slightly baroque SQL schema, and so writing an export of it has been hard, and writing an importer for any better wiki software harder still. However, my current saviour is Gollum, which is a git-backed wiki system. So, I have written an exporter for AqWiki to Gollum. It’s not perfect – There are a few formatting inconsistencies, and I need to fix some double-quoting issues – but it’ll get me off my own NiH platform, and into a new and better world.

More usefully, it’s meant digging deeper into gitpython and some more knowledge about how git works internally, which improves my ability to help others get out of git-holes.

Moving My Lampstand

Lampstand is an IRC bot I originally wrote for a channel I was on some time ago. Since then, I’ve taken over as Responsible Adult for the channel, and it’s become somewhere halfway between a utility bot, toy and mascot. It’s also rotting a bit, since the Twisted framework it’s built on never liked IRC much, and I’m using an outdated version. It’s never really needed deep enough development to keep me from working on the live bot, and it’s a toy, but a rewrite of the core is going to involve spreading the parts on the floor a bit and risking oil on the carpet, so I’ve built it a nice Vagrant virtual environment builder, which has the nice side effect of encouraging the people who report bugs and are able to fix them to be able to do so.


Empire Wiki

The empire plot wiki was getting occasional errors, so I bit the bullet and ran an upgrade of Mediawiki on it.

This will teach me to be quite so fucking stupid.

Everything broke, from the custom theme to the database access, the bugs still existed, and the search functionality – using a Lucene backend – was still entirely fucked. So I fixed what I could, ripped out Lucene in favour of the normal mediawiki search (which sucks, but at least was updating) and backed away slowly.

Then backed back in even more slowly when I got more reports of white-outs of death from updating articles. Fuck everything to do with mediawiki, slowly and with corkscrews.


Me and Mr Cooke have been batting around the concepts for a Scifi larp game for a while, and so I decided to put some of my initial thoughts into short textual illustration, which has raised some interest and caused a number of discussions on the metaphysic and how our Sci Fi universe works. Next steps are to turn it from a universe into a larp game, because I don’t have enough of those.

Django escape Piracy Inc

Piracy Inc

A few years and five houses ago, I had an idea. It was to be an online game, browser based, where you would own and run a racing car company. There’d be research and development, and aliens, and stuff, and every Saturday night, you and the people in your league would be able to watch in real time as the races happened.

I started it in PHP, badly. I used it as a reason to learn Django a few months later, then converted it to Code Igniter when I was about to start at Doof and needed to learn it in a hurry. Then I changed it to be about Pirates instead of race cars, because I’m not actually very interested in race cars. Then I rewrote it in Plank, which was a PHP framework library I still think should exist. Then again in Rails because frameworks are hard and Ruby seemed useful, then finally in Django again because I actually like Django.

By the PHP version it had bits of the game defined, by the Ruby version it had ships and missions and such, and by the Django version there are actual bits of the universe to go and attack (though you can’t actually attack them yet).

Updates on how its going appear on its own weblog every so often, and between that, LARP, Soulbook and Languagelab, that’s what I’m doing with my time.

Cantrip Django Imported From Epistula

Djingle Django Scarecrow

One of the concepts you may run into if you read into Python and its fans in great depth (and here I mean Python of the programming type rather than the Monty type) is that of “Guido’s Time Machine”, the number of times when you are thinking “Would it be nice if Python did this…” and you suddenly find that yes, that’s exactly how Python does it, to the point where the only way Guido could have possibly considered all this would be if he already knew.

I’m having the same kind of thing with Django. Frameworks for validation, existing user system, that kind of thing. Stuff like “Do you know what would be nice? If I could do something so that my Logged in User’s Profile appeared in the default scope of a template, so I didn’t have to pass it in every time, and keep throwing it around the program.” and suddenly, there are Context Processors.

The annoying bits are where stuff is under development, or half documented. For example, Having spent a while creating a User Profile system to associate information specific to this system (Authentication code, invite code, email me alerts, for example) and joined it one-to-one with the user system, I then find a tiny little bit of text in the User Auth system docs which says:

get_profile() -- Returns a site-specific profile for this user. Raises django.contrib.auth.models.SiteProfileNotAvailable if the current site doesn't allow profiles.

This sound really close to what I’ve spend a while doing myself, but that is the first, last and only reference to it in the docs that I can find.

OTOH, I’ve now got a system you can log into and register for, and I’ve got a deeper understanding of how Django works. Yay.

Aquaintances Imported From Epistula Python

Aquaintances 2

Aquaintances 2 is an XML Feed reader for Microsoft Windows, Linux and Apple OSX. It will support baysian filtering of posts – meaning posts you are more interested in will float to the top of your reading lists – as well as regex field matching. It is built in GTK/Python (on top of LibGlade) using the Mozilla Firefox GTK bindings. It parses feeds with the Ultra Liberal Feed Parser, stores them (and most other things) in an SQLite database. It will revolutionise the way you keep track of the world.

Natually, it doesn’t work yet.

This morning I fired up Glade and put down the main interface for the system, which involved a certian amount of farting around with GTK’s box model, and all was fine until I had to attempt to tie the web browser to this.

My preference for this project was to use Mozilla’s “Gecko” rendering engine for the actual displaying of feeds, which was made more difficult by the fact that there are three sets of pages refering to the GTK bindings I was looking for. PyGTKMoz is an aborted attempt to get it working, Mozilla itself has a website on the subject, and PyGTKMoz refers me to PyGTK, which doesn’t mention the bindings at all. Eventually it transpires that the Mozilla bindings are now part of “python-gnome-extras”, which an apt-get installed for me.

That failed to work, because it doesn’t require “mozilla-dev” or “mozilla-firefox-dev” and even when those are installed, I had to manually add /usr/lib/mozilla-firefox add /usr/lib.mozilla to /etc/ so that Python could find it.

Then I had to work out how to get a Widget Glade doesn’t know about into my nice Gladey interface, for which this article was a handy guide, although it’s bitrotted a bit.

Okay, so we have an interface that happily displays a webpage. time to put some actual feed data in it. Importing my OPML file from Bloglines, I wrote a thing to parse the XML (Starting with minidom, which failed because I needed to keep track of recursive tags. so I rebuilt it in SAX (An acronym with too many abbreviations in it) with the standard push/pop method of keeping track of where the hell we are, a method I’ve always found exceedingly ugly, but at least it’s quick…

The tree interface to the subscriptions list was next. The GtkTreeView element caused me a number of problems, partially because I was trying to use it before I really understood it. Also, all the tutorials for using it I found (iki fi, & moeraki were the most useful, as well as the Real Docs) assume you’re building the thing from scratch, rather than editing an already existing TreeView object. Also, there was an interchangability between “TreeStore” and “TreeModel” that was starting to give me a headache. Then, in a blinding flash of light, my screensaver kicked in, englightenment dawned, and I finally grokked it.

So, I have an interface with working buttons that displays the home page of every feed I subscribe to. Except three, which causes a segmentation fault for reasons I don’t understand, but are probably Not My Fault.

Aim is to get it reading and displaying feeds by tonight, with the Bayesian stuff happening tomorrow, at which point I release Real Code and start making it both cool and useable.

2005-05-02: Changed gtkmozbinding instructions, the firefox library appears to crash if you need a plugin

Imported From Epistula programming Projects Python web development

Project Scout

Somewhat to my suprise, I have recieved not one, but two patches to open source projects that I run. That is that gilmae submitted a better install document for AqWiki, and John Meadows has submitted a new version of the viewer file for MusicDB

Flush with this success, I’ve started a new project. Well, two. Threeish, really. First, I’ve gone back to the base system that Cantrip and Escape will be built on, which is actually the Epistula execution model rebuilt in python and mod_python. This is almost finished (yay) and is far neater than the PHP version (double yay) but I’m having trouble with one thing. So, pythonites who are still reading this crap: How do I initalise a class where the name of the class is contained in a variable?

Two, and more importantly, how should I have known this?

The third thing is a collision of a few technologies I’ve been wanting to use for a while: XMLTV, SQLite and AJAX, or DHTML, or whatever we’re calling it today, with a dash of new-media SMS stuff thrown in. Basic premise for project Scout is that it sends you an SMS ten minutes before a TV program that you wanted is due to start. It’s a little more complicated than that, but not much (Until you get to the AJAX bits, really). Enough for me to be able to use it to drink even more of the Python kool-aid, while having something more useful at the end than a random philosophy generator.

Imported From Epistula Python

Mounting Python

How do you work with Python and web development? Do you use quixote, mod_python, normal CGI, Zope or something I’ve never heard of? Why do you use that instead of something else?

Computer Games Imported From Epistula Python RPG

Vampire: The Maskerade: Bloodlines. Plus: Python

(Too much punctuation in one title, perhaps?)

Aquarion returns from playing Bloodlines
Mandy_Away: good?
Aquarion: Sort of
Aquarion: The story is well done, the characters are very well done, and I’m enjoying it.
Aquarion: And it uses the HL2 engine, so it looks cool
Aquarion: OTOH, it runs like a dog (Even though HL2 – which is far more visually complicated – glides)
Aquarion: and there are occasional scripting glitches which are annoying.
Aquarion: (Like a bad-guy who crashes though the door, gun at the ready, and then stands up and still for a while because I’m hiding behind a box and he can’t see me. Which just looks silly)
Aquarion: Oh, and the combat system is a bitch, but that may be because it tends to sink the frame-rate though the floor.
Aquarion: OTOH, I’ve been playing it for about six or so hours, apparently, which is a bit of a shock. So it must be bearable 🙂

Talking of scripting, though, here is an example of Bloodlines’ scripting:

## after the masquerade pop-up in the chopshop office
def OnMasqueradeEnd():
    if IsClan(FindPlayer(), "Nosferatu"):
        popup = Find("popup_24")
        popup = Find("popup_15")

    trig = Find("trig_popup_masquerade")

Yup, Bloodlines’ scripting is pure, 100% unadulterated Python code, so if it doesn’t work, I can at least try to fix it…

Cantrip Imported From Epistula programming Python

Cantrip Diary – ZopeTastic

Okay, so my new workplace use Zope, so it’s probably a good idea for me to use that as a framework. I mean, enough people use it for it not to be too bad, right?

Dear god does it suck. I mean, Whales though really thin gauze, it sucks that badly. I got it working on my local network after swearing at it quite loudly. It’s own personal religion of “Not Invented Here” is going to really annoy me, I can tell.

Lets start with the web server. It doesn’t run though Apache without a tremendous amount of futzing around. I like Apache, and run everything else off Apache, so the fact that all my Zope applications will run off a non-standard port (There are fixes for this, yes, but they also require a tremendous amount of futzing around). This is annoying.

Then there is the user system. I have a user account on this machine, you could even talk to it though LDAP. Requiring your own little world to run in – let alone where you don’t tell me the initial username & password, or where the access file is, or anything – is really annoying. Also, it should be noted that in every SINGLE guide I found on how to reset the password manually it missed the fairly basic piece of information that once you have reset the password, you must restart the Zope server otherwise you will spend half an hour working out why it doesn’t take the data. This, admittedly, is partly a Debian Package problem, but since delving has lead me to believe that it used to ask you for a default username and password on configure, and now doesn’t, I’m leaping to the conclusion that whining isn’t going to fix this any.

It should be a default requirement that every Debian package contains a file in /usr/share/docs explaining a) Which configure options were used, b) What you’re going to have to do next to make the package work, and c) Common pitfalls of the above.

Three, the interface. In the last six months or so, the bar for a web-based interface has gone from a minor hurdle to a max-height pole-vault, mostly due to GMail. However, I can state with no fear of derision that <textarea /> is the single most fucking awful method of inputting code since I used a C64 with a broken delete key, and the fact that the physical location of the source files is shielded from me (and will, I suspect, be chowned something silly anyway) means the best way I can see to develop with this pile of shit is to copy/paste from my default text editor, which is just retarded (And yes, that is exactly how I compose blog entries, but I don’t normally need to keep blog entries in CVS). I suspect there is a better way to do this. In fact, I’m sure there must be, or else Zope would be deader than a very dead thing, which brings me to my next point.

The Docs

My first problem with the docs is the inline commenting system. When I’m trying to digest a reasonably complex idea it is of no use whatsoever for the flow of the text to be interrupted constantly by inane slashdotesque comment. On the other hand, without the inline commenting I’d not have known that the introduction to Zope tutorial – which is far better than the one included in the distro – existed, also, I’d have read the chapter on DTML before the chapter on the more advanced, easier to use, designer friendly and new paradigm of Zope Page Templates, which starts off by pointing out how crap everything you read in the previous chapter was. ARGH

Nevertheless, I shall persevere with this Evil, because I’ve got no choice but to know it, in the hope that I will learn my way around it.

Okay, so “find / -iname ZopeZoo” has failed to find any of the files that are part of the tutorial. Where the hell is Zope putting the bloody files? *ARGH*