2 # -*- coding: utf-8 -*-
4 # ------------------------------------------------------------
5 # new_firefox_profile_id
7 # pick the next firefox profile id
9 # Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
11 # Copyright (C) 2013 AIT Austrian Institute of Technology
12 # AIT Austrian Institute of Technology GmbH
13 # Donau-City-Strasse 1 | 1220 Vienna | Austria
14 # http://www.ait.ac.at
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License
18 # as published by the Free Software Foundation version 2.
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
28 # Boston, MA 02110-1301, USA.
29 # ------------------------------------------------------------
32 # ------------------------------------------------------------
37 import ConfigParser # in pythjon 3 this is lowercase
40 # ------------------------------------------------------------
46 # grab the firefox profile ini (path may differ ...)
47 profiles_path = os.path.join(os.path.expanduser('~'), '.mozilla', 'firefox', 'profiles.ini')
48 cfg = ConfigParser.ConfigParser()
49 cfg.read(profiles_path)
50 profiles = [p for p in cfg.sections() if p.startswith('Profile')]
53 p_number = p[len('Profile'):]
55 i = max(int(p_number), i)
61 if __name__ == '__main__':