view README.txt @ 29:105ecbac0928

fix some test failures
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 May 2010 16:51:21 -0700
parents fc0dabd2269f
children
line wrap: on
line source

Profile Management with Firefox (and other?)
============================================


Desired Functionality
---------------------

See https://wiki.mozilla.org/Auto-tools/Projects/ProfileManager and
https://bugzilla.mozilla.org/show_bug.cgi?id=539524 :

 - backing up profile

 - merging


profiles.ini
------------

A typical `.mozilla/firefox/profiles.ini` is as follows:

{{{
[General]
StartWithLastProfile=0

[Profile0]
Name=default
IsRelative=1
Path=py91jfha.default
Default=1

[Profile1]
Name=Lammy
IsRelative=1
Path=nr0eq10m.Lammy
}}}

Notes:

 - why use identifiers `[Profile0]`, `[Profile1]`, etc instead of the
   actual names ( `[default]`, `[lammy]` )?

 - Instead of `Default=1` or `0`, could indicate the version of
   Firefox for which the profile is the default (e.g. `Default=3.6`)


Architecture
------------

The architecture should satisfy both user-facing applications
(i.e. the Firefox ProfileManager) as well as be friendly and malleable
for testing purposes (e.g. a command line application).  All front
ends (GUI, command-line, web???, etc) should use the same underlying
API, which will be front-end agnostic.

API
---

class ProfileManager(object):

    def __init__(self, profiles):
        """
        profiles: profiles.ini file
        """

    def clone(self, from, to):
        """
        clones the profile `from` and output to `to`
        """

    def backup(self, profile):
        """
        backs up the profile named `profile`;
        maybe should be named `snapshot`
        """

    def merge(self, *profiles):
        """merge a set of profiles (not trivial!)"""

Command Line Interface
----------------------

The command line interface should mirror the API.

Options:
 -c CONFIG, --config=CONFIG    specify a profiles.ini file 
            [default: $HOME/.mozilla/firefox/profiles.ini]

Examples:

 `profile-manager clone lammy foo  # clone the lammy profile to foo`

 `profile-manager backup lammy # make a snapshot of the lammy profile`


Questions
---------

How to generate the hash key? (e.g. the `py91jfha` in `py91jfha.default`)