mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
flake8
This commit is contained in:
parent
cb646c3155
commit
8e89dd203c
2 changed files with 82 additions and 94 deletions
|
@ -2,7 +2,7 @@
|
|||
# -*- mode: python; coding: koi8-r; -*-
|
||||
|
||||
import os
|
||||
import gtk, gobject
|
||||
import gtk
|
||||
|
||||
imdir = 'images'
|
||||
imtype = 'png'
|
||||
|
@ -15,6 +15,8 @@ if not os.path.exists(imdir):
|
|||
os.mkdir(imdir)
|
||||
|
||||
gc = None
|
||||
|
||||
|
||||
def draw_rect():
|
||||
global gc
|
||||
if gc is None:
|
||||
|
@ -39,14 +41,15 @@ def save_image(fn, w, h, x=0, y=0):
|
|||
|
||||
|
||||
done = False
|
||||
|
||||
|
||||
def save_callback(*args):
|
||||
global done
|
||||
|
||||
|
||||
|
||||
if done: return
|
||||
if done:
|
||||
return
|
||||
done = True
|
||||
print 'create images'
|
||||
print('create images')
|
||||
|
||||
style = drawing_area.get_style()
|
||||
draw_rect()
|
||||
|
@ -60,7 +63,6 @@ def save_callback(*args):
|
|||
drawing_area, "frame", 0, w, 0)
|
||||
save_image('sep-h', w, 2)
|
||||
|
||||
|
||||
# tree
|
||||
w, h = 32, 32
|
||||
w, h = 24, 24
|
||||
|
@ -74,7 +76,6 @@ def save_callback(*args):
|
|||
None, drawing_area, "stepper", 0, 0, w, h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# sizegrip
|
||||
w, h = 16, 16
|
||||
fn = 'sizegrip'
|
||||
|
@ -83,7 +84,6 @@ def save_callback(*args):
|
|||
gtk.gdk.WINDOW_EDGE_SOUTH_EAST, 0, 0, w, h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# progress
|
||||
w, h = 37+3, 16+3
|
||||
progress_style = progress.get_style()
|
||||
|
@ -93,7 +93,6 @@ def save_callback(*args):
|
|||
None, progress, "bar", 0, 0, w, h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# button
|
||||
w, h = 32, 32
|
||||
w, h = 28, 28
|
||||
|
@ -111,7 +110,6 @@ def save_callback(*args):
|
|||
None, togglebutton, "buttondefault", 0, 0, w, h)
|
||||
save_image("button-pa", w, h)
|
||||
|
||||
|
||||
# toolbar
|
||||
w, h = 16, 16
|
||||
w, h = 24, 24
|
||||
|
@ -135,12 +133,11 @@ def save_callback(*args):
|
|||
None, togglebutton, "buttondefault", 0, 0, w, h)
|
||||
save_image("toolbutton-pa", w, h)
|
||||
|
||||
|
||||
# slider
|
||||
msl = hscroll.style_get_property("min_slider_length")
|
||||
msl = 20
|
||||
sw = hscroll.style_get_property("slider_width")
|
||||
print '>>', msl, sw
|
||||
print('>>', msl, sw)
|
||||
for t, w, h, state, orient in (
|
||||
('hn', msl, sw, gtk.STATE_NORMAL, gtk.ORIENTATION_HORIZONTAL),
|
||||
('ha', msl, sw, gtk.STATE_PRELIGHT, gtk.ORIENTATION_HORIZONTAL),
|
||||
|
@ -155,7 +152,8 @@ def save_callback(*args):
|
|||
fn = 'sbthumb-'+t
|
||||
if 0:
|
||||
style.paint_slider(drawing_area.window, state, gtk.SHADOW_OUT,
|
||||
None, drawing_area, "slider", 0,0, w,h, orient)
|
||||
None, drawing_area, "slider",
|
||||
0, 0, w, h, orient)
|
||||
else:
|
||||
if orient == gtk.ORIENTATION_VERTICAL:
|
||||
w, h = h, w
|
||||
|
@ -163,7 +161,6 @@ def save_callback(*args):
|
|||
None, drawing_area, "stepper", 0, 0, w, h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
msl = hscroll.style_get_property("min_slider_length")
|
||||
sw = hscroll.style_get_property("slider_width")
|
||||
# scale
|
||||
|
@ -190,7 +187,6 @@ def save_callback(*args):
|
|||
None, scale, "trough", 0, 0, w, h)
|
||||
save_image(fn, w, h)
|
||||
|
||||
|
||||
# arrow
|
||||
w = h = hscroll.style_get_property("stepper_size")
|
||||
# w = h = 15
|
||||
|
@ -247,7 +243,6 @@ def save_callback(*args):
|
|||
x+arrow_x, y+arrow_y, arrow_width, arrow_height)
|
||||
save_image(fn, w, h, x, y)
|
||||
|
||||
|
||||
# combobox
|
||||
w, h = w, 24
|
||||
w, h = 16, 24
|
||||
|
@ -294,7 +289,6 @@ def save_callback(*args):
|
|||
None, drawing_area, "entry", 0, 0, w+2, h)
|
||||
save_image('combo-n', w, h)
|
||||
|
||||
|
||||
# checkbutton
|
||||
# define INDICATOR_SIZE 13
|
||||
# define INDICATOR_SPACING 2
|
||||
|
@ -311,17 +305,16 @@ def save_callback(*args):
|
|||
("check-dc", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
("check-du", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
## style.paint_flat_box(drawing_area.window,
|
||||
## gtk.STATE_PRELIGHT,
|
||||
## gtk.SHADOW_ETCHED_OUT,
|
||||
## gtk.gdk.Rectangle(0,0,w,h), drawing_area,
|
||||
## "checkbutton", 0,0, w,h)
|
||||
# style.paint_flat_box(drawing_area.window,
|
||||
# gtk.STATE_PRELIGHT,
|
||||
# gtk.SHADOW_ETCHED_OUT,
|
||||
# gtk.gdk.Rectangle(0, 0,w, h), drawing_area,
|
||||
# "checkbutton", 0, 0, w, h)
|
||||
|
||||
style.paint_check(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "checkbutton", x, y, w, h)
|
||||
save_image(fn, w+2*x, h+2*y)
|
||||
|
||||
|
||||
# radiobutton
|
||||
for fn, state, shadow in (
|
||||
("radio-nc", gtk.STATE_NORMAL, gtk.SHADOW_IN),
|
||||
|
@ -333,16 +326,15 @@ def save_callback(*args):
|
|||
("radio-dc", gtk.STATE_INSENSITIVE, gtk.SHADOW_IN),
|
||||
("radio-du", gtk.STATE_INSENSITIVE, gtk.SHADOW_OUT),
|
||||
):
|
||||
## style.paint_flat_box(drawing_area.window,
|
||||
## gtk.STATE_PRELIGHT,
|
||||
## gtk.SHADOW_ETCHED_OUT,
|
||||
## gtk.gdk.Rectangle(0,0,w,h), drawing_area,
|
||||
## "checkbutton", 0,0, w,h)
|
||||
# style.paint_flat_box(drawing_area.window,
|
||||
# gtk.STATE_PRELIGHT,
|
||||
# gtk.SHADOW_ETCHED_OUT,
|
||||
# gtk.gdk.Rectangle(0, 0,w, h), drawing_area,
|
||||
# "checkbutton", 0, 0, w, h)
|
||||
style.paint_option(drawing_area.window, state, shadow,
|
||||
None, drawing_area, "radiobutton", x, y, w, h)
|
||||
save_image(fn, w+2*x, h+2*y)
|
||||
|
||||
|
||||
# notebook
|
||||
w, h = 28, 22
|
||||
state = gtk.STATE_NORMAL
|
||||
|
@ -352,9 +344,9 @@ def save_callback(*args):
|
|||
("tab-n", 0, gtk.STATE_NORMAL),
|
||||
("tab-a", 2, gtk.STATE_ACTIVE),
|
||||
):
|
||||
## style.paint_box_gap(drawing_area.window, state, shadow,
|
||||
## gtk.gdk.Rectangle(0,0,w,gap_h), drawing_area,
|
||||
## "notebook", 0,0, w,gap_h, gtk.POS_TOP, 0, w)
|
||||
# style.paint_box_gap(drawing_area.window, state, shadow,
|
||||
# gtk.gdk.Rectangle(0, 0,w,gap_h), drawing_area,
|
||||
# "notebook", 0, 0, w,gap_h, gtk.POS_TOP, 0, w)
|
||||
y = gap_h
|
||||
hh = h - y
|
||||
style.paint_extension(drawing_area.window, state, gtk.SHADOW_OUT,
|
||||
|
@ -362,9 +354,7 @@ def save_callback(*args):
|
|||
0, y, w, hh, gtk.POS_BOTTOM)
|
||||
save_image(fn, w, h+2)
|
||||
|
||||
|
||||
|
||||
print 'done'
|
||||
print('done')
|
||||
|
||||
gtk.main_quit()
|
||||
|
||||
|
@ -375,6 +365,7 @@ def pack(w, row, col):
|
|||
gtk.EXPAND | gtk.FILL, gtk.EXPAND | gtk.FILL,
|
||||
0, 0)
|
||||
|
||||
|
||||
win = gtk.Window()
|
||||
win.connect("destroy", gtk.main_quit)
|
||||
|
||||
|
@ -437,6 +428,3 @@ win.show_all()
|
|||
# drawing_area.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('red'))
|
||||
|
||||
gtk.main()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ my %skip =
|
|||
|
||||
# my $cmd = shell_quote( 'flake8', '.' );
|
||||
my $cmd = shell_quote( 'flake8',
|
||||
sort { $a cmp $b } grep { not exists $skip{$_} } glob('./*.py ./scripts/*.py ./tests/board_gen/*.py ./pysollib/*.py ./pysollib/*/{*/*.py,*.py}') );
|
||||
sort { $a cmp $b } grep { not exists $skip{$_} } glob('./*.py ./data/*/*/*.py ./scripts/*.py ./tests/board_gen/*.py ./pysollib/*.py ./pysollib/*/{*/*.py,*.py}') );
|
||||
|
||||
# diag("<$cmd>");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue