Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am planning to package FBuntu into PPA for easier distribution.

The nature of this app is that the user has to make specific edits to the file to make it work and hence I am stuck from proceeding any further.

A default first couple of lines of looks like this:

import facebook

class facebookAuthentication:
    def __init__(self):
        url = "https://..."

The user after branching FBuntu from the bazaar, has to manually edit the url with the one you get after authenticating with Facebook. I have no idea on how to make an app be edited after a deb package has been generated.

Any guidance on how to proceed with packaging this would be welcome.

share|improve this question
+1 ... for those not familiar with fbuntu (me!) can you give examples of what you need to edit in It sounds like should be reading from config files not hard-coding stuff. – fossfreedom May 26 '12 at 8:46
@fossfreedom well yes, I want it to read things from a config file instead of being hard coded because it is a very user specific url. – jokerdino May 26 '12 at 8:53
Just a note, I'm working on a full-on packaging tutorial to address this – RobotHumans May 26 '12 at 10:01
As the guy who wrote FBuntu, I'm well aware it isn't very user friendly, and would love to make it distributable via a PPA. I think I ought to take on some advice from the answers to this question! – 8128 May 28 '12 at 14:46
@fluteflute uh, didn't expect you to read this question. I thought I would finish the work and then contact you.. – jokerdino May 28 '12 at 14:58
up vote 3 down vote accepted

I'm not sure what this question has to do with packaging. Users shouldn't have to be editing the python files directly, and of course would need to be root to do so to installed one. What you really want is a proper conf file installed to the users home directory. Something like:

import os
import ConfigParser

    import xdg.BaseDirectory
except ImportError:
    home = os.environ.get('HOME')
    xdg_config_home = os.path.join(home, '.config/')
    xdg_config_home = xdg.BaseDirectory.xdg_config_home

confDir =  os.path.join(xdg_config_home, 'myApp')
confFile =  os.path.join(confDir, 'conf.ini')

config = ConfigParser.ConfigParser()

if os.path.isfile(confFile):
    print "The URL is " + config.get('Section', 'url')
    print "URL not set. Please edit " + confFile
    if not os.path.exists(confDir):
    config.set('Section', 'url', ' ')
    with open(confFile, 'wb') as confFile:

Of course, if this is a GUI app this is still a bit much for the user. You might want to implement a preferences window.

share|improve this answer
I almost forgot about this question. Thanks for your guidance. :) – jokerdino Jun 15 '12 at 12:07

Because of your "very specific url" comment I gather using gwibber is not an option.

I maintain a couple year old python application originally put together with Quickly. Even if you don't want to use Quickly to put together your app, Quickly uses a modified file to modify a very small Python module. As the app. is built is called from the make sequence (usual) and a modification to changes one small but important detail regarding whether the program has been installed or whether it is being tested. I suppose you could use the same approach to change a different kind of detail.

Still, leaving an application generalized and having it read a config (preference) file would be the standard way to customize a program's operation, if at all possible. So if you can use andrewsomething's suggetion I think that would be better.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.