.gitignore for Python developers

If you are using Git for version control for your Python egg and buildout development below are is a sample which you might want to put into your .gitignore file.

*.mo
*.egg-info
*.egg
*.EGG
*.EGG-INFO
bin
build
develop-eggs
downloads
eggs
fake-eggs
parts
dist
.installed.cfg
.mr.developer.cfg
.hg
.bzr
.svn
*.pyc
*.pyo
*.tmp*

Suggestions for new ignores are welcome.

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Zoho integration for Python and Plone CMS

Zoho is a web application provider competing with Google Docs, Microsoft Office and Live.

Zoho provides a very wide set of browser based applications from text editing and spreadsheets to project management and customer relationship management (highlighted items should ring a bell for small software development companies). Especially the last one, CRM, is a very attractive deal as you get a hosted complex CRM application with API services for very affordable or free price. Small organizations are not necessarily rich enough to go for Salesforce API supported edition which would be 135 € / month / user.

mFabrik has been working on Zoho Python bindings as we use Zoho internally.

Zoho API is HTTP GET/POST based.

  • Authentication, which is called a ticket in Zoho language, is HTTP POST with custom plain-text responses. The same authentication mechanism works in-browser (Javascript) and for machine-to-machine communication as far as I know
  • Most functions can be performed as HTTP POST or GET. If you need to input compex data (like CRM leads), you’ll do it as HTTP POST of custom XML payload
  • Some functions expose the output as JSON for HTTP GET, so that it can be directly consumed inside browser Javascript

mfabrik.zoho is a GPL’ed Python library which provides basic facilities for Zoho API calls. Currently the feature set is very CRM weighted, though it can be easily expanded for other Zoho applications.

mfabrik.plonezohointegration is a Plone CMS add-on product which marry Plone and Zoho together. The add-on provides a control panel where you can enter Zoho API key details for Plone. Forms for CRM lead generation are provided as standalone and as a portlet (you can see them in action on our web and blog site).

The source is hosted on Github, so you can easily start tailoring it for your own organization needs. I happily accept all merge requests, providing that unit tests for new features are included. If you do not feel comfortable with Python programming, but still want to integrate Zoho to your systems, please contact us for further help.

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Debugging Skype crash problems on Ubuntu 10.04 Lucid Lynx Linux

Symptoms: Your Skype crashes on incoming chat message or if you try to open a contact info / chat message – usually this leads to a crash on Skype start-up because there are always incoming chat messages in a queue.

Skype is not really helpful regarding how to get meaningful log information from the client, but it is possible.

Create a log directory

mkdir ~/.Skype/Logs

Run Skype from the command line and open a chat window so that it crashes

moo@murskaamo:~$ skype
Aborted

Now there should be log data available

moo@murskaamo:~$ ls -lh ~/.Skype/Logs/
total 724K
-rw-r--r-- 1 moo moo 607K 2010-07-16 11:10 skype_20100716-1110.log
-rw-r--r-- 1 moo moo 116K 2010-07-16 11:10 skype_20100716-1110.trace.txt

However, those log files are little useful for anybody except Skype developers as they are encrypted. Your only hope is to submit them to  a Skype bug tracker and hope that someone answers you something meaningful. The guidelines how to create a bug report and how they are processed is little unclear – there doesn’t seem to be clear announcement from Skype whether they process  these reports or not.

The crashes probably are due to incompatible system library versions / bugs in them. Try downloading static Skype versions which does not use system libraries.

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Easily install all Python versions under Linux and OSX using collective.buildout.python

Note: This information is old. Please head to Github collective/buildout.python for recent information.

Here are short instructions how to install all versions (2.4, 2.5, 2.6, 2.7 and 3.1) of Python interpreters on UNIX system. The instructions were tested on Ubuntu 10.04 Lucid Lynx Linux but should work on other systems as is. The installation is based of downloading, compiling and installing different Pythons and their libraries using buildout tool. A buildout configuration for doing this is maintained by a Plone community.

This buildout is especially useful to get Python 2.4 properly running under the latest Ubuntu 10.04 Lucid Lynx. This is because Ubuntu repositories won’t ship with Python 2.4 packages anymore.

The installation will also include static compilation of some very popular libraries. These are dependencies for other Python packages including, but not limited, to

  • libjpeg
  • Python imaging library
  • readline

1. Prerequisites

  • Some Python version is installed (OS default)
  • GCC compiler is installed (sudo apt-get install build-essential)
  • Subversion tool is installed (sudo apt-get install subversion)

2. Running it

svn co http://svn.plone.org/svn/collective/buildout/python/
cd python
python bootstrap.py
bin/buildout

3. Using it

All Pythons are under virtualenv installations. This means that you can activate one Python configuration for your shell once easily (python command will run under different Python versions).

Activating Python 2.4

source python/python-2.4/bin/activate
(python-2.4)moo@murskaamo:~/code$ python -V
Python 2.4.6

Check that Python Imaging Library works

python
Python 2.4.6 (#1, Jul 16 2010, 10:31:46)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL

(No exceptions raised, Python Imaging Library works well).

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+