/usr/share/pyshared/gluon/contrib/gtk_presentation.py is in python-gluon 1.99.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyright 2011 José L. Redrejo RodrÃguez <jredrejo@debian.org>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
It creates a splash screen for web2py using gtk libraries
"""
import gtk
import pango
class Presentation(gtk.Window):
def __init__(self,logo,program_name,author,version):
""" Draw the splash screen using gtk"""
super(Presentation, self).__init__(gtk.WINDOW_POPUP)
self.set_position(gtk.WIN_POS_CENTER)
self.set_modal(True)
self.set_size_request(500,300)
self.set_title('web2py')
self.AppPaintable=True
image = gtk.Image()
image.set_from_file(logo)
box=gtk.VBox()
box.pack_start(image,False,False, 0)
self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
self.add(box)
image.show()
box.show()
box.pack_start(self.add_label('Welcome to...'),True,False, 0)
box.pack_start(self.add_label(program_name, 18,pango.AttrForeground(65535, 23807, 8191, 0, 31),True),True,False, 0)
box.pack_start(self.add_label(author),True,False, 0)
box.pack_start(self.add_label(version),True,False, 0)
self.show()
def add_label(self,text='Change Me', font_size=12, foreground=pango.AttrForeground(6655, 22783, 26367, 0, 50), bold=False):
label=gtk.Label(text)
plist=pango.AttrList()
fg_size=pango.AttrSize(font_size*1000,0,50)
fg_color=foreground
plist.insert(fg_color)
plist.insert(fg_size)
if bold:plist.insert(pango.AttrWeight(pango.WEIGHT_HEAVY, 0, -1))
label.set_attributes(plist)
label.show()
return label
|