Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/base.py
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2012-04-11 19:04:41 (GMT)
committer flavio <fdanesse@gmail.com>2012-04-11 19:04:41 (GMT)
commit56811517bc85b6d64ed752c0400803a47eb7c9a8 (patch)
tree25e420e38a626b34a83c918c8658a09a96ed92c9 /base.py
Ceibal Notifica
Diffstat (limited to 'base.py')
-rw-r--r--base.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/base.py b/base.py
new file mode 100644
index 0000000..2737881
--- /dev/null
+++ b/base.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# Autor: Flavio Danesse - fdanesse@activitycentral.com
+'''
+La idea es hacer una aplicación que sea capaz de mostrar todos los mensajes, no importa su prioridad.
+La aplicación se llevará a cabo tanto en el azúcar y el Gnome y debe ser capaz de:
+- Muestra todos los mensajes activos
+- Filtrar y ordenar los mensajes por prioridad, fecha o tipo de mensajes'''
+
+import shelve, sqlite3, time, datetime, os
+from store import *
+
+# Archivo notificaciones # http://docs.python.org/library/shelve.html
+filename = os.path.join('/tmp', 'notify_0')
+d = shelve.open(filename)
+d['id'] = 0
+d['title'] = "Prueba Titulo"
+d['text'] = "Prueba Texto"
+d['priority'] = 1
+d['launched'] = datetime.date(1972, 6, 21)
+d['expires'] = datetime.date(2012, 6, 21)
+d['type'] = "Prueba tipo"
+d.close()
+
+filename = os.path.join('/tmp', 'notify_1')
+d = shelve.open(filename)
+d['id'] = 1
+d['title'] = "Prueba Titulo1"
+d['text'] = "Prueba Texto1"
+d['priority'] = 1
+d['launched'] = datetime.date(1972, 6, 21)
+d['expires'] = datetime.date(2013, 6, 21)
+d['type'] = "Prueba tipo1"
+d.close()
+
+store = Store(db_filename="prueba.db")
+mensaje = store.db.get_messages([])
+print mensaje
+