Pychecker cleanup
svn: r885
This commit is contained in:
parent
8eb6c066fc
commit
35a5c37d74
@ -21,14 +21,6 @@
|
|||||||
The AddSpouse module provides the AddSpouse class that allows the user to
|
The AddSpouse module provides the AddSpouse class that allows the user to
|
||||||
add a new spouse to the active person.
|
add a new spouse to the active person.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Standard python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
import string
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# internationalization
|
# internationalization
|
||||||
|
@ -73,6 +73,8 @@ class AutoCompBase:
|
|||||||
"""
|
"""
|
||||||
entry.select_region(0, 0)
|
entry.select_region(0, 0)
|
||||||
|
|
||||||
|
def timer_callback(self,entry):
|
||||||
|
pass
|
||||||
|
|
||||||
class AutoCombo(AutoCompBase):
|
class AutoCombo(AutoCompBase):
|
||||||
"""
|
"""
|
||||||
|
@ -218,9 +218,6 @@ class ChooseParents:
|
|||||||
mother_rel = const.childRelations[self.mother_rel.get_text()]
|
mother_rel = const.childRelations[self.mother_rel.get_text()]
|
||||||
father_rel = const.childRelations[self.father_rel.get_text()]
|
father_rel = const.childRelations[self.father_rel.get_text()]
|
||||||
|
|
||||||
msel = self.mother_list.selection
|
|
||||||
fsel = self.father_list.selection
|
|
||||||
|
|
||||||
if self.father or self.mother:
|
if self.father or self.mother:
|
||||||
if self.mother and not self.father:
|
if self.mother and not self.father:
|
||||||
if self.mother.getGender() == RelLib.Person.male:
|
if self.mother.getGender() == RelLib.Person.male:
|
||||||
@ -297,23 +294,3 @@ class ChooseParents:
|
|||||||
self.person.addAltFamily(family,mother_rel,father_rel)
|
self.person.addAltFamily(family,mother_rel,father_rel)
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
def add_parent_close(self,obj):
|
|
||||||
|
|
||||||
surname = self.xml.get_widget("surname").get_text()
|
|
||||||
given = self.xml.get_widget("given").get_text()
|
|
||||||
person = RelLib.Person()
|
|
||||||
self.db.addPerson(person)
|
|
||||||
name = person.getPrimaryName()
|
|
||||||
name.setSurname(surname)
|
|
||||||
name.setFirstName(given)
|
|
||||||
if self.xml.get_widget("male").get_active():
|
|
||||||
person.setGender(RelLib.Person.male)
|
|
||||||
self.father = person
|
|
||||||
else:
|
|
||||||
person.setGender(RelLib.Person.female)
|
|
||||||
self.mother = person
|
|
||||||
Utils.modified()
|
|
||||||
self.parent_relation_changed(self.prel)
|
|
||||||
Utils.destroy_passed_object(obj)
|
|
||||||
self.full_update()
|
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import gtk
|
|||||||
import const
|
import const
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
import intl
|
import intl
|
||||||
|
import VersionControl
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -116,12 +117,3 @@ class DbPrompter:
|
|||||||
def open_cancel_clicked(self,obj):
|
def open_cancel_clicked(self,obj):
|
||||||
gtk.mainquit()
|
gtk.mainquit()
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Start it all
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
if __name__ == '__main__':
|
|
||||||
Gramps(None)
|
|
||||||
gtk.mainloop()
|
|
||||||
|
@ -163,7 +163,6 @@ class FindPlace(FindBase):
|
|||||||
return
|
return
|
||||||
orow = self.row
|
orow = self.row
|
||||||
func()
|
func()
|
||||||
place = None
|
|
||||||
while self.row != orow:
|
while self.row != orow:
|
||||||
value = self.clist.get_row_data(self.row)
|
value = self.clist.get_row_data(self.row)
|
||||||
if value == None:
|
if value == None:
|
||||||
@ -204,7 +203,6 @@ class FindSource(FindBase):
|
|||||||
return
|
return
|
||||||
orow = self.row
|
orow = self.row
|
||||||
func()
|
func()
|
||||||
place = None
|
|
||||||
while self.row != orow:
|
while self.row != orow:
|
||||||
value = self.clist.get_row_data(self.row)
|
value = self.clist.get_row_data(self.row)
|
||||||
if value == None:
|
if value == None:
|
||||||
@ -245,7 +243,6 @@ class FindMedia(FindBase):
|
|||||||
return
|
return
|
||||||
orow = self.row
|
orow = self.row
|
||||||
func()
|
func()
|
||||||
place = None
|
|
||||||
while self.row != orow:
|
while self.row != orow:
|
||||||
value = self.clist.get_row_data(self.row)
|
value = self.clist.get_row_data(self.row)
|
||||||
if value == None:
|
if value == None:
|
||||||
|
@ -1014,7 +1014,7 @@ class TemplateParser(handler.ContentHandler):
|
|||||||
|
|
||||||
def startElement(self,tag,attrs):
|
def startElement(self,tag,attrs):
|
||||||
if tag == "template":
|
if tag == "template":
|
||||||
self.data[attrs['title']] = "%s/%s" % (path,attrs['file'])
|
self.data[attrs['title']] = "%s/%s" % (self.path,attrs['file'])
|
||||||
|
|
||||||
def characters(self, data):
|
def characters(self, data):
|
||||||
pass
|
pass
|
||||||
|
@ -57,10 +57,11 @@ _ = gettext
|
|||||||
# modified flag
|
# modified flag
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
_modifiedFlag = 0
|
_modifiedFlag = 0
|
||||||
_autotime_val = 1
|
_autotime_val = 1
|
||||||
_autosave_fun = None
|
_autosave_fun = None
|
||||||
_autosave_tim = None
|
_autosave_tim = None
|
||||||
|
_autosave_val = None
|
||||||
|
|
||||||
LISTOBJ = "s"
|
LISTOBJ = "s"
|
||||||
OBJECT = "o"
|
OBJECT = "o"
|
||||||
|
@ -88,9 +88,9 @@ startup = 1
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
progName = "gramps"
|
progName = "gramps"
|
||||||
version = "0.7.3pre"
|
version = "0.7.3-snap20020328"
|
||||||
copyright = "© 2001 Donald N. Allingham"
|
copyright = "© 2001 Donald N. Allingham"
|
||||||
authors = ["Donald N. Allingham", "David Hampton"]
|
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
|
||||||
comments = _("GRAMPS (Genealogical Research and Analysis Management Programming System) is a personal genealogy program.")
|
comments = _("GRAMPS (Genealogical Research and Analysis Management Programming System) is a personal genealogy program.")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -31,7 +31,6 @@ import base64
|
|||||||
|
|
||||||
from TextDoc import *
|
from TextDoc import *
|
||||||
from latin_utf8 import latin_to_utf8
|
from latin_utf8 import latin_to_utf8
|
||||||
import const
|
|
||||||
import string
|
import string
|
||||||
import Plugins
|
import Plugins
|
||||||
import ImgManip
|
import ImgManip
|
||||||
@ -94,8 +93,6 @@ class AbiWordDoc(TextDoc):
|
|||||||
self.f.write('<data>\n')
|
self.f.write('<data>\n')
|
||||||
for file_tuple in self.photo_list:
|
for file_tuple in self.photo_list:
|
||||||
file = file_tuple[0]
|
file = file_tuple[0]
|
||||||
width = file_tuple[1]
|
|
||||||
height = file_tuple[2]
|
|
||||||
base = "%s/%s_png" % (os.path.dirname(file),os.path.basename(file))
|
base = "%s/%s_png" % (os.path.dirname(file),os.path.basename(file))
|
||||||
tag = string.replace(base,'.','_')
|
tag = string.replace(base,'.','_')
|
||||||
|
|
||||||
@ -306,7 +303,6 @@ class AbiWordDoc(TextDoc):
|
|||||||
self.f.write("%6.4fin/%s" % (edge/2.54,t))
|
self.f.write("%6.4fin/%s" % (edge/2.54,t))
|
||||||
self.f.write('"')
|
self.f.write('"')
|
||||||
self.f.write('>')
|
self.f.write('>')
|
||||||
last = len(self.cdatalist)
|
|
||||||
for data in self.cdatalist:
|
for data in self.cdatalist:
|
||||||
self.f.write(data)
|
self.f.write(data)
|
||||||
self.f.write('</p>\n')
|
self.f.write('</p>\n')
|
||||||
|
@ -498,15 +498,14 @@ class OpenOfficeDoc(TextDoc):
|
|||||||
|
|
||||||
for file_tuple in self.photo_list:
|
for file_tuple in self.photo_list:
|
||||||
file = file_tuple[0]
|
file = file_tuple[0]
|
||||||
width = file_tuple[1]
|
|
||||||
height = file_tuple[2]
|
|
||||||
base = os.path.basename(file)
|
base = os.path.basename(file)
|
||||||
image_name = self.tempdir + os.sep + "Pictures" + os.sep + base
|
image_name = self.tempdir + os.sep + "Pictures" + os.sep + base
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(file,image_name)
|
shutil.copy(file,image_name)
|
||||||
except IOError,msg:
|
except IOError,msg:
|
||||||
GnomeErrorDialog(_("Error copying %s") + "\n" + msg)
|
import gnome.ui
|
||||||
|
gnome.ui.GnomeErrorDialog(_("Error copying %s") + "\n" + msg)
|
||||||
|
|
||||||
def _write_manifest(self):
|
def _write_manifest(self):
|
||||||
file = self.tempdir + os.sep + "META-INF" + os.sep + "manifest.xml"
|
file = self.tempdir + os.sep + "META-INF" + os.sep + "manifest.xml"
|
||||||
|
@ -157,32 +157,4 @@ class PdfDrawDoc(DrawDoc):
|
|||||||
self.f.drawString(start_x,start_y,text)
|
self.f.drawString(start_x,start_y,text)
|
||||||
self.f.restoreState()
|
self.f.restoreState()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
s = PaperStyle("Junk",27.94,21.59)
|
|
||||||
x = PdfDrawDoc(s,PAPER_PORTRAIT)
|
|
||||||
f = FontStyle()
|
|
||||||
f.set_type_face(FONT_SANS_SERIF)
|
|
||||||
f.set_size(14)
|
|
||||||
p = ParagraphStyle()
|
|
||||||
p.set_font(f)
|
|
||||||
x.add_paragraph_style("mytest",p)
|
|
||||||
|
|
||||||
g = GraphicsStyle()
|
|
||||||
g.set_width(4)
|
|
||||||
g.set_height(2)
|
|
||||||
|
|
||||||
g.set_color((0xff,0xcc,0xff))
|
|
||||||
g.set_paragraph_style("mytest")
|
|
||||||
g.set_shadow(1)
|
|
||||||
x.add_draw_style("mybox",g)
|
|
||||||
|
|
||||||
x.open("test")
|
|
||||||
x.start_page()
|
|
||||||
x.draw_box("mybox","Hello\nThis is Fun",4,4)
|
|
||||||
x.end_page()
|
|
||||||
x.close()
|
|
||||||
|
|
||||||
Plugins.register_draw_doc(_("PDF"),PdfDrawDoc);
|
Plugins.register_draw_doc(_("PDF"),PdfDrawDoc);
|
||||||
|
@ -317,14 +317,11 @@ class RTFDoc(TextDoc):
|
|||||||
#
|
#
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def add_photo(self,name,pos,x_cm,y_cm):
|
def add_photo(self,name,pos,x_cm,y_cm):
|
||||||
if no_pil:
|
|
||||||
return
|
|
||||||
|
|
||||||
im = ImgManip.ImgManip(name)
|
im = ImgManip.ImgManip(name)
|
||||||
nx,ny = im.size()
|
nx,ny = im.size()
|
||||||
buf = im.jpg_data()
|
buf = im.jpg_data()
|
||||||
|
|
||||||
ratio = float(x_cm)*float(y)/(float(y_cm)*float(x))
|
ratio = float(x_cm)*float(ny)/(float(y_cm)*float(nx))
|
||||||
|
|
||||||
if ratio < 1:
|
if ratio < 1:
|
||||||
act_width = x_cm
|
act_width = x_cm
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import tempfile
|
|
||||||
import string
|
import string
|
||||||
import Plugins
|
import Plugins
|
||||||
import intl
|
import intl
|
||||||
|
@ -222,13 +222,9 @@ class DescendantReport:
|
|||||||
#
|
#
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def calc(self):
|
def calc(self):
|
||||||
width = 0
|
|
||||||
|
|
||||||
self.height = self.lines*pt2cm(1.25*self.font.get_size())
|
self.height = self.lines*pt2cm(1.25*self.font.get_size())
|
||||||
self.box_width = pt2cm(self.box_width+20)
|
self.box_width = pt2cm(self.box_width+20)
|
||||||
|
|
||||||
start = self.doc.get_right_margin()
|
|
||||||
|
|
||||||
self.maxx = int(self.doc.get_usable_width()/(self.box_width+_sep))
|
self.maxx = int(self.doc.get_usable_width()/(self.box_width+_sep))
|
||||||
self.maxy = int(self.doc.get_usable_height()/(self.height+_sep))
|
self.maxy = int(self.doc.get_usable_height()/(self.height+_sep))
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
import RelLib
|
import RelLib
|
||||||
import os
|
import os
|
||||||
import sort
|
|
||||||
import intl
|
import intl
|
||||||
|
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
@ -107,7 +107,7 @@ _scaled = 0
|
|||||||
_single = 1
|
_single = 1
|
||||||
_multiple = 2
|
_multiple = 2
|
||||||
|
|
||||||
pagecount_map = {
|
_pagecount_map = {
|
||||||
_("Single (scaled)") : _scaled,
|
_("Single (scaled)") : _scaled,
|
||||||
_("Single") : _single,
|
_("Single") : _single,
|
||||||
_("Multiple") : _multiple,
|
_("Multiple") : _multiple,
|
||||||
@ -138,7 +138,7 @@ class GraphVizDialog(ReportDialog):
|
|||||||
|
|
||||||
def get_print_pagecount_map(self):
|
def get_print_pagecount_map(self):
|
||||||
"""Set up the list of possible page counts."""
|
"""Set up the list of possible page counts."""
|
||||||
return (pagecount_map, _("Single (scaled)"))
|
return (_pagecount_map, _("Single (scaled)"))
|
||||||
|
|
||||||
def get_report_generations(self):
|
def get_report_generations(self):
|
||||||
"""Default to 10 generations, no page breaks."""
|
"""Default to 10 generations, no page breaks."""
|
||||||
|
@ -53,16 +53,16 @@ photo_types = [ "jpeg", "bmp", "pict", "pntg", "tpic", "png", "gif",
|
|||||||
"jpg", "tiff", "pcx" ]
|
"jpg", "tiff", "pcx" ]
|
||||||
|
|
||||||
ged2gramps = {}
|
ged2gramps = {}
|
||||||
for val in const.personalConstantEvents.keys():
|
for _val in const.personalConstantEvents.keys():
|
||||||
key = const.personalConstantEvents[val]
|
_key = const.personalConstantEvents[_val]
|
||||||
if key != "":
|
if _key != "":
|
||||||
ged2gramps[key] = val
|
ged2gramps[_key] = _val
|
||||||
|
|
||||||
ged2fam = {}
|
ged2fam = {}
|
||||||
for val in const.familyConstantEvents.keys():
|
for _val in const.familyConstantEvents.keys():
|
||||||
key = const.familyConstantEvents[val]
|
_key = const.familyConstantEvents[_val]
|
||||||
if key != "":
|
if _key != "":
|
||||||
ged2fam[key] = val
|
ged2fam[_key] = _val
|
||||||
|
|
||||||
intRE = re.compile(r"\s*(\d+)\s*$")
|
intRE = re.compile(r"\s*(\d+)\s*$")
|
||||||
lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
|
lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
from RelLib import *
|
from RelLib import *
|
||||||
|
|
||||||
import const
|
|
||||||
import WriteXML
|
import WriteXML
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
@ -22,10 +22,6 @@
|
|||||||
|
|
||||||
from RelLib import *
|
from RelLib import *
|
||||||
import os
|
import os
|
||||||
import posixpath
|
|
||||||
import re
|
|
||||||
import sort
|
|
||||||
import string
|
|
||||||
import Utils
|
import Utils
|
||||||
import intl
|
import intl
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
@ -76,10 +76,7 @@ class SoundGen:
|
|||||||
self.glade.get_widget("soundEx").show()
|
self.glade.get_widget("soundEx").show()
|
||||||
|
|
||||||
def on_apply_clicked(self,obj):
|
def on_apply_clicked(self,obj):
|
||||||
|
self.value.set_text(soundex.soundex(obj.get_text()))
|
||||||
text = obj.get_text()
|
|
||||||
value = self.value.set_text(soundex.soundex(text))
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user