Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYader Velásquez <yajosev@gmail.com>2011-01-14 03:14:50 (GMT)
committer Yader Velásquez <yajosev@gmail.com>2011-01-14 03:14:50 (GMT)
commita75cb2319deceffe1d7a4fc3d5ce77f9e6aba2ad (patch)
treea40c6b37e53c5cce1361465753e3e49844c237fd
parenta2bbb1bedca747a4f56932507a89b5c1b5547a52 (diff)
is imposible to add a new activity if the file is empty
-rwxr-xr-xMANIFEST1
-rwxr-xr-xactivity/activity.info2
-rw-r--r--archivo.py6
-rw-r--r--calendario.py27
-rw-r--r--dist/Calendario-3.xobin0 -> 24247 bytes
-rw-r--r--locale/es/LC_MESSAGES/org.laptop.calendario.mobin1504 -> 1503 bytes
-rw-r--r--po/es.po10
7 files changed, 25 insertions, 21 deletions
diff --git a/MANIFEST b/MANIFEST
index ffb3cbe..4fc315a 100755
--- a/MANIFEST
+++ b/MANIFEST
@@ -11,4 +11,3 @@ activity/icono_calendario.svg
locale/es/activity.linfo
locale/es/LC_MESSAGES/org.laptop.calendario.mo
po/es.po
-
diff --git a/activity/activity.info b/activity/activity.info
index f12f44d..4e7e747 100755
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,7 +3,7 @@ name = Calendario
service_name = org.laptop.calendario
class = calendario.CalendarioActivity
icon = icono_calendario
-activity_version = 2
+activity_version = 3
show_launcher = yes
mime_types = application/x-calendario
licence = GPLv3
diff --git a/archivo.py b/archivo.py
index 1d73e3a..1f6f885 100644
--- a/archivo.py
+++ b/archivo.py
@@ -25,7 +25,8 @@ from gettext import gettext as _
_log = logging.getLogger('Log archivo')
def indice_entero(cadena):
- '''return an int from a string with tuple sintax'''
+ '''Convert a turple's index to an interger number, for
+ be used by others functions'''
cadena = cadena.replace('(','')
cadena = cadena.replace(',','')
cadena = cadena.replace(')','')
@@ -67,7 +68,8 @@ def crear_modelo(indice, path):
return modelo
def comprobar_efemeride(path):
- '''test is the ephemeri file exists'''
+ '''Return true if the ephemeris database exists,
+ else return false'''
path = path + '/data/efemerides.pkl'
if not os.path.exists(path):
return False
diff --git a/calendario.py b/calendario.py
index d16d205..8b00aeb 100644
--- a/calendario.py
+++ b/calendario.py
@@ -181,6 +181,8 @@ class CalendarioActivity(activity.Activity):
self.archivo.show_all()
def _check_cb(self, widget, data=None):
+ '''return 1 if the checkbutton is now enable, else
+ return 0'''
if self.check_status is 1:
self.check_status = 0
else:
@@ -211,21 +213,22 @@ class CalendarioActivity(activity.Activity):
'''when the user clicked on the save button,
the content is added to a python object and
is saved in a file'''
- self.lista_fecha = self.calendario.get_date()
- self.indice_dia = FechaUnix(self.lista_fecha)
- self.indice_dia = self.indice_dia.fecha_unix()
self.buffer = self.entrada.get_buffer()
self.inicio, self.final = self.buffer.get_bounds()
self.cadena = self.buffer.get_text(self.inicio, self.final, False)
- self.modelocombo = self.combo.get_model()
- self.index = self.combo.get_active()
- self.categoria = self.modelocombo[self.index][0]
- guardar_dato(self.indice_dia, self.cadena, self.categoria,\
- self.check_status, self.path)
- self.buffer.set_text(' ')
- self.modelo = crear_modelo(self.indice_dia, self.path)
- self.actividades.set_model(self.modelo)
-
+ #if the buffer is not empty or does not have space
+ if self.cadena is not ' ' and self.cadena is not '' and self.cadena is not ' ':
+ self.lista_fecha = self.calendario.get_date()
+ self.indice_dia = FechaUnix(self.lista_fecha)
+ self.indice_dia = self.indice_dia.fecha_unix()
+ self.modelocombo = self.combo.get_model()
+ self.index = self.combo.get_active()
+ self.categoria = self.modelocombo[self.index][0]
+ guardar_dato(self.indice_dia, self.cadena, self.categoria,\
+ self.check_status, self.path)
+ self.buffer.set_text(' ')
+ self.modelo = crear_modelo(self.indice_dia, self.path)
+ self.actividades.set_model(self.modelo)
def _importar_cb(self, widget, data=None):
'''change to the import view'''
diff --git a/dist/Calendario-3.xo b/dist/Calendario-3.xo
new file mode 100644
index 0000000..b436a6a
--- /dev/null
+++ b/dist/Calendario-3.xo
Binary files differ
diff --git a/locale/es/LC_MESSAGES/org.laptop.calendario.mo b/locale/es/LC_MESSAGES/org.laptop.calendario.mo
index 08c6e8c..3b11830 100644
--- a/locale/es/LC_MESSAGES/org.laptop.calendario.mo
+++ b/locale/es/LC_MESSAGES/org.laptop.calendario.mo
Binary files differ
diff --git a/po/es.po b/po/es.po
index c97e471..0cab3d6 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
+# Copyright (C) 2010
+# This file is distributed under the same license as the Calendario package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 2\n"
+"Project-Id-Version: 3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-29 16:47-0600\n"
-"PO-Revision-Date: 2010-12-29 17:56-0600\n"
-"Last-Translator: yadervv <yaderv@fedoraproject.org>\n"
+"PO-Revision-Date: 2010-12-29 18:02-0600\n"
+"Last-Translator: yaderv <yaderv@fedoraproject.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"