Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-10-23 14:02:55 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-10-23 14:57:53 (GMT)
commitef3185acee52981dedfcff24c51594d7379a9ae1 (patch)
tree15781d07256f3db56fbb5385ec2ab5637ed7d4f8
parentb11508e23aa072163228f4419cc97dfe2af0dd91 (diff)
Pep8 and pyflakes fixes
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--globos.py9
-rw-r--r--historietaactivity.py1
-rw-r--r--persistencia.py22
-rw-r--r--toolbar.py5
4 files changed, 14 insertions, 23 deletions
diff --git a/globos.py b/globos.py
index c54ce8d..5cc5950 100644
--- a/globos.py
+++ b/globos.py
@@ -143,7 +143,6 @@ class Globo:
context.set_line_width(ANCHO_LINEAS_CONTROLES)
x = self.x * self.radio / (self.ancho * 1.0)
- y = self.y * self.radio / (self.alto * 1.0)
# rectangulo alrededor del globo
context.set_source_rgb(1, 1, 1)
@@ -230,7 +229,7 @@ class Globo:
elif abs((self.y - self.alto) - y) < sensibility:
cursor = Gdk.CursorType.TOP_SIDE
elif abs((self.y + self.alto) - y) < sensibility:
- state = Gdk.CursorType.BOTTOM_SIDE
+ cursor = Gdk.CursorType.BOTTOM_SIDE
return cursor
def is_selec(self, x, y):
@@ -512,8 +511,6 @@ class Nube(Globo):
self.x = x
self.y = y
- appdir = os.path.join(activity.get_bundle_path())
-
ancho_text, alto_text = self.calc_area_texto(self.ancho, self.alto)
self.texto = CuadroTexto(self, ancho_text, alto_text,
font_name)
@@ -547,7 +544,6 @@ class Nube(Globo):
x_cen = self.x
y_cen = self.y
- points = []
steps = 36
ancho_int = self.ancho * 0.8
@@ -574,8 +570,6 @@ class Nube(Globo):
x3 = x_cen + (1.0 * ancho_int * cosalpha)
y3 = y_cen + (1.0 * alto_int * sinalpha)
- draw_line = False
-
if state == 2:
cr.curve_to(x1, y1, x2, y2, x3, y3)
@@ -658,7 +652,6 @@ class Grito(Globo):
def draw_exclamation(self, cr, x_cen, y_cen, width, height, direction,
punto):
- points = []
steps = 24
width_int = width * 0.8
diff --git a/historietaactivity.py b/historietaactivity.py
index 11f4c50..a2d271e 100644
--- a/historietaactivity.py
+++ b/historietaactivity.py
@@ -417,7 +417,6 @@ class Page(Gtk.VBox):
def add_box_from_journal_image(self, image_file_name):
posi = len(self.boxs) - 1
- num_foto = posi - (posi / 4) * 4
box = ComicBox(self, image_file_name, posi + 1)
reng = int(posi / 2)
column = posi - (reng * 2)
diff --git a/persistencia.py b/persistencia.py
index 11034dc..a11e66d 100644
--- a/persistencia.py
+++ b/persistencia.py
@@ -1,8 +1,6 @@
import os
import simplejson
-from gi.repository import GObject
-
import globos
from sugar3.activity import activity
import zipfile
@@ -68,7 +66,7 @@ class Persistence:
globoData['text_color'] = globo.texto.color
globoData['text_font_description'] = \
- globo.texto.font_description
+ globo.texto.font_description
boxData['globes'].append(globoData)
pageData['boxs'].append(boxData)
@@ -86,11 +84,12 @@ class Persistence:
print 'file_name', file_name
z = zipfile.ZipFile(file_name, 'w')
- z.write(os.path.join(instance_path, data_file_name).encode('ascii',
- 'ignore'), data_file_name.encode('ascii', 'ignore'))
+ z.write(os.path.join(instance_path, data_file_name).encode(
+ 'ascii', 'ignore'), data_file_name.encode('ascii', 'ignore'))
for box in page.boxs:
if (box.image_name != ''):
- z.write(os.path.join(instance_path,
+ z.write(os.path.join(
+ instance_path,
box.image_name).encode('ascii', 'ignore'),
box.image_name.encode('ascii', 'ignore'))
z.close()
@@ -141,13 +140,14 @@ class Persistence:
globo = None
if (tipo_globo == 'GLOBE'):
globo = globos.Globo(box, x=globo_x, y=globo_y,
- modo=globo_modo, direccion=globo_direccion)
+ modo=globo_modo,
+ direccion=globo_direccion)
elif (tipo_globo == 'CLOUD'):
globo = globos.Nube(box, x=globo_x, y=globo_y,
- direccion=globo_direccion)
+ direccion=globo_direccion)
elif (tipo_globo == 'EXCLAMATION'):
globo = globos.Grito(box, x=globo_x, y=globo_y,
- direccion=globo_direccion)
+ direccion=globo_direccion)
elif (tipo_globo == 'RECTANGLE'):
globo = globos.Rectangulo(box, x=globo_x, y=globo_y)
elif (tipo_globo == 'IMAGE'):
@@ -163,7 +163,7 @@ class Persistence:
if (tipo_globo != 'RECTANGLE'):
globo.punto = [globoData['point_0'],
- globoData['point_1']]
+ globoData['point_1']]
globo.x, globo.y = globoData['x'], globoData['y']
@@ -172,7 +172,7 @@ class Persistence:
globo.texto.alto = globoData['text_height']
globo.texto.color = globoData['text_color']
globo.texto.set_font_description(
- globoData['text_font_description'])
+ globoData['text_font_description'])
globo.texto.set_text(globoData['text_text'])
box.globos.append(globo)
diff --git a/toolbar.py b/toolbar.py
index 5ff28cd..c37be74 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -23,10 +23,8 @@ import os
import time
# Gtk3
from gi.repository import Gtk, Gdk
-from sugar3.graphics.icon import Icon
from sugar3.graphics.toolbutton import ToolButton
from sugar3.graphics.toggletoolbutton import ToggleToolButton
-from sugar3.graphics.combobox import ComboBox
from sugar3.graphics.toolcombobox import ToolComboBox
from sugar3.graphics.objectchooser import ObjectChooser
from sugar3.graphics.palettemenu import PaletteMenuItem
@@ -360,7 +358,8 @@ class TextToolbar(Gtk.Toolbar):
# color
self._text_color.set_color(Gdk.Color(*globeText.color))
# font size
- logging.error('Setting font size from globe %s %s', globeText.font_size, globeText.font_size.__class__)
+ logging.error('Setting font size from globe %s %s',
+ globeText.font_size, globeText.font_size.__class__)
self._font_size_combo.handler_block(self._font_size_changed_id)
self._font_size_combo.set_font_size(int(globeText.font_size))
self._font_size_combo.handler_unblock(self._font_size_changed_id)