~ubuntu-branches/ubuntu/natty/lxinput/natty-proposed

« back to all changes in this revision

Viewing changes to debian/source_lxinput.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne, Julien Lavergne, Andrew Lee (李健秋)
  • Date: 2010-08-09 00:48:39 UTC
  • mfrom: (1.2.1 upstream) (2.1.4 experimental)
  • Revision ID: james.westby@ubuntu.com-20100809004839-2ngqb3kc5re409l6
Tags: 0.3.0-0ubuntu1
[ Julien Lavergne ]
* Sync with Debian LXDE git.
* debian/source_lxinput.py
 - Add apport hook for lxinput, to collect config file.
* debian/install
 - Install apport hook.

[ Andrew Lee (李健秋) ]
* New upstream release
  - Fixed incorrect path of config file
  - Fixed wrongly transformed mouse threshold parameter
    (LP: #563534)
  - Fixed incorrect path of desktop entry file template
  - Fixed broken translation in bg.po
  - Fixed configure.in and Makefile.am to add proper xlib flags
    (Closes: #555573)
  - Translation updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
  Copyright (c) 2010 Julien Lavergne <gilir@ubuntu.com>
 
3
 
 
4
  This program is free software; you can redistribute it and/or modify
 
5
  it under the terms of the GNU General Public License as published by
 
6
  the Free Software Foundation; either version 2 of the License, or
 
7
  (at your option) any later version.
 
8
 
 
9
  This program is distributed in the hope that it will be useful,
 
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public License
 
15
  along with this program; if not, write to the Free Software Foundation,
 
16
  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
17
"""
 
18
 
 
19
import os
 
20
import apport.hookutils
 
21
 
 
22
#Detect session
 
23
session = os.environ['DESKTOP_SESSION']
 
24
 
 
25
#If it's not Lubuntu or LXDE, fallback to default location
 
26
if not session:
 
27
    session = "LXDE"
 
28
 
 
29
#Set location of various configuration files
 
30
system_conf = "/etc/xdg/lxsession/"
 
31
home_conf = os.path.expanduser("~/.config/lxsession/")
 
32
 
 
33
#Set description for each file reported by apport
 
34
report_config_system = "Config_System_" + session
 
35
report_config_home = "Config_Home_" + session
 
36
 
 
37
def add_info(report):
 
38
    # If a config file exist in HOME, report it instead of the system one.
 
39
    if os.path.exists(os.path.join(home_conf,session,"config")):
 
40
        report[report_config_home] = apport.hookutils.read_file(os.path.join(home_conf,session,"desktop.conf"))
 
41
    else:
 
42
        report[report_config_system] = apport.hookutils.read_file(os.path.join(system_conf,session,"desktop.conf"))