/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-02-18 13:01:03 UTC
  • Revision ID: jelmer@samba.org-20110218130103-fiyk203auk28thpn
Remove some unused imports, fix some formatting.

Show diffs side-by-side

added added

removed removed

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