~evfool/software-center/fixnavigation

« back to all changes in this revision

Viewing changes to softwarecenter/utils.py

  • Committer: Michael Vogt
  • Date: 2011-06-17 14:55:07 UTC
  • mfrom: (1809.1.24 backend-refactor)
  • Revision ID: michael.vogt@ubuntu.com-20110617145507-l0xvfrd6d3271xed
lp:~alexeftimie/software-center/backend-refactor,
many thanks to Alex Eftimie (LP: #704719)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# this program; if not, write to the Free Software Foundation, Inc.,
17
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
 
import apt_pkg
20
19
import dbus
21
20
import gmenu
22
21
import gettext
213
212
    """
214
213
    return xml.sax.saxutils.unescape(text, ESCAPE_ENTITIES)
215
214
 
216
 
#def get_current_arch():
217
 
#    return apt_pkg.config.find("Apt::Architecture")
218
 
 
219
215
def uri_to_filename(uri):
 
216
    import apt_pkg
220
217
    return apt_pkg.uri_to_filename(uri)
221
218
 
222
219
def human_readable_name_from_ppa_uri(ppa_uri):
513
510
upstream_version = get_pkg_info().upstream_version
514
511
version_compare = get_pkg_info().version_compare
515
512
 
 
513
# only when needed
 
514
try:
 
515
    import apt_pkg
 
516
    size_to_str = apt_pkg.size_to_str
 
517
except ImportError:
 
518
    def size_to_str(size):
 
519
        return str(size)
516
520
        
517
521
if __name__ == "__main__":
518
522
    s = decode_xml_char_reference('Search…')