Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/persistencia.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-04-12 11:25:24 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-12 11:25:24 (GMT)
commit5b0b4bf9e55eed42d8dd138d5b8cf438c27cd2dc (patch)
tree2e9d528433b4b52afea5dc8ad8f91705b03026b2 /persistencia.py
parentcdb6b535d9209df540e5da657300326131bf67bc (diff)
Manage the case of Globes without text (Images)
The class Imagen is a Globo, but with texto = None. This patch contemplate all the cases where text can be None. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'persistencia.py')
-rw-r--r--persistencia.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/persistencia.py b/persistencia.py
index dda4829..5681568 100644
--- a/persistencia.py
+++ b/persistencia.py
@@ -57,19 +57,15 @@ class Persistence:
if (globo.__class__ == globos.Imagen):
globoData['image_name'] = globo.image_name
globoData['x'], globoData['y'] = globo.x, globo.y
- #globoData.ancho_text, globoData.alto_text =
- #globo.ancho_text, globo.alto_text
- globoData['text_width'] = globo.texto.ancho
- globoData['text_height'] = globo.texto.alto
- globoData['text_text'] = globo.texto.text
- globoData['text_color'] = globo.texto.color
+ if globo.texto is not None:
+ globoData['text_width'] = globo.texto.ancho
+ globoData['text_height'] = globo.texto.alto
+ globoData['text_text'] = globo.texto.text
+ globoData['text_color'] = globo.texto.color
- globoData['text_font_description'] =\
- globo.texto.font_description
-
- #globoData['text_show_border'] = globo.texto.mostrar_borde
- #globoData['text_show_cursor'] = globo.texto.mostrar_cursor
+ globoData['text_font_description'] = \
+ globo.texto.font_description
boxData['globes'].append(globoData)
pageData['boxs'].append(boxData)
@@ -157,7 +153,7 @@ class Persistence:
x=globo_x, y=globo_y)
globo.direccion = globo_direccion
- if globo != None:
+ if globo is not None:
globo.radio = globoData['radio']
globo.ancho, globo.alto = globoData['width'], \
globoData['height']
@@ -168,13 +164,14 @@ class Persistence:
globo.x, globo.y = globoData['x'], globoData['y']
- globo.texto.ancho = globoData['text_width']
- globo.texto.alto = globoData['text_height']
- globo.texto.text = globoData['text_text']
- globo.texto.color = globoData['text_color']
+ if (tipo_globo != 'IMAGE'):
+ globo.texto.ancho = globoData['text_width']
+ globo.texto.alto = globoData['text_height']
+ globo.texto.text = globoData['text_text']
+ globo.texto.color = globoData['text_color']
- globo.texto.set_font_description(
- globoData['text_font_description'])
+ globo.texto.set_font_description(
+ globoData['text_font_description'])
box.globos.append(globo)