some preparation to run as package

Are you sure that this works? __file__ in this case is expected to be 'osc' or 'osccmdln' or something like that. In my case the result is  '/usr/lib/python2.7/site-packages/osc'
This is because the way that osc load the plugins.