diff options
-rwxr-xr-x | MANIFEST | 2 | ||||
-rw-r--r-- | archivo.py | 14 | ||||
-rw-r--r-- | calendario.py | 1 | ||||
-rw-r--r-- | dist/Calendario-3.xo | bin | 33457 -> 28010 bytes |
4 files changed, 10 insertions, 7 deletions
@@ -11,7 +11,7 @@ activity/icono_calendario.svg locale/es/activity.linfo po/es.po -.calendario.py.swp + locale/es/LC_MESSAGES/org.laptop.Calendario.mo activity/icono2.svg @@ -95,21 +95,23 @@ def abrir_archivo(path, archivo): archivo.close() return texto -def guardar_archivo(path, file_name, archivo): +def guardar_archivo(path, file_name, tipo_archivo): '''import, convert and save a new ephemeris/phrases database''' - if archivo is 1: + if tipo_archivo is 1: path = path + '/data/efemerides.pkl' - elif archivo is 2: + elif tipo_archivo is 2: path = path + '/data/frase.pkl' di = {} archivo = open(file_name, 'r') lines = archivo.readlines() for i in range(len(lines)): - current_text = lines[i][10 : len(lines[i]) - 2] - + if tipo_archivo is 1: + current_text = lines[i][10 : len(lines[i]) - 2] + else: + current_text = lines[i][4 : len(lines[i]) - 2] for j in range(30, len(current_text),30): current_text = current_text[:j] + '\n' + current_text[j:] - if archivo is 1: + if tipo_archivo is 1: current_id = lines[i][0 : 8] else: current_id = lines[i][0 : 2] diff --git a/calendario.py b/calendario.py index 94dea53..24998a9 100644 --- a/calendario.py +++ b/calendario.py @@ -96,6 +96,7 @@ class CalendarioActivity(activity.Activity): if comprobar_archivo(self.path, 'efemeride'): self.texto = abrir_archivo(self.path, 'efemeride') self._log.debug(self.texto) + self._log.debug(self.fecha_normal.fecha_especial()) if self.fecha_normal.fecha_especial() in self.texto: self.buffer.set_text(self.texto[self.fecha_normal.fecha_especial()]) diff --git a/dist/Calendario-3.xo b/dist/Calendario-3.xo Binary files differindex a7f39e6..687f010 100644 --- a/dist/Calendario-3.xo +++ b/dist/Calendario-3.xo |