Tao of the Machine

Programming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.

ItemList

A forthcoming Firedrop content type will be ItemList. This can be used to make pages that contain, well, a list of items, like a FAQ. I intend to use it for a section with notes on various topics.

A new Firedrop release, containing this new type, will hopefully be available soon.

Posted by Hans Nowak on 2004-02-12 23:13:56   {link} (see old comments)
Categories: Firedrop

...and integrating everything

This is a different issue altogether (see previous post), but: would it be a good idea to integrate Sextile and the macro system?

Sextile by itself is kind of incomplete... for example, it has no way to express URLs. Nor does it have special syntax for things like acronyms, paragraphs in certain styles, etc. For this, we use macros.

The macro system does not really depend on Sextile... the macros (should) work just as well in other formats, including Textile, pure HTML, and any other format (as long as the macro syntax doesn't collide with the format's).

Maybe the macro system should be a separate package (call it FooMacros for now, for lack of a better title). Then:

  • Sextile uses FooMacros (and probably has the FooMacros files included in its distro), and possibly comes with its own collection of useful macros (for URLs, acronyms, tables, etc)
  • Firedrop uses Sextile (which includes FooMacros)
  • Firedrop also uses FooMacros "separately"

Hm. Doesn't seem like a great solution, but it's doable.

Posted by Hans Nowak on 2004-02-08 22:38:17   {link} (see old comments)
Categories: Firedrop

Improving Sextile and Firedrop macros

Warning: incoherent rambling ahead...

Firedrop is becoming more and more user-friendly. It grew a few simple but necessary features, like dialog boxes for confirmation, creating a "site", editing a post's categories, etc. It still lacks solid documentation, but that is getting better as well.

Now that that is out of the way, I have to take a critical look at Firedrop's macro system, and Sextile. Started out as a lightweight, minimalistic alternative (some would say a "parody" :-) to Textile, Sextile is useful and relatively clean, but it has some serious limitations. For example, this MT-Textile page is full of things Sextile cannot do.

That is where macros come in. Most of the items on the MT-Textile page mentioned can be done by adding the appropriate macro. #1 and #2, for example. #3 already exists. Most of the others can be implemented with macros as well.

Alas, macros have their limitations too. One of the most glaring problems is that you cannot use a semicolon other than to limit arguments. You see, a macro like {foo;42;hello} really translates to a Python function call foo(42, "hello"). The semicolon is used as a separator, and currently there's no way to get around that, which is especially annoying if you want to use entities like & inside a macro.

Quoting it might be a solution; writing \; is not pretty, but it might do the trick. However, the current order of evaluation is:

  • Textile/Sextile -> HTML
  • expand embedded code
  • expand macros

so in order to make this work, Sextile must ignore the \; for the macros to see it (it doesn't, currently).

Another problem is that macros cannot be nested. This is mostly due to the simplistic "parser", which just looks for the next }. Something like {foo;{bar;42}} might make sense in some situations, but it's allowed.

Sometimes it's useful to span a whole block of text with a macro. For example, for syntax highlighting, or to create a table structure. I don't really think that nested macros are adequate for this. On the other hand, I don't want to make Sextile too convoluted, since that defies its purpose. If you have to learn lots of special syntax, then you might as well write straight HTML or XML.

Eventually, I want the Firedrop & Sextile combo to be good enough to write documentation in it, or even a book. To do so, it must be capable of producing more sophisticated output than it does now. HTML tables, paragraphs using certain styles, etc. I wonder if I should try to "fix" macros and the Sextile format for this purpose, or look at something else entirely. For example, the Documentation content type could accept DocBook XML; it could generate a valid XML document simply by glueing the entries together, and generate HTML pages for online viewing. It's not really easier to type, though.

Originally, when Firedrop was still on the drawing board, it was going to have its own flavor of HTML tags, called FHTML. With it, you could write things like

Some <f-upper>Python</f-upper> code here:
<f-colorize>
x = f(42) + 1
</f-colorize>

Eventually, I rejected the idea, because a markup language isn't really supposed to replace or transform text, and because there would be too many levels of text manipulation (several types of macros, FHTML, text formats...). However, custom tags would certainly be useful.

Maybe macros can be expanded to do something similar? E.g.

Some {+upper}Python{-upper} code here:
{+colorize;python}
x = f(42) + 1
{-colorize}

or:

{+table;2;4}
{+row;1;1}Text in cell (1,1){-row}
{+row;1;2}Text in cell (1,2){-row}
{-table}

(table will be a Python object, but how it will be implemented, is yet to be seen... function, class?)

Heavy use of this doesn't make text any prettier, but it would be very powerful, and has lots of interesting possibilities.

Posted by Hans Nowak on 2004-02-08 21:46:12   {link} (see old comments)
Categories: Firedrop

Firedrop supports Atom 0.3

...so this weblog now has an Atom feed as well. See the sidebar. It actually validates... for now. emoticon:smile

[updated Firedrop build notes]

Posted by Hans Nowak on 2004-02-04 20:18:10   {link} (see old comments)
Categories: Firedrop

Updates...

Progress on the card game can be found here. I worked out mechanisms for playing creatures, and battle. (Much like Magi-Nation, aside, but not exactly the same.)

In other news, I'm currently working on making Firedrop more user-friendly. If nothing else, there should be an easy and straightforward way to create a site/weblog. Until recently, this wasn't a problem because I was the only person using it. :-)

I haven't had really interesting content lately, from a Pythonic point of view. This is mostly because work has been picking up (note: this is an anti-complaint emoticon:smile). I've been busy, and I haven't had much time to dream up interesting blog posts or articles. Then again, I never said this was a Python-only weblog, and this was a good opportunity to write about other stuff, like card games and things I'm researching (like Groovy).

Groovy 1.0-beta-3 is out, by the way, I'm going to test it one of these days.

Posted by Hans Nowak on 2004-01-23 23:27:07   {link} (see old comments)
Categories: CCGs, Firedrop

New Firedrop release

In the meantime, I am still working on Firedrop. See the release notes. This is an experimental version that uses a new StatusDialog control, which may be wrapped into Wax sooner or later.

Firedrop is still not very newbie-friendly, that is one of the most important things I need to work on next. Even a simple pseudo-wizard to generate default build.ini/build.py files, and templates, would be a major improvement.

Posted by Hans Nowak on 2004-01-19 23:49:32   {link} (see old comments)
Categories: Firedrop

New Firedrop macro: mkchar

Test test...

Die Ärzte, Curaçao, hasta mañana, meeëter, Português, København, Linköping, ½ + ¼ = ¾, Århus, © 2003, à la mode; fünfzehn, fleißig, ...

Special characters in HTML are nothing special. :-) However, I added a module to Firedrop that converts simple text to these HTML characters. For example, A: translates to Ä, C, to Ç, e' to é, etc. (Or rather, makechar("A:") translates to "&Auml;", etc.) This is inspired by vim, which has a similar feature; you can type, for example, A, backspace, and ' (apostrophe), and the resulting character will be Á. (Assuming your font supports it, of course.)

The makechars.py module (which allows for this mkchar macro) will be available in the next release of Firedrop.

Posted by Hans Nowak on 2003-10-15 21:21:16   {link}
Categories: Firedrop

Things and stuff...

I uploaded some thingies to the download area... this includes development versions of Charm and Firedrop. These programs have been usable for months, but the problem was (and still is) that there wasn't sufficient documentation. Maybe I can get around to writing some, one of these days.

I also uploaded the latest version of Wax, 0.1.32. Like I said before, there's also a wiki now, currently with a bare minimum of information.

Nobody Not many people seem to like the "Self-style" objects. :-) I am currently pondering some use cases for this. One area where they could be useful is adventures/interactive fiction. Long ago I found that traditional classes are not a really good match for laying out an adventure's rooms, characters and objects... maybe Self-style objects will fare better.

The nice thing is that you can "isolate" certain behavior (methods and attributes) in an object, and then grant any other object access to this behavior by making the original object its parent. Objects don't have introspection, cloning facilities, etc, but you can add them at will whenever necessary. This allows for an entirely different design than traditional classes.

Posted by Hans Nowak on 2003-09-25 23:33:50   {link}
Categories: Charm, Wax, Firedrop, Python

Observations

  • Alltel really sucks. I wrote about this before: whenever the power goes off, so does DSL, and it doesn't come back on. It went off yesterday, and I still don't have my DSL back (so I'm using Earthlink, dialup, right now.) I am considering cancelling it... what's the point of having DSL for work if it's this unreliable? I now have to pay $50 for DSL and $22 for dialup, as a backup for when DSL doesn't work. emoticon:frown

  • I really need more memory. Or a new computer, if I could afford it (answer: no). 900 MHz, 128 Mb internal isn't exactly state of the art. OK, so it isn't extremely bad either, but try running Delphi 7, Phoenix, Python, SQL Server 2000, Yahoo Messenger, WinCVS and Pegasus Mail all simultaneously. Yah, I suppose I could close some of those apps whenever I don't need them anymore, and start them again later. Not very efficient though. *frown*

  • Maybe it's time to release Firedrop. I'll see if I have time to write some documentation, so people can start using it. It's not a great, polished user-friendly product yet, and maybe never will be... but it works. :-)

  • It's a small world. One of the people on the Python bloggers list is from around here too. Can you guess who it is? :-) I would expect this if I lived in New York or so, but not in ole 'Lachuay with its 6000 inhabitants.

Posted by Hans Nowak on 2003-08-05 12:49:36   {link}
Categories: general, programming, Python, Firedrop

Observations

1. This seems like an interesting book. Comes with cards (I hope)...

2. Textile is causing more problems than it's worth. I am considering writing my own format, probably very minimal(istic), and then use macros for additional power. Reinventing one wheel, or two, three, what's the difference? emoticon:smile (I will keep Textile in Kaa and Firedrop2, after all, it's already there, but it's up to the user to work around all its little idiosyncracies.)

3. Firedrop2: I fixed the problem with macros that showed up unexpanded in RSS. A bleeding-edge version should be available soon.

4. Googling for 'python nederland' yields a bunch of crap. There's an opportunity here for Dutch Pythonistas...

Update (2003.07.10): Hum, now *I* am the number one hit for 'python nederland'. That wasn't so difficult. I wonder if it's possible/viable/useful to make a page with Dutch Python resources?

Posted by Hans Nowak on 2003-06-18 21:13:03   {link}
Categories: books, Firedrop

Deja vu

Firedrop2 now supports macros. One of these days there will also be a development version available for download, but I want to write some (minimal) documentation first.

The macro system is not all-powerful (there’s embedded code for that), but nifty and easy to use. emoticon:coool (It powers these smileys, for example.) I am wondering if syntax like {URL;http://something.com;description} can be used as some kind of alternate markup… or maybe it could complement it.

More about this later.

Posted by Hans Nowak on 2003-06-14 19:51:47   {link}
Categories: Firedrop

Bugs

Oops, I just discovered a bug in how Firedrop2 handles permalinks. Let’s see if this fixes it…

Posted by Hans "imagine that" Nowak on 2003-06-03 01:12:32   {link}
Categories: Firedrop

Links

After some more tinkering with the Firedrop2 code, it is now ready for some more web publishing. I am putting (parts of) my link collection online, mostly so I can reach important URLs from anywhere, rather than having to search through bookmarks scattered over 5 browsers. But others might find some of the links interesting as well.

This is very much a work in progress. The collection will grow over time.

Update. My resume is online as well.

Posted by Hans Nowak on 2003-05-28 02:14:57   {link}
Categories: Firedrop

Test test...

Testing 1, 2... let's see if this works in Firedrop2...

Posted by Hans Nowak on 2003-05-22 11:25:00   {link}
Categories: Firedrop

Progress...

Firedrop2 is coming along nicely as well. Maybe tomorrow I will be blogging in it, rather than in Kaa.

Firedrop “1” and “2” have very different philosophies. Or rather, the first version didn’t really have a clear goal; it promised lots of power and flexibility, yet also tried to be very user-friendly. It’s not easy to blend the two.

Firedrop2 is different. It is minimalistic, but not in a “let’s provide only a few core functions” kind of way. Rather, it sets up a basic frame for weblogging (and HTML publishing in general), and encourages people (programmers) to customize things by writing their own code. So, it’s not for end users anymore. It’s for programmers who like to customize their sites but do not want to reinvent the (whole) wheel. Firedrop2 provides a simple editor, and library functions to be used for (e.g.) archiving, generating HTML, embedded Python, macros (maybe), uploading, RSS, etc.

It tries to make as few presumptions as possible. Where Firedrop1 used a number of predefined attributes (active, visible, categories, text format, etc), Firedrop2 only uses insert_date and modified_date, and leaves the rest to the user. If you want to add categories, active/inactive entries, invisible entries, special tags, or cream and sugar, go ahead. The system will not stop you, and you will have to write your own code to support it (which is easier than it sounds).

I want to create a version that works (to a certain extent), start using it, and then grow it to become more sophisticated. Where Firedrop took a long time to do anything useful, Firedrop2 may replace Kaa in a few days after its first prototype. (keeps fingers crossed)

Posted by Hans Nowak on 2003-05-22 01:12:14   {link}
Categories: Firedrop

Put it on Wax... *

Wax is coming along nicely. I whipped up a rudimentary GUI for Firedrop2 in 5 minutes. Here’s what the code looks like:

from wax import *

FONT_COURIER = Font(“Courier New”, 10)

class MainFrame(Frame):

def Body(self):
self.SetTitle(“Firedrop2 GUI”)

self.splitter = Splitter(self)
self.listbox = ListBox(self.splitter, [])
self.notebook = NoteBook(self.splitter)
self.splitter.Split(self.listbox, self.notebook,
direction=‘vertical’)

self.editor = TextBox(self.notebook, multiline=1)
self.editor.SetFont(FONT_COURIER)
self.notebook.AddPage(self.editor, “Editor”)
self.output = TextBox(self.notebook, multiline=1,
readonly=1)
self.output.SetFont(FONT_COURIER)
self.notebook.AddPage(self.output, “Output”)

self.statusbar = StatusBar(self, numpanels=3)
self.SetStatusBar(self.statusbar)

app = Application(MainFrame)
app.MainLoop()


(This creates a window with a splitter; a listbox on the left, a notebook on the right; the notebook has two pages, both with editors.)

The Wax controls are far from complete yet (for example, they don’t have any events at the moment), but they are already usable. And easy to use! Maybe I’m on to something here. It sure feels easy after spending some hours in .NET hell. ;-)

Posted by Hans Nowak on 2003-05-20 22:13:41   {link}
Categories: Python, Firedrop, Wax

Firedrop2 ideas

Firedrop2 will be much more open than the first version (which is unreleased, in case you haven’t been following this). It will not attempt to control everything or to stop “users” from doing stupid or smart things.

Simplicity counts, so here’s the current plan:

  • You have a directory with entries. Entries are in a special (but not complex) format. These files have the extension .fd2, so you can put other files in the directory without them being mistaken for entries. (Actually, you can put files anywhere, but it’s probably cleaner to keep everything in one directory.)
  • A script called build.py in that directory takes the entries and generates output files. You can customize the script to make it do whatever you want. There will be some kind of API to help you, but the possibilities won’t be canned, like in the first Firedrop.
  • A configuration file (or maybe multiple) in the directory contains info about FTP server, publishing, etc.
  • Firedrop2 is a library: there will be a number of modules for certain purposes, e.g. weblog stuff, RSS, uploading, etc. (I think many of these will be borrowed from the original project.)
  • Firedrop2 is also a GUI: a simple user interface (probably using Wax) should let you edit entries, run the build script, do a preview, etc.
  • It will not be for everyone. If you like to hack Python and customize some code to make your weblog (or site) do what you want, then Firedrop2 should be for you. If you like as little effort as possible, you should probably look for a different tool.
  • I’m not going to be anal about categories, attributes, etc. If you want to mess up, you can. The program will not stop you.

Let’s see if I can get this running soon. Shouldn’t take more than a day or so… I’ll probably need to do a little more on Wax though, before it can be used. Watch this space…

Posted by Hans Nowak on 2003-05-19 23:43:13   {link}
Categories: Firedrop

*scratch*

And now for an update on my projects… Firedrop is kind of stalled. Like a beached whale, it won’t move in any way, and even if it was in the water, it would still be a big ass boondoggle. (OK, my talent for metaphor isn’t always up to snuff…)

Something went wrong along the way. It started out simple, but quickly grew in ways I didn’t really want it to.

Maybe I should rethink my goals, and restart from scratch. What if we keep it extremely simple? Sort of like Blosxom… posts are just files. I can still do the attribute thing. I can also provide a primitive GUI, because we need some convenience when editing… I won’t go as far as requiring people to use a text editor (although they are of course free to do so if they want to). There would still be embedded code. Simple Textile support (like Kaa 0.9 has it), as well.

Kaa is far, far from perfect, yet there are some things that it does better than Firedrop. I especially like how you can tell it that a post uses Textile, for example… just use a single ’#’ on the first line. In Firedrop, there are attributes that can be used for this, in several places. Not as easy. The new Firedrop should Keep It Simple as well.

Since this will be a tool for Python programmers, maybe a simple API would be best. User/programmer wants something more than the system offers out of the box? It should be easy to write your own code that manipulates the entries.

Hmm. We’ll see. Even now I have the feeling that the new ideas are still not simple enough. Enter minimalist mode…

Posted by Hans Nowak on 2003-05-16 23:52:29   {link}
Categories: Firedrop, ideas

PyTextile

Mark Pilgrim: PyTextile. (Also see here.) I have been looking for a way to let people (optionally) write nodes in something other than HTML; this may just be what I need.

Posted by Hans Nowak on 2003-03-19 08:55:49   {link}
Categories: Python, Firedrop

How could it be otherwise?

People have been asking about the status of Firedrop. When will it be ready? One answer can be found in the Tao of Programming:
A manager asked a programmer how long it would take him to finish the program on which he was working. "It will be finished tomorrow," the programmer promptly replied.

"I think you are being unrealistic," said the manager, "Truthfully, how long will it take?"

The programmer thought for a moment. "I have some features that I wish to add. This will take at least two weeks," he finally said.

"Even that is too much to expect," insisted the manager, "I will be satisfied if you simply tell me when the program is complete."

The programmer agreed to this.

Several years later, the manager retired. On the way to his retirement luncheon, he discovered the programmer asleep at his terminal. He had been programming all night.

Truth is, at this point I don't know when it will be ready for us. I've been making some important progress lately... the Weblog part is almost usable, and I'm considering to switch to Firedrop, rather than using Kaa for my blog. (Converting your blog from Kaa to Firedrop isn't too painful... there's a script that does most of the work. When it's time, I will put a section on my page explaining how it works. You will have to edit your templates and embedded code in entries by hand, though.)

The Weblog part (or "content type", to add more market speak to the mix) currently lacks category archives (and user-friendly category editors for that matter, but that is not restricted to Weblog) and RSS. The (node) editor is usable, but will benefit from some editor helpers, like Kaa has the 'bold', 'italic' etc. buttons, and the 'Edit' menu option. Uploading works but isn't "smart" yet. And, I'm nowhere near releasing a Mac version using Swing... currently it's all wxPython.

Add user-friendly dialogs, better error checking, better database performance, new content types (FAQ, LinkCollection, StartPage, probably others), a decent macro/regex system, FHTML, ... and you'll understand why it might take a while before Firedrop is ready for prime time.

In spite of that, I might release a development version, so people can see what's it all about, and give (hopefully constructive) criticism. Just don't start creating a site with it yet. (This time I mean it! :-)

Posted by Hans Nowak on 2003-03-17 22:55:07   {link}
Categories: Firedrop

--
Generated by Firedrop2.