/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to about.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-14 20:12:19 UTC
  • Revision ID: jelmer@samba.org-20110314201219-wo692nzwywu6mevh
Fix formatting, imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
except:
21
21
    pass
22
22
 
23
 
import bzrlib
24
23
import gtk
25
24
import os
26
 
from bzrlib.branch import Branch
27
 
from bzrlib.errors import NotBranchError, NoRepositoryPresent
28
 
from bzrlib.trace import mutter
29
 
 
30
 
from bzrlib.plugins.gtk import icon_path
 
25
 
 
26
import bzrlib
 
27
 
 
28
from bzrlib.plugins.gtk import (
 
29
    data_path,
 
30
    icon_path,
 
31
    )
31
32
 
32
33
 
33
34
def read_license():
34
 
    license_file = os.path.join(os.path.dirname(__file__), "COPYING")
35
 
    if os.path.exists(license_file):
36
 
        return file(license_file).read()
 
35
    license_paths = [data_path("COPYING"), "/usr/share/common-licenses/GPL-2"]
 
36
    for license_file in license_paths:
 
37
        if license_file is not None and os.path.exists(license_file):
 
38
            return file(license_file).read()
37
39
    # Fall back to just license name if we can't find the file
38
40
    return "GPLv2 or later"
39
41
 
41
43
def load_credits():
42
44
    import pickle
43
45
    try:
44
 
        credits = pickle.load(file("credits.pickle"))
 
46
        credits = pickle.load(file(data_path("credits.pickle")))
45
47
    except IOError:
46
48
        credits = None
47
49
    return credits