Codigo Fuente Python de Pichiego navegador liviano

#!/usr/bin/python
import os, sys, gtk, gtkmozembed, PIL.Image

class Take_screenshot:
def __init__(self, parent = None):
self.parent = gtk.Window(gtk.WINDOW_TOPLEVEL)

# Initialize mozembed
self.moz = gtkmozembed.MozEmbed()
#self.moz = webkit.WebView()

self.moz.show()

print self.parent.get_allocation().height # returns 1
#self.moz.set_resize_mode(gtk.RESIZE_PARENT) # tested if this changed something
#self.parent.set_resize_mode(gtk.RESIZE_PARENT) # tested if this changed something
self.parent.add(self.moz)
self.moz.load_url(url)
self.parent.show_all()

# Connect signals
self.moz.connect(‘net_stop’, self.prepare_screenshot)
self.moz.connect(‘size-request’, self.set_size)
self.moz.connect(‘size-allocate’, self.set_size)
self.parent.connect(‘delete_event’, self.close_application) # evento de cerrar la ventana

def prepare_screenshot(self, data = None): # ‘Page loaded’
sys.stdout.flush()
# gtk.timeout_add(1000, self.create_screenshot)
#print gtk.Requisition(self.moz).height # Doesn’t work (abstract widget => requisition with connect(‘size-request’))

def set_size(self, width, height):
print ‘width: %d height: %d’% (height.width, height.height)
#print height # the height-parameter is a gtkmozembed object

def create_screenshot(self):
(x, y, width, height, depth) = self.moz.window.get_geometry()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
pixbuf.get_from_drawable(self.moz.window, self.moz.get_colormap(), 0, 0, 0, 0, width, height)
pixbuf.save(‘screenshot.png’, ‘png’) # ‘Write screenshot.png’
# gtk.main_quit()

def close_application(self, widget, event, data=None):
gtk.main_quit()

if __name__ == ‘__main__’:
# http://www.gnewbook.org/pg/blog/asrafil/read/58799/minibrowserpy-un-navegador-minimalista-ultraligero-y-escrito-en-python
if len(sys.argv) > 1:
url = sys.argv[1]
else:
url = ‘file:///usr/share/pichiciego/index.html’

Take_screenshot()
gtk.main()

Descarga: Alacarte y edita tu menu Gnome

Alacarte (previamente llamado Menú de edición simple para GNOME o por sus siglas en inglés SMEG, es un editor de menú para el escritorio GNOME. Es parte de GNOME desde la versión 2.16.

El menú «Lugares» no se puede editar con Alacarte. Para modificarlo un poco se puede hacer con esto:

$gedit ~/.gtk-bookmarks

o usando gconf-editor (p.ej. /system/storage/drives/_org_freedesktop_…/mount_options).

fuente:wikipedia.org

DESCARGAR CODIGO FUENTE:
http://ftp.gnome.org/pub/gnome/sources/alacarte/

Descarga el codigo fuente Usplash (Userspace bootsplash utility)

Usplash es una aplicación de espacio de usuario que utiliza la interfaz de framebuffer de Linux para dibujar una pantalla de bienvenida en el arranque.

Usplash permite que la secuencia de arranque se muestre de una manera más atractiva.

Descargar codigo fuente usplash:

Codigo fuente tema usplash

/* usplash
*
* eft-theme.c – definition of eft theme
*
* Copyright © 2006 Dennis Kaarsemaker
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include
/* Needed for the custom drawing functions */
#include
extern struct usplash_pixmap pixmap_usplash_640_480;
extern struct usplash_pixmap pixmap_usplash_800_480, pixmap_usplash_800_600, pixmap_usplash_1024_768, pixmap_usplash_1024_600, pixmap_usplash_1280_800, pixmap_usplash_1280_1024, pixmap_usplash_1440_900, pixmap_usplash_1680_1050, pixmap_usplash_1920_1200;
extern struct usplash_pixmap pixmap_throbber_back;
extern struct usplash_pixmap pixmap_throbber_fore;

void t_init(struct usplash_theme* theme);
void t_clear_progressbar(struct usplash_theme* theme);
void t_draw_progressbar(struct usplash_theme* theme, int percentage);
void t_animate_step(struct usplash_theme* theme, int pulsating);

struct usplash_theme usplash_theme_800_480;
struct usplash_theme usplash_theme_800_600;
struct usplash_theme usplash_theme_1024_600;
struct usplash_theme usplash_theme_1024_768;
struct usplash_theme usplash_theme_1280_800;
struct usplash_theme usplash_theme_1280_1024;
struct usplash_theme usplash_theme_1440_900;
struct usplash_theme usplash_theme_1680_1050;
struct usplash_theme usplash_theme_1920_1200;

/* Theme definition */
struct usplash_theme usplash_theme = {
.version = THEME_VERSION, /* ALWAYS set this to THEME_VERSION,
it’s a compatibility check */
.next = &usplash_theme_800_480,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_640_480,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 182,
.progressbar_y = 278,
.progressbar_width = 276,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 140,
.text_y = 345,
.text_width = 360,
.text_height = 100,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_800_480 = {
.version = THEME_VERSION, /* ALWAYS set this to THEME_VERSION,
it’s a compatibility check */
.next = &usplash_theme_800_600,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_800_480,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 262,
.progressbar_y = 278,
.progressbar_width = 276,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 220,
.text_y = 345,
.text_width = 360,
.text_height = 100,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_800_600 = {
.version = THEME_VERSION, /* ALWAYS set this to THEME_VERSION,
it’s a compatibility check */
.next = &usplash_theme_1024_600,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_800_600,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 225,
.progressbar_y = 348,
.progressbar_width = 350,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 220,
.text_y = 432,
.text_width = 360,
.text_height = 150,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1024_600 = {
.version = THEME_VERSION,
.next = &usplash_theme_1024_768,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1024_600,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 362,
.progressbar_y = 348,
.progressbar_width = 300,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 332,
.text_y = 432,
.text_width = 360,
.text_height = 150,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1024_768 = {
.version = THEME_VERSION,
.next = &usplash_theme_1280_800,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_1024_768,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 312,
.progressbar_y = 445,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 322,
.text_y = 552,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1280_800 = {
.version = THEME_VERSION,
.next = &usplash_theme_1280_1024,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1280_800,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 440, /* 1280/2 – 400/2 */
.progressbar_y = 464,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 450,
.text_y = 576,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1280_1024 = {
.version = THEME_VERSION,
.next = &usplash_theme_1440_900,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_1280_1024,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 440,
.progressbar_y = 594,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 450,
.text_y = 736,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1440_900 = {
.version = THEME_VERSION,
.next = &usplash_theme_1680_1050,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1440_900,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 520,
.progressbar_y = 522,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 530,
.text_y = 648,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1680_1050 = {
.version = THEME_VERSION,
.next = &usplash_theme_1920_1200,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1680_1050,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 640,
.progressbar_y = 610,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 650,
.text_y = 756,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1920_1200 = {
.version = THEME_VERSION,
.next = NULL,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1920_1200,

/* Palette indexes */
.background = 34,
.text_background = 34,
.text_foreground = 0,
.text_success = 255,
.text_failure = 17,

/* Progress bar position and size in pixels */
.progressbar_x = 760,
.progressbar_y = 696,
.progressbar_width = 400,
.progressbar_height = 20,

/* Text box position and size in pixels */
.text_x = 770,
.text_y = 864,
.text_width = 380,
.text_height = 200,

/* Text details */
.line_height = 15,
.line_length = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

void t_init(struct usplash_theme *theme) {
int x, y;
usplash_getdimensions(&x, &y);
theme->progressbar_x = (x – theme->pixmap->width)/2 + theme->progressbar_x;
theme->progressbar_y = (y – theme->pixmap->height)/2 + theme->progressbar_y;
}

void t_clear_progressbar(struct usplash_theme *theme) {
usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back);
}

void t_draw_progressbar(struct usplash_theme *theme, int percentage) {
int w = (pixmap_throbber_back.width * percentage / 100);
if(percentage == 0)
usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back);
if(percentage progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height,
&pixmap_throbber_back, 0, 0);
/* Draw foreground to right of background */
usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, pixmap_throbber_back.width – w,
pixmap_throbber_back.height, &pixmap_throbber_fore, w, 0);
}
else{/* Loading */
/* Draw foreground to left of background */
usplash_put_part(theme->progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height,
&pixmap_throbber_fore, 0, 0);
/* Draw background ot right of foreground */
usplash_put_part(theme->progressbar_x + w, theme->progressbar_y, pixmap_throbber_back.width – w, pixmap_throbber_back.height,
&pixmap_throbber_back, w, 0);
}
}

void t_animate_step(struct usplash_theme* theme, int pulsating) {

static int pulsate_step = 0;
static int pulse_width = 56;
static int step_width = 2;
static int num_steps = 0;
int x1;
int x2;
num_steps = (pixmap_throbber_fore.width – pulse_width)/2;

if (pulsating) {
if(pulsate_step progressbar_x, theme->progressbar_y, x1,
pixmap_throbber_back.height, &pixmap_throbber_back, 0, 0);
/* Draw progress bar foreground ‘pulse’ */
usplash_put_part(theme->progressbar_x + x1, theme->progressbar_y, pulse_width,
pixmap_throbber_back.height, &pixmap_throbber_fore, x1, 0);
/* Draw progress bar background on right side of foreground ‘pulse’ */
usplash_put_part(theme->progressbar_x + x2, theme->progressbar_y, pixmap_throbber_back.width – x2,
pixmap_throbber_back.height, &pixmap_throbber_back, x2, 0);

pulsate_step = (pulsate_step + 1) % num_steps;
}
}

¿Que es python-gtk2? y su codigo fuente

python-gtk2 es un paquete que contiene módulos que le permiten usar GTK+ en los programas escritos en Python. Sin este paquete muchos de tus programas escritos en Python no funcionaran por que nesesitaran de su parte grafica.

Descargar codigo fuente pygtk:

Codigo fuente: Python-gst Entorno genérico de reproducción multimedia (enlaces de Python)

GStreamer es un entorno de procesado multimedia compatible con una amplia variedad de fuentes de datos, salidas y formatos mediante el uso de complementos cargados dinámicamente.

Descarga Codigo fuente gst0.10-python:

Ejemplos de Ejercicios de Pseudo lenguaje Resueltos

En un hospital existen tres áreas: Ginecología, Pediatría, Traumatología. El presupuesto anual del hospital se reparte conforme a la siguiente. Tabla:

Área Porcentaje del presupuesto
Ginecología 40%
Traumatología 30%
Pediatría 30%

Obtener la cantidad de dinero que recibirá cada área, para cualquier monto presupuestado.

Solución
Inicio
Real ginecologia, traumatologia, pediatria, presupuesto
Leer presupuesto
ginecologia = presupuesto * 0.4
traumatologia = presupuesto * 0.3
pediatria = presupuesto * 0.3
escribir ginecologia,traumatologia,pediatria
fin

El dueño de una tienda compra un artículo a un precio determinado. Obtener el precio en que lo debe vender para obtener una ganancia del 30%.

Solución
inicio
real precio_articulo,porcentaje,precio_total
leer precio_articulo
porcentaje = precio_articulo*0.3
precio_total=precio_articulo+porcentaje
leer precio_total
fin

Todos los lunes, miércoles y viernes, una persona corre la misma ruta y cronometra los tiempos obtenidos. Determinar el tiempo promedio que la persona tarda en recorrer la ruta en una semana cualquiera.

Solucion
inicio
real tiempo_obtenido1,tiempo_obtenido2,tiempo_promedio
leer tiempo_obtenido1
leer tiempo_obtenido2
tiempo_promedio=(tiempo_obtenido1+tiempo_obtenido2)/2
escribir tiempo_promedio
fin

Tres personas deciden invertir su dinero para fundar una empresa. Cada una de ellas invierte una cantidad distinta. Obtener el porcentaje que cada quien invierte con respecto a la cantidad total invertida.

Solucion
inicio
real inversion01,inversion02,inversion03,inversion_total
leer inversion01,inversion02,inversion03
inversion_total=inversion01+inversion02+inversion03
porce01= (inversion01*100)/inversion_total
porce02= (inversion02*100)/inversion_total
porce03= (inversion02*100)/inversion_total
escribir porce01,porce02,porce03
fin

Descarga: el codigo fuente de e-Mule

eMule es un programa para intercambio de archivos con sistema P2P utilizando el protocolo eDonkey 2000 y la red Kad, publicado como software libre para sistemas Microsoft Windows.

Creado en un principio como alternativa al programa eDonkey, en poco tiempo lo superó en funciones, y sumando el hecho de que era libre y gratuito, entre otros motivos, lograron que en poco tiempo lo superase en popularidad para convertirse en uno de los programas más usados por los usuarios de P2P. Existen también múltiples programas derivados con el objetivo de portarlo a otros sistemas operativos, como lMule, xMule o aMule.

Imagen del programa:

Descargar:

Código fuente v0.50a
Descargar
Este archivo contiene solamente el código fuente de esta versión, presentado en formato comprimido. Para desarrolladores.

Descarga: Dolphin y crea tu propia red social

Hace tiempo que Dolphin es un reconocido proyecto de portal comunitario. Desde su nacimiento se orientó hacia el carácter colaborativo y social, aunque más bien del tipo Netlog o similares, que se centran en la búsqueda de pareja. Recientemente Dolphin ha presentado la nueva versión de su sistema PHP, que va por la versión 6, y que ha renacido como Smart Community Builder. Se podría decir que la esencia del proyecto sigue ahí, pero la capa visible al público ha cambiado profundamente, y diremos que para mejor.

En esta nueva fórmula se permite mantener la búsqueda por sexo y edad, así como otras funciones de localización de miembros del portal, pero se fortalece sobremanera la vertiente multimedia. Ya es posible manejar fotos, vídeos, enlaces, contadores y muchas más cosas con mayor potencia que antes. Lo mejor de todo, puede integrar perfectamente servicios como YouTube o MySpace, Flickr y varios más dentro de su entorno visual.

Para redondear el asunto, es totalmente gratuito, pudiendo pagar una pequeña cuota con la única finalidad de eliminar un enlace residente a la página del proyecto, si lo consideráis necesario o queréis apoyar su desarrollo. Además, dispone de demos gratuitas en línea tanto del portal como del sistema de administración ¿A que esperáis?

fuente:http://www.dosbit.com/

Descargar Dolphin red social