2008-02-22 Raphael Ackermann <raphael.ackermann@gmail.com>
* various (294 files) pep8 doc fixes & pylint fixes svn: r10103
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provides the event view.
|
||||
Provide the event view.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -109,13 +109,13 @@ class EventView(PageView.ListView):
|
||||
|
||||
def get_bookmarks(self):
|
||||
"""
|
||||
Returns the bookmark object
|
||||
Return the bookmark object
|
||||
"""
|
||||
return self.dbstate.db.get_event_bookmarks()
|
||||
|
||||
def drag_info(self):
|
||||
"""
|
||||
Indicates that the drag type is an EVENT
|
||||
Indicate that the drag type is an EVENT
|
||||
"""
|
||||
return DdTargets.EVENT
|
||||
|
||||
|
@@ -622,7 +622,7 @@ class GrampletView(PageView.PageView):
|
||||
|
||||
def __init__(self, dbstate, uistate):
|
||||
"""
|
||||
Creates a GrampletView, with the current dbstate and uistate
|
||||
Create a GrampletView, with the current dbstate and uistate
|
||||
"""
|
||||
PageView.PageView.__init__(self, _('Gramplets'), dbstate, uistate)
|
||||
self._popup_xy = None
|
||||
@@ -1038,7 +1038,7 @@ class GrampletView(PageView.PageView):
|
||||
|
||||
def get_stock(self):
|
||||
"""
|
||||
Returns image associated with the view, which is used for the
|
||||
Return image associated with the view, which is used for the
|
||||
icon for the button.
|
||||
"""
|
||||
return 'gramps-gramplet'
|
||||
|
@@ -18,7 +18,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
# $Id:MapView.py 9912 2008-01-22 09:17:46Z acraphae $
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -142,7 +142,7 @@ class GuideMap(gtk.DrawingArea):
|
||||
gtk.gdk.INTERP_BILINEAR)
|
||||
gc.collect()
|
||||
|
||||
def map_to_screen( self, x,y,w=None,h=None):
|
||||
def map_to_screen( self, x,y,w=None, h=None):
|
||||
px = int((float(x) + 180.0) / 360.0 * self.backbuf.get_width())
|
||||
py = int((90-float(y)) / 180.0 * self.backbuf.get_height())
|
||||
if w and h:
|
||||
@@ -197,7 +197,7 @@ class MapTile:
|
||||
print "Source-Map origin: %f x %f, %f, %f" % (self.map_x,self.map_y,self.map_width,self.map_height)
|
||||
print "Source-Map pixels: %f x %f" % (self.map_pixel_width,self.map_pixel_height)
|
||||
print "Source-Map scale: %f" % self.source_scale
|
||||
print "Target origin: %f x %f, %f, %f" % (x,y,w,h)
|
||||
print "Target origin: %f x %f, %f, %f" % (x,y,w, h)
|
||||
print "Target scale: %f" % target_scale
|
||||
print "Target crop: %f x %f, %f x %f" % (xoffset,yoffset,xmax,ymax)
|
||||
print "Origin of crop: %f x %f" % (self.scaled_map_x,self.scaled_map_y)
|
||||
@@ -412,16 +412,16 @@ class ZoomMap( gtk.DrawingArea):
|
||||
|
||||
def motion_notify_event_cb(self,widget,event):
|
||||
self.textlayout.set_text( "Position: %03.0f,%03.0f pixel" % (event.x,event.y))
|
||||
(w,h) = self.textlayout.get_pixel_size()
|
||||
(w, h) = self.textlayout.get_pixel_size()
|
||||
self.gc.set_foreground( self.get_colormap().alloc_color("white"))
|
||||
self.window.draw_rectangle( self.gc, True, 10,50,w,h)
|
||||
self.window.draw_rectangle( self.gc, True, 10,50,w, h)
|
||||
self.gc.set_foreground( self.get_colormap().alloc_color("red"))
|
||||
self.window.draw_layout( self.gc, 10, 50, self.textlayout)
|
||||
(lon,lat) = self.screen_to_map(event.x,event.y)
|
||||
self.textlayout.set_text( "Position: %03.0f,%03.0f degree" % (lon,lat))
|
||||
(w,h) = self.textlayout.get_pixel_size()
|
||||
(w, h) = self.textlayout.get_pixel_size()
|
||||
self.gc.set_foreground( self.get_colormap().alloc_color("white"))
|
||||
self.window.draw_rectangle( self.gc, True, 10,70,w,h)
|
||||
self.window.draw_rectangle( self.gc, True, 10,70,w, h)
|
||||
self.gc.set_foreground( self.get_colormap().alloc_color("red"))
|
||||
self.window.draw_layout( self.gc, 10, 70, self.textlayout)
|
||||
|
||||
@@ -643,7 +643,7 @@ class MapView(PageView.PageView):
|
||||
|
||||
def get_stock(self):
|
||||
"""
|
||||
Returns the name of the stock icon to use for the display.
|
||||
Return the name of the stock icon to use for the display.
|
||||
This assumes that this icon has already been registered with
|
||||
GNOME as a stock icon.
|
||||
"""
|
||||
@@ -812,7 +812,7 @@ class MapView(PageView.PageView):
|
||||
db.connect('place-rebuild',self.rebuild_places)
|
||||
db.connect('place-update',self.rebuild_places)
|
||||
|
||||
def rebuild_places(self,handle_list=None):
|
||||
def rebuild_places(self, handle_list=None):
|
||||
d = glob_loc_data
|
||||
try:
|
||||
d = d + self.get_xearth_markers()
|
||||
@@ -831,14 +831,14 @@ class MapView(PageView.PageView):
|
||||
model.get_value(iter,2))
|
||||
break
|
||||
|
||||
def zoom_in_cb(self,obj):
|
||||
def zoom_in_cb(self, obj):
|
||||
self.zoom_map.zoom_in()
|
||||
|
||||
def zoom_out_cb(self,obj):
|
||||
def zoom_out_cb(self, obj):
|
||||
self.zoom_map.zoom_out()
|
||||
|
||||
def zoom_100_cb(self,obj):
|
||||
def zoom_100_cb(self, obj):
|
||||
self.zoom_map.zoom_normal()
|
||||
|
||||
def zoom_fit_cb(self,obj):
|
||||
def zoom_fit_cb(self, obj):
|
||||
self.zoom_map.zoom_fit()
|
||||
|
@@ -69,7 +69,7 @@ from DdTargets import DdTargets
|
||||
#-------------------------------------------------------------------------
|
||||
class MediaView(PageView.ListView):
|
||||
"""
|
||||
Provides the Media View interface on the GRAMPS main window. This allows
|
||||
Provide the Media View interface on the GRAMPS main window. This allows
|
||||
people to manage all media items in their database. This is very similar
|
||||
to the other list based views, with the exeception that it also has a
|
||||
thumbnail image at the top of the view that must be updated when the
|
||||
@@ -118,7 +118,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def _set_dnd(self):
|
||||
"""
|
||||
Sets up drag-n-drop. The source and destionation are set by calling .target()
|
||||
Set up drag-n-drop. The source and destionation are set by calling .target()
|
||||
on the _DND_TYPE. Obviously, this means that there must be a _DND_TYPE
|
||||
variable defined that points to an entry in DdTargets.
|
||||
"""
|
||||
@@ -155,7 +155,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def drag_info(self):
|
||||
"""
|
||||
Returns the type of DND targetst that this view will accept. For Media
|
||||
Return the type of DND targetst that this view will accept. For Media
|
||||
View, we will accept media objects.
|
||||
"""
|
||||
return DdTargets.MEDIAOBJ
|
||||
@@ -198,7 +198,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def get_bookmarks(self):
|
||||
"""
|
||||
Returns the booksmarks associated with this view
|
||||
Return the booksmarks associated with this view
|
||||
"""
|
||||
return self.dbstate.db.get_media_bookmarks()
|
||||
|
||||
@@ -259,7 +259,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def column_order(self):
|
||||
"""
|
||||
Gets the column order from the database
|
||||
Get the column order from the database
|
||||
"""
|
||||
return self.dbstate.db.get_media_column_order()
|
||||
|
||||
@@ -333,7 +333,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def ui_definition(self):
|
||||
"""
|
||||
Returns the UIManager XML description of the menus
|
||||
Return the UIManager XML description of the menus
|
||||
"""
|
||||
return '''<ui>
|
||||
<menubar name="MenuBar">
|
||||
@@ -384,7 +384,7 @@ class MediaView(PageView.ListView):
|
||||
|
||||
def remove(self, obj):
|
||||
"""
|
||||
Removes the selected object from the database after getting
|
||||
Remove the selected object from the database after getting
|
||||
user verification.
|
||||
"""
|
||||
handle = self.first_selected()
|
||||
|
@@ -102,13 +102,13 @@ class NoteView(PageView.ListView):
|
||||
|
||||
def get_bookmarks(self):
|
||||
"""
|
||||
Returns the bookmark object
|
||||
Return the bookmark object
|
||||
"""
|
||||
return self.dbstate.db.get_note_bookmarks()
|
||||
|
||||
def drag_info(self):
|
||||
"""
|
||||
Indicates that the drag type is an EVENT
|
||||
Indicate that the drag type is an EVENT
|
||||
"""
|
||||
return DdTargets.NOTE_LINK
|
||||
|
||||
|
@@ -506,7 +506,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
|
||||
def get_stock(self):
|
||||
"""
|
||||
Returns the name of the stock icon to use for the display.
|
||||
Return the name of the stock icon to use for the display.
|
||||
This assumes that this icon has already been registered with
|
||||
GNOME as a stock icon.
|
||||
"""
|
||||
@@ -630,7 +630,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
self.bookmarks.redraw()
|
||||
self.build_tree()
|
||||
|
||||
def goto_active_person(self,handle=None):
|
||||
def goto_active_person(self, handle=None):
|
||||
self.dirty = True
|
||||
if handle:
|
||||
self.rebuild_trees(handle)
|
||||
@@ -1083,12 +1083,12 @@ class PedigreeView(PageView.PersonNavView):
|
||||
area.window.draw_line(gc, alloc.width/2, alloc.height/2, alloc.width/2,alloc.height-gap)
|
||||
area.window.draw_line(gc, alloc.width/2, alloc.height-gap, alloc.width,alloc.height-gap)
|
||||
|
||||
def home(self,obj):
|
||||
def home(self, obj):
|
||||
defperson = self.dbstate.db.get_default_person()
|
||||
if defperson:
|
||||
self.dbstate.change_active_person(defperson)
|
||||
|
||||
def edit_person_cb(self,obj,person_handle):
|
||||
def edit_person_cb(self, obj,person_handle):
|
||||
person = self.dbstate.db.get_person_from_handle(person_handle)
|
||||
if person:
|
||||
try:
|
||||
@@ -1098,7 +1098,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
return True
|
||||
return False
|
||||
|
||||
def edit_family_cb(self,obj,family_handle):
|
||||
def edit_family_cb(self, obj,family_handle):
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
if family:
|
||||
try:
|
||||
@@ -1108,7 +1108,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
return True
|
||||
return False
|
||||
|
||||
def add_parents_cb(self,obj,person_handle, family_handle):
|
||||
def add_parents_cb(self, obj,person_handle, family_handle):
|
||||
if family_handle: # one parent already exists -> Edit current family
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
else: # no parents -> create new family
|
||||
@@ -1121,7 +1121,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def copy_person_to_clipboard_cb(self,obj,person_handle):
|
||||
def copy_person_to_clipboard_cb(self, obj,person_handle):
|
||||
"""Renders the person data into some lines of text and puts that into the clipboard"""
|
||||
person = self.dbstate.db.get_person_from_handle(person_handle)
|
||||
if person:
|
||||
@@ -1130,7 +1130,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
return True
|
||||
return False
|
||||
|
||||
def copy_family_to_clipboard_cb(self,obj,family_handle):
|
||||
def copy_family_to_clipboard_cb(self, obj,family_handle):
|
||||
"""Renders the family data into some lines of text and puts that into the clipboard"""
|
||||
family = self.dbstate.db.get_family_from_handle(family_handle)
|
||||
if family:
|
||||
@@ -1139,41 +1139,41 @@ class PedigreeView(PageView.PersonNavView):
|
||||
return True
|
||||
return False
|
||||
|
||||
def on_show_option_menu_cb(self,obj,data=None):
|
||||
def on_show_option_menu_cb(self, obj,data=None):
|
||||
myMenu = gtk.Menu()
|
||||
self.add_nav_portion_to_menu(myMenu)
|
||||
self.add_settings_to_menu(myMenu)
|
||||
myMenu.popup(None,None,None,0,0)
|
||||
return(True);
|
||||
|
||||
def bg_button_press_cb(self,obj,event):
|
||||
def bg_button_press_cb(self, obj,event):
|
||||
if event.button != 1:
|
||||
self.on_show_option_menu_cb(obj)
|
||||
return True
|
||||
return False
|
||||
|
||||
def person_button_press_cb(self,obj,event,person_handle):
|
||||
def person_button_press_cb(self, obj,event,person_handle):
|
||||
if event.button==1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||
self.edit_person_cb( obj, person_handle)
|
||||
elif event.button!=1:
|
||||
self.build_full_nav_menu_cb(obj,event,person_handle)
|
||||
return True
|
||||
|
||||
def relation_button_press_cb(self,obj,event,family_handle):
|
||||
def relation_button_press_cb(self, obj,event,family_handle):
|
||||
if event.button==1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||
self.edit_family_cb( obj, family_handle)
|
||||
elif event.button!=1:
|
||||
self.build_relation_nav_menu_cb(obj,event,family_handle)
|
||||
return True
|
||||
|
||||
def missing_parent_button_press_cb(self,obj,event,person_handle,family_handle):
|
||||
def missing_parent_button_press_cb(self, obj,event,person_handle,family_handle):
|
||||
if event.button==1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||
self.add_parents_cb(obj,person_handle,family_handle)
|
||||
elif event.button!=1:
|
||||
self.build_missing_parent_nav_menu_cb(obj,event,person_handle,family_handle)
|
||||
return True
|
||||
|
||||
def on_show_child_menu(self,obj):
|
||||
def on_show_child_menu(self, obj):
|
||||
"""User clicked button to move to child of active person"""
|
||||
|
||||
if self.dbstate.active:
|
||||
@@ -1210,7 +1210,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def on_childmenu_changed(self,obj,person_handle):
|
||||
def on_childmenu_changed(self, obj,person_handle):
|
||||
"""Callback for the pulldown menu selection, changing to the person
|
||||
attached with menu item."""
|
||||
self.dbstate.change_active_handle(person_handle)
|
||||
@@ -1390,7 +1390,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
entry = gtk.ImageMenuItem(_("%d generations") % n)
|
||||
if self.force_size == n:
|
||||
entry.set_image(current_size_image)
|
||||
entry.connect("activate", self.change_force_size_cb,n)
|
||||
entry.connect("activate", self.change_force_size_cb, n)
|
||||
entry.show()
|
||||
size_menu.append(entry)
|
||||
|
||||
@@ -1398,7 +1398,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
item.show()
|
||||
menu.append(item)
|
||||
|
||||
def build_missing_parent_nav_menu_cb(self,obj,event,person_handle,family_handle):
|
||||
def build_missing_parent_nav_menu_cb(self, obj,event,person_handle,family_handle):
|
||||
menu = gtk.Menu()
|
||||
menu.set_title(_('People Menu'))
|
||||
|
||||
@@ -1413,7 +1413,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
menu.popup(None,None,None,event.button,event.time)
|
||||
return 1
|
||||
|
||||
def build_full_nav_menu_cb(self,obj,event,person_handle):
|
||||
def build_full_nav_menu_cb(self, obj,event,person_handle):
|
||||
"""
|
||||
Builds the full menu (including Siblings, Spouses, Children,
|
||||
and Parents) with navigation.
|
||||
@@ -1645,7 +1645,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
menu.popup(None,None,None,event.button,event.time)
|
||||
return 1
|
||||
|
||||
def build_relation_nav_menu_cb(self,obj,event,family_handle):
|
||||
def build_relation_nav_menu_cb(self, obj,event,family_handle):
|
||||
"""
|
||||
Builds the menu for a parents-child relation line.
|
||||
"""
|
||||
@@ -1686,7 +1686,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
#-------------------------------------------------------------------------
|
||||
def find_children(db,p):
|
||||
"""
|
||||
Returns the list of all children's IDs for a person.
|
||||
Return the list of all children's IDs for a person.
|
||||
"""
|
||||
childlist = []
|
||||
for family_handle in p.get_family_handle_list():
|
||||
@@ -1702,7 +1702,7 @@ def find_children(db,p):
|
||||
#-------------------------------------------------------------------------
|
||||
def find_parents(db,p):
|
||||
"""
|
||||
Returns the unique list of all parents' IDs for a person.
|
||||
Return the unique list of all parents' IDs for a person.
|
||||
"""
|
||||
parentlist = []
|
||||
for f in p.get_parent_family_handle_list():
|
||||
|
@@ -82,7 +82,7 @@ class PersonView(PageView.PersonNavView):
|
||||
|
||||
def __init__(self, dbstate, uistate):
|
||||
"""
|
||||
Creates the new PersonView interface, with the current dbstate and uistate
|
||||
Create the new PersonView interface, with the current dbstate and uistate
|
||||
"""
|
||||
PageView.PersonNavView.__init__(self, _('People'), dbstate, uistate)
|
||||
|
||||
@@ -247,7 +247,7 @@ class PersonView(PageView.PersonNavView):
|
||||
|
||||
def get_stock(self):
|
||||
"""
|
||||
Returns the name of the stock icon to use for the display.
|
||||
Return the name of the stock icon to use for the display.
|
||||
This assumes that this icon has already been registered with
|
||||
GNOME as a stock icon.
|
||||
"""
|
||||
@@ -514,7 +514,7 @@ class PersonView(PageView.PersonNavView):
|
||||
|
||||
def build_tree(self, skip=[]):
|
||||
"""
|
||||
Creates a new PeopleModel instance. Essentially creates a complete
|
||||
Create a new PeopleModel instance. Essentially creates a complete
|
||||
rebuild of the data. We need to temporarily store the active person,
|
||||
since it can change when rows are unselected when the model is set.
|
||||
"""
|
||||
|
@@ -221,7 +221,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
|
||||
def get_stock(self):
|
||||
"""
|
||||
Returns the name of the stock icon to use for the display.
|
||||
Return the name of the stock icon to use for the display.
|
||||
This assumes that this icon has already been registered with
|
||||
GNOME as a stock icon.
|
||||
"""
|
||||
@@ -1017,7 +1017,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
return value
|
||||
|
||||
def check_collapsed(self, person, handle):
|
||||
""" Returns true if collapsed. """
|
||||
""" Return true if collapsed. """
|
||||
return (handle in self.collapsed_items.get(person.handle, []))
|
||||
|
||||
def expand_collapse_press(self, obj, event, pair):
|
||||
@@ -1436,7 +1436,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
#-------------------------------------------------------------------------
|
||||
def has_children(db,p):
|
||||
"""
|
||||
Returns if a person has children.
|
||||
Return if a person has children.
|
||||
"""
|
||||
for family_handle in p.get_family_handle_list():
|
||||
family = db.get_family_from_handle(family_handle)
|
||||
|
@@ -57,6 +57,6 @@ except:
|
||||
|
||||
def get_views():
|
||||
"""
|
||||
Returns a list of PageView instances, in order
|
||||
Return a list of PageView instances, in order
|
||||
"""
|
||||
return DATA_VIEWS
|
||||
|
Reference in New Issue
Block a user