What does Build: xx means at urevs.com?

July 27th, 2010

As it is still in development, I’ve decided to show progress I’m making during the development.

Build [number] is simply revision control system commit number.

I use Mercurial control system. I do it for few simple reasons:

  • it is intuitive and very simple to use
  • it is distributed revision control system
  • Mercurial respects repository nesting
  • nice integration with Nautilus as TortoiseHG (my howto in Polish)
  • it is written in Python. Yay! :)

What number is it?

nme@charr urevs $ hg log -l 1
changeset:   46:07595fb8f9b9
tag:         tip
user:        Marcin Woloszyn <mw@nme.pl>
date:        Mon Jul 19 20:32:45 2010 +0200
summary:     switched to english, included google analytics code, turned robots.txt on

Naturally, I do not retype it manually everytime it changes.

It is an automated task – Makefile checks if revision has changed, and if it did – new version.py is generated by tools/hg_version helper script:

#!/bin/bash
rm version.py >/dev/null 2>&1 || true
cat >version.py <<EOF
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT.

VERSION="`hg log -l 1 | head -n 1 | awk '{print substr($2,0,index($2,":"))}'`"
EOF

Works like a charm :)

OpenID shortcuts

July 25th, 2010

Like I’ve decided before – OpenID authentication could be extended a bit, letting users to use shortcut to their OpenID provider. Go ahead – try it.

It works both serverside and clientside. It means that user might visit /auth/openid/blogger and gets dropped to blogspot.com authentication. If clients browser support JavaScript, URLs will be replaced in the following manner: /auth/openid/#blogger. History should work (excluding IE6).

Improvements, planning and my other deadline

July 21st, 2010

Today I came back from my two and a half week holiday break from my full time job :) Weather was great, biking was awesome… and during late nights I’ve managed to make 27 commits to code :) I can’t clarify how many lines of code was it, because I used some third party code inside (which I’ll describe in details when I get to talking about OpenID provider/consumer or my Facebook API experience :) ).

During travel back home and after – when I was cleaning up my apartment I was thinking about improvements to current project state. Now I know that one of them should be letting Blogger, WordPress and some major OpenID provider users, to simplify their logging in. I’ve watched other OpenID consumer solutions. One of them was Your-Move hosted at Google App Engine . I think it will be simple to implement simultanously – server (dynamic pages) and clientside (JavaScript).

Other thing I plan is to do some backend speed improvements using my memcached library I was talking about previously.

I also got small problem with concept of site layout design. I don’t really know if I’d like to spend time on it right now. All html document layout is quite easy to modify and will be still later on. So I think I will wait with it. Who knows – maybe I’ll find some professional design artist till then :)

I was thinking about getting the project more directed to its designated purpose. I even got some code I plan to reuse (with few modifications, because it was developed with Google’s App Engine in mind).

Everything should clear up in my mind during next few days. There is still one timer inside my mind ticking, telling me I should get back to another project I’m working on, because of my planned deadline. If I will, this project progress will get slower a bit, but I’ll get back to it for sure.

JavaScript builder

July 20th, 2010

I have started to develop this part of code more than a year ago. Before I’ll start to describe what it does, I will tell few things about me:

  • I’m Linux user – I develop under Linux ONLY,
  • I’m familiar with Makefiles, scripting etc.
  • I have worked with awesome Google App Engine framework (Python flavour, of course),
  • I have watched many JavaScript library code repositories,
  • My favourite language is Python.

Just because of mentioned things I’ve decided to make my JavaScript bootstrap that can offer me what I really need, and those things are:

  • Single page of my app needs only two .js files:
    • internally used external libraries (JQuery+plugins, JQueryUI etc.)
    • my script
  • I need to be able to use include('path/file.js'); in my JavaScript code
  • “On the fly” generation of JavaScript files based on Python files
  • Automatic indention (Python maniac requirement :P )
  • Ability to conditionally minify generated JavaScript file
  • Ability to include Copyright notice at the beginning of generated file
  • Being able to use JSLint for choosen files
  • Possibility to use Google Closure Compiler or YUI Compressor as minifiers
  • Ability to clean build files on demand
  • Clear and simple configuration
  • make command interface

For those purposes I’ve created Makefiles and .py scripts which parse .js and include required .js files with indention, minifies them (if required), prepends with copyright (if required) and places at designated place :)

For configuration I use yaml which I started to like as GAE developer. Enough to talk – I’ll just show You my JavaScript bootstrap simple configuration file (from other project I used it in):

debug: cat ../settings.py | egrep "^DEBUG\ =" | grep -i true >/dev/null && echo True || echo False
dst_dir: ../interface
jsmin: closure

build:

- dst: jqui.js
  cmd: python -c 'import sys;sys.path[:0]=["../maintenance/"];from enum import jqui;jqui()'
  src: ../maintenance/enum.py

- dst: incl.js
  src: include.js

- dst: auth.js

- dst: engine.js
  copyright: Copyright
  lint: 1

Cute? :) Cute! :P

Social Bootstrap Engine for Django

July 19th, 2010

In current Django project I already have managed to get few things working:

  • Signing up as local user with customized reCAPTCHA
  • Build in OpenID provider: locally created account has its own two OpenID identifiers
  • Logging in as local or external user to own profile
  • Signing in as one of the following, external service providers:
  • Locally created users have named profiles, external have numerical only: user cannot create account with username starting with something else than a letter
  • Site is being developed using my own, simple and very lightweight locale library and is currently available in English and Polish languages (switching language per session is currently disabled).
  • Optional SSL support (turned on).

You can test those features at current urevs.com site (do not relay too much on account You will create – I will erase current database during further development).

Furthermore, code contains a lot of backend extensions:

  • Lightweight locale support
  • Customizable templates with nesting
  • Low-level memcache library – code has been released (description in Polish)
  • JavaScript builder
  • CSS builder
  • Cron Django standalone scripts
  • Middleware to support .urevs.com subdomains (user profiles)
  • Simple yet powerful configuration
  • html5 (downgradable to xhtml1)

I will describe some of listed above more closely in future posts to let You see what they are capable of :)

Till then! ;)

First post

July 18th, 2010

Urevs.com is a site I’ve started to develop about one month ago. It is still under development and it will still be growing – like a baby ;)

Project is being written in Python / Django Framework.

This blog will be place where I plan to describe development progess. Some notes will be short, some will be long. I cannot promise high frequency of new entries, because this project is being developed during my free time.