~didrocks/ubuntuone-client/dont-suffer-zg-crash

« back to all changes in this revision

Viewing changes to apport/source_ubuntuone-client.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2009-06-30 12:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090630120000-by806ovmw3193qe8
Tags: upstream-0.90.3
ImportĀ upstreamĀ versionĀ 0.90.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Apport integration for Ubuntu One client
 
2
#
 
3
# Copyright 2009 Canonical Ltd.
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify it
 
6
# under the terms of the GNU General Public License version 3, as published
 
7
# by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
12
# PURPOSE.  See the GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License along
 
15
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
"""Stub for Apport"""
 
17
# pylint: disable-msg=F0401,C0103
 
18
# shut up about apport. We know. We don't want to backport it for pqm
 
19
from apport.hookutils import attach_file_if_exists, packaging
 
20
import os.path
 
21
from xdg.BaseDirectory import xdg_cache_home
 
22
 
 
23
u1_client_log = os.path.join(xdg_cache_home, "ubuntuone", "log", 
 
24
    "syncdaemon.log")
 
25
u1_except_log = os.path.join(xdg_cache_home, "ubuntuone", "log", 
 
26
    "syncdaemon-exceptions.log")
 
27
u1_oauth_log = os.path.join(xdg_cache_home, "ubuntuone", "log",
 
28
                            "oauth-login.log")
 
29
 
 
30
def add_info(report):
 
31
    """add report info"""
 
32
    attach_file_if_exists(report, u1_client_log)
 
33
    attach_file_if_exists(report, u1_except_log)
 
34
    attach_file_if_exists(report, u1_oauth_log)
 
35
    
 
36
 
 
37
    packages = ['ubuntuone-client', 
 
38
                'ubuntuone-storage-protocol', 
 
39
                'ubuntuone-ppa']
 
40
 
 
41
    versions = ''
 
42
    for package in packages:
 
43
        try:
 
44
            version = packaging.get_version(package)
 
45
        except ValueError:
 
46
            version = 'N/A'
 
47
        if version is None:
 
48
            version = 'N/A'
 
49
        versions += '%s %s\n' % (package, version)
 
50
    report['UbuntuoneClientPackages'] = versions