Ticket #459: sugar-toolkit.patch

File sugar-toolkit.patch, 1.7 KB (added by alsroot, 15 years ago)

new version

  • src/sugar/bundle/contentbundle.py

    diff --git a/src/sugar/bundle/contentbundle.py b/src/sugar/bundle/contentbundle.py
    index a95ed61..d00936a 100644
    a b  
    11# Copyright (C) 2007, Red Hat, Inc.
     2# Copyright (C) 2009 Aleksey Lim
    23#
    34# This library is free software; you can redistribute it and/or
    45# modify it under the terms of the GNU Lesser General Public
    class ContentBundle(Bundle): 
    197198    def get_start_uri(self):
    198199        return "file://" + urllib.pathname2url(self.get_start_path())
    199200
     201    # TODO treat ContentBundle in special way
     202    # needs rethinking while fixing ContentBundle support
     203    def get_bundle_id(self):
     204        return self._bundle_class
     205
     206    # TODO treat ContentBundle in special way
     207    # needs rethinking while fixing ContentBundle support
     208    def get_activity_version(self):
     209        return self._library_version
     210
    200211    def is_installed(self):
    201212        if self._zip_file is None:
    202213            return True
    203214        elif os.path.isdir(self.get_root_dir()):
    204             return True
     215            return ContentBundle(self.get_root_dir()).get_library_version() \
     216                    == self.get_library_version()
    205217        else:
    206218            return False
    207219
    208     def install(self):
    209         self._unzip(env.get_user_library_path())
     220    def install(self, install_path):
     221        # TODO ignore passed install_path argument
     222        # needs rethinking while fixing ContentBundle support
     223        install_path = env.get_user_library_path()
     224        self._unzip(install_path)
    210225        self._run_indexer()
     226        return self.get_root_dir()
    211227
    212228    def uninstall(self):
    213229        if self._zip_file is None: