Commit 1451c02d by Ruben Rodriguez

Added 8.0 packages

parent 80e605b0

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

Ross Burton <ross@burtonini.com>
Niran Babalola
Sebastian Heinlein <sebastian.heinlein@web.de>
Julian Andres Klode <jak@jak-linux.org>
Michael Vogt <michael.vogt@ubuntu.com>
# (c) 2005 Canonical, GPL
import gtk
#import gtkhtml2
import urllib
import urlparse
import gobject
import time
import subprocess
class BrowserView(object):
""" abstract browser interface for AppInstall, the requirements are
very light, it must only support loading a html page for now
"""
def loadUri(self, uri):
pass
class DumpBrowserView(gtk.ScrolledWindow):
def __init__(self):
gtk.ScrolledWindow.__init__(self)
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.set_shadow_type(gtk.SHADOW_IN)
self.view = gtk.TextView()
self.add(self.view)
self.view.show_all()
def loadUri(self,uri):
parts = urlparse.urlparse(uri)
if parts[0] != "file":
return False
f = open(parts[2])
buf = self.view.get_buffer()
buf.set_text(f.read())
return True
# import gtkmozembed
# class MozEmbedBrowserView(gtkmozembed.MozEmbed):
# def __init__(self):
# gtkmozembed.MozEmbed.__init__(self)
# def loadUri(self, uri):
# self.load_url(uri)
class GtkHtml2BrowserView(gtk.ScrolledWindow):
__gsignals__ = {
'submit': (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_STRING,
gobject.TYPE_STRING,
gobject.TYPE_STRING))
}
# FIXME: this stuff is not threaded
# the problem is that for threading and/or async read support
# we need a URLOpener() that returns a object that can do
# async read()
# To do this, we need a e.g. GnomeVfsWorker that reacts on
# read(), keeps the gtk_stuff runing and can be canceled
def __init__(self):
gtk.ScrolledWindow.__init__(self)
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.set_shadow_type(gtk.SHADOW_IN)
self.view = gtkhtml2.View()
self.view.show()
self.currentUri = None
self._opener = urllib.FancyURLopener()
self.document = gtkhtml2.Document()
self.document.connect('request_url', self._request_url)
self.view.set_document(self.document)
self.add(self.view)
self.document.connect('link_clicked', self.linkClicked)
self.document.connect('submit', self.submit)
def linkClicked(self, document, link):
subprocess.Popen(["/usr/bin/gnome-open",link])
def submit(self, document, action, method, value):
"""A html form in the app description is used to add required
repositories. So send the corresponding signal"""
self.emit("submit", action, method, value)
def loadUri(self, uri):
#print "loadUri(%s)" % uri
self.content = None
if uri == "about:blank":
self.document.clear()
return
# load it
try:
f = self._open_uri(uri)
except (OSError, IOError):
print "failed to open", uri
self.content = _("Failed to open '%s'") % uri
return
self.currentUri = self._resolve_uri(uri)
self.headers = f.info()
self.content = f.read()
self.document.open_stream('text/html')
self.document.write_stream(self.content)
self.document.close_stream()
def _open_uri(self, uri):
#print "_resolv_uri: %s " % uri
uri = self._resolve_uri(uri)
return self._opener.open(uri)
def _resolve_uri(self, uri):
if self._is_relative_to_server(uri):
return urlparse.urljoin(self.currentUri, uri)
return uri
def _request_url(self, document, url, stream):
f = self._open_uri(url)
stream.write(f.read())
def _is_relative_to_server(self, url):
parts = urlparse.urlparse(url)
if parts[0] or parts[1]:
return False
return True
gobject.type_register(GtkHtml2BrowserView)
if __name__ == "__main__":
win = gtk.Window()
view = GtkHtml2BrowserView()
view.set_size_request(600,400)
win.add(view)
win.show_all()
view.loadUri("http://www.skype.com/company/legal/eula/")
gtk.main()
# (c) 2005-2007 Canonical - GPL
# (c) 2006-2007 Sebastian Heinlein
#
# Authors:
# Michael Vogt
# Sebastian Heinlein
#
import xdg.Menu
import sys
import os
import cPickle
import glob
from Util import *
class MenuItem(object):
" base class for a object in the menu "
def __init__(self, name, iconname="applications-other"):
# the name that is displayed
self.name = name
# the icon that is displayed
self.iconname = iconname
self.icontheme = None
def __repr__(self):
return "MenuItem: %s" % self.name
class Category(MenuItem):
""" represents a category """
def __init__(self, parent, name, iconname="applications-other"):
MenuItem.__init__(self, name, iconname)
class Application(MenuItem):
""" this class represents a application """
def __init__(self, name, iconname="applications-other"):
MenuItem.__init__(self, name, iconname)
# the apt-pkg name that belongs to the app
self.pkgname = None
# the desktop file comment
self.comment = ""
# mime type
self.mime = None
# exec
self.execCmd = None
# needsTerminal
self.needsTerminal = False
# component the package is in (main, universe)
self.component = None
# channel the pacakge is in (e.g. skype)
self.channel = None
# Name of the independent software vendor
self.isv = None
# states
self.popcon = 1 # the raw popcon data
self.rank = 1 # used by the ranking algo
self.onTop = False # show always on top (regardless of rank/name)
# licence and support
self.free = False
self.licenseUri = None
self.supported = False
self.thirdparty = False
self.architectures = []
# textual menu path
self.menupath = ""