annotate README.txt @ 66:67dc95a355cc

finish basic restore logic
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 May 2010 14:56:59 -0700
parents fc0dabd2269f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Profile Management with Firefox (and other?)
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 ============================================
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 Desired Functionality
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 ---------------------
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 See https://wiki.mozilla.org/Auto-tools/Projects/ProfileManager and
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 https://bugzilla.mozilla.org/show_bug.cgi?id=539524 :
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 - backing up profile
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 - merging
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 profiles.ini
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 ------------
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 A typical `.mozilla/firefox/profiles.ini` is as follows:
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 {{{
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 [General]
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 StartWithLastProfile=0
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 [Profile0]
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 Name=default
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 IsRelative=1
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 Path=py91jfha.default
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 Default=1
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 [Profile1]
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 Name=Lammy
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 IsRelative=1
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 Path=nr0eq10m.Lammy
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 }}}
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 Notes:
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 - why use identifiers `[Profile0]`, `[Profile1]`, etc instead of the
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 actual names ( `[default]`, `[lammy]` )?
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 - Instead of `Default=1` or `0`, could indicate the version of
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 Firefox for which the profile is the default (e.g. `Default=3.6`)
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46 Architecture
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47 ------------
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49 The architecture should satisfy both user-facing applications
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50 (i.e. the Firefox ProfileManager) as well as be friendly and malleable
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
51 for testing purposes (e.g. a command line application). All front
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52 ends (GUI, command-line, web???, etc) should use the same underlying
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
53 API, which will be front-end agnostic.
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55 API
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
56 ---
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
57
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
58 class ProfileManager(object):
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
59
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
60 def __init__(self, profiles):
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
61 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
62 profiles: profiles.ini file
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
63 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
64
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
65 def clone(self, from, to):
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
66 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
67 clones the profile `from` and output to `to`
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
68 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
69
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
70 def backup(self, profile):
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
71 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
72 backs up the profile named `profile`;
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
73 maybe should be named `snapshot`
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
74 """
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
75
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
76 def merge(self, *profiles):
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
77 """merge a set of profiles (not trivial!)"""
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
78
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
79 Command Line Interface
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
80 ----------------------
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
81
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
82 The command line interface should mirror the API.
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
83
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
84 Options:
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
85 -c CONFIG, --config=CONFIG specify a profiles.ini file
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
86 [default: $HOME/.mozilla/firefox/profiles.ini]
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
87
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
88 Examples:
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
89
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
90 `profile-manager clone lammy foo # clone the lammy profile to foo`
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
91
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
92 `profile-manager backup lammy # make a snapshot of the lammy profile`
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
93
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
94
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
95 Questions
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
96 ---------
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
97
fc0dabd2269f add README
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
98 How to generate the hash key? (e.g. the `py91jfha` in `py91jfha.default`)