Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Name: pyconfig-orca
Description: Programa que permite modificar la configuracion de gnome por medio del modulo gconf de python
Version:0.1
License: GPLv3
Copyright: Copyright (C) 2009 Distrito Socialista Tecnologico AIT PDVSA Mérida
def email_to_csv(self, widget, data=None):
""" email_to_csv - Exports the e-mail registered in this month to a csv file"""
# FIXME: Agregar un FileChooserDialog para elegir donde guardar el archivo csv
results = self.database.execute_view("asistencia_mensual", "pizzabashlog")
f = open("emails.csv","w")
for result in results[[date.today().month]]:
# FIXME: Buscar una mejor manera de forzar el salto de línea en el archivo
f.writelines(result.value['email'] + '\n')
fitoria@fitoria-laptop:/media/disk/home/fitoria/code/msn/emesene/mesinyer/plugins/music$ pylint handler_amarok2.py
No config file found, using default configuration
************* Module handler_amarok2
W: 47: Bad indentation. Found 11 spaces, expected 12
C: 1: Missing docstring
W: 25:AmarokHandler.__init__: Catch "Exception"
C: 14:AmarokHandler.__init__: Comma not followed by a space
dbus_version = getattr(dbus, 'version', (0,0,0))
^^
>>> from handler_amarok2 import AmarokHandler
>>> player = AmarokHandler()
>>> player.is_running()
False
>>> player.is_playing()
False
>>> player.is_get_current_song()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'AmarokHandler' object has no attribute 'is_get_current_song'
<?
require "app.class.php";
function genSQL($object) {
$o = $object . "Table";
$data = new $o;
$sql = "CREATE TABLE $data->name (\n";
$i = 0;
foreach($data->definition as $column) {
unset($size);
def get_url(clean_update):
urlfinders = [
re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\),\\\"]"),
re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?"),
re.compile("(~/|/|\\./)([-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]|\\\\)+"),
re.compile("'\\<((mailto:)|)[-A-Za-z0-9\\.]+@[-A-Za-z0-9\\.]+"),
]
{% extends "base.html" %}
{%block extra_head%}
<link rel="stylesheet" href="/css/smoothness/jquery-ui-1.7.1.custom.css" type="text/css" />
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/js/ui.core.js"></script>
<script type="text/javascript" src="/js/ui.datepicker.js"></script>
<script type="text/javascript" src="/js/i18n/ui.datepicker-es.js"></script>
{%endblock%}
{%block title %}Editar Perfil{%endblock%}
@fitoria
fitoria / gist:217614
Created October 24, 2009 16:37 — forked from leah/gist:216443
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
for i in range(len(data)):
porcentaje_producen = "%.2f" % (data[i][0]/totals[0])*100 #fail
porcentaje_compran = (data[i][1]/totals[1])*100
porcentaje_suficiente = (data[i][2]/totals[2])*100
data[i].insert(1, porcentaje_producen)
data[i].insert(3, "%.2f" % porcentaje_compran) #fail
data[i].insert(5, porcentaje_suficiente)
data[i].insert(0, [dato[1] for dato in PRODUCTO_CHOICES][i])