Archive for the ‘Pylons’ Category

Filed Under (Mercurial, Pylons, Python) by Marcin Kuźmiński on July-27-2010

It’s been some time, hg-app is still in rapid development.

DEMO: http://hg.python-works.com

TRACKER: http://bitbucket.org/marcinkuzminski/hg-app/issues

Since last time hg-app got:

  • Full permissions per repository system.
  • Yui float graphs
  • New gui
  • Database based settings and hooks
  • Huge number of bugfixes.

Below few screenshots of new hg-app gui.



Filed Under (Mercurial, Pylons) by Marcin Kuźmiński on June-7-2010

After some code fixups, and corrections i manage to set up a working demo of hg app.
This demo, has all functionality of hg app and will be updated during application life to current version.

Demo is available at http://hg.python-works.com

Any feedback is welcomed and can be posted to http://bitbucket.org/marcinkuzminski/hg-app/issues

Thank you !



Filed Under (Mercurial, Pylons, SqlAlchemy, Threads) by Marcin Kuźmiński on June-1-2010

Since, me and Lukasz fine tuned the vcs library i manage to setup a beta version of hg app. I was tired of the boring looks, and poor source code browsing capabilities of the hgwebdir.
So i started to write my own app, at the beginning it was just a simple hgwebdir wrapper, to pylons, now it’s fully standalone replacement. Including abilities to push/pull thrum the application.

Pylons based replacement for hgwebdir. Fully customizable,
with authentication, permissions. Based on vcs library.

  • has it’s own middleware to handle mercurial protocol request each request can
    be logged and authenticated +threaded performance unlikely to hgweb. Middleware recognises a mercurial protocol
    and skips any functionality for pure web request
  • mimics full functionality of hgwebdir including feeds,archives,diffs,raw-diffs,annotations,file history etc.
  • mako templates let’s you customize look and feel of the application.
    Possibly visual merge with your company systems
  • diffs annotations and source code all colored by pygments (see screenshots).
  • admin interface for performing user/permission managements as well as repository
    managements. Out of beta version should have fully customizable permission system, with
    private repos, and repo permissions
  • added cache with invalidation on push/repo managment for high performance and
    always upto date data.
  • rss / atom feeds
  • future support for git (thanks to vcs mercurial/git api should be 1:1
  • based on pylons 1.0 / sqlalchemy 0.6 /sqlite(possibly mysql/postgres thanks to sqlalchemy models)

Below are the beta version screenshots. Now I’m not good at designing webapps, so excuse me if you feel the look&feel to be to simple or bad looking.
It’s all i could come up with. Most of my expiration was taken from hgwebdir/bitbucket and github. I tried to take all best parts from all of them and combine into this app.
It’s still in beta but i think it’s production ready in this stage I’m using it for few weeks, and had no troubles or crashes with it. The code can be grabbed at bitbucket repo http://bitbucket.org/marcinkuzminski/hg-app/



Filed Under (Django, Mercurial, Pylons, Python) by Marcin Kuźmiński on May-2-2010

Since Me and Lukasz started this project a while ago, it’s time to announce that we shipped out first public Beta release.

It’s available on PyPi as “vcs”, so you can install it using PIP or EASY_INSTALL.

Simply run to download and install it.

easy_install vcs
pip install vcs

Lukasz made a nice documentation, and quick starts available here http://packages.python.org/vcs/

The vcs API:

Features

  • Common API for SCM backends (mercurial is the first and only one available right now)
  • Fetching repositories data lazily (performance and easy of use)
  • Simple caching mechanism so we don’t hit repo too often (so a refresh on a 2000 commit repo wont kill  the cpu)

Incoming

  • Django app for mercurial hgserve replacement – this is probably going to be a part of the vcs library
  • Pylons app for mercurial replacement – this is my little project which i finished roughly in 70% of functionality that hgwebdir does.
  • Command line client

Few things are worth mentioning.
The key point of vcs to have the same api for various SCM-s so mercurial,git,subversion(maybe others) will have
a same way for data access,objects structures and so on. Imagine how fast and simple you could extend an web app which uses
mercurial as a SCM to GIT, simply replace the repo path to git and all should work. Of Course there are some differences between git and mercurial
that could be handled in the same maner, and this is also simply handled by a private methods, specific for a SCM.

This is of course an open source project and any contributors are always welcomed.



Filed Under (Django, Pylons, SqlAlchemy) by Marcin Kuźmiński on September-26-2009

Recently i had to create a lot of models using declarative mode with sqlalchemy 0.5.5 It was very time consuming especially for large databases. I started to think about an automated solution.

Sqlalchemy have this auto load feature which fetches info about tables by itself. I wanted to use this somehow to generate a string which can be easily  copy/paste to database model definition script. So i started a little project to write auto  model generator for sql alchemy based on auto load feature in sqlalchemy.

The script  is not perfect but it works and save a huge amount of time just codding the models. In fact is was able to setup a 186 table database model in 15minutes with this script.

Well the script helped me a lot and now on when i have to load some new existing database or changes i use it all the time.

The documentation is inside the script i tried to write it so anybody could use it out of the box.

I tested it on 4 schema 200+ tables database and i worked quite good. This script still have to be polished but current functionality is enough for most users.

My script is going to be also a part of django-alchemy project started by my friend Lukasz Balcerzak. You can visit the project site @ http://code.google.com/p/django-alchemy/

I used it with Pylons application and Django with modded sqlalchemy. but it can be basically used in any app which uses sqlalchemy. I did not test it with mysql though,but it should work, just specify mysql as dialect.

You can download this script from sqlalchemy model generator



Filed Under (Pylons) by Marcin Kuźmiński on July-30-2009

In python a nice function divmod does the trick.

For example:

def sec2min(sec):
    return divmod(sec,60)

now sec2min(181) outputs (3,1) 3minutes and 1 seconds ,you can obtain hours,days etc using divmod :)



Filed Under (Nginx, Pylons, Python) by Marcin Kuźmiński on June-19-2009

Hi welcome to python blog !

We are up and running. Some technical information about our site:

  • Nginx 0.7.59
  • SliceHost 256MB slice
  • PHP 5.2.9 patched with php-fpm
  • Debian 5.0 + grsec & selinux
  • Python 2.6.2

Soon I’ll post the setups i made for this site as well as some useful links for custom building php with php-fm .

Regards Marcin Kuzminski site Administrator