CardView
CardView copied to clipboard
PEP8 etc.
First let me say Outstanding work!!!
My comments are based on a very cursory examination of your code. I don't know how you are developing this, but somewhere in your work flow you should run a PEP8 check or Pylint run to find and clean up some minor issues. Sometimes the Pylint run will also show up potential bugs. Our code submission guidelines for new code prefer to see Pylint results >90%.
I personally use Eclipse with Pydev to edit and debug my code, it has some options to highlight PEP8 issues, saying what is wrong, which makes editing for this much easier than looking at a Pylint results run. Maybe whatever you use has something similar?
Note that Gramps code doesn't always follow those guidelines... It has a lot of legacy/history and editing to get it compliant is not high on anyone's priority list. Which is why we say guidelines for "new code".
In my first startup of the addon I saw some warnings: C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\ProfileView\person_profile.py:528: DeprecationWarning: Gtk.ScrolledWindow.add_with_viewport is deprecated self.scroll.add_with_viewport(self.vbox) C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\ProfileView\frame_couple.py:96: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "mode" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations "image": Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL), C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\ProfileView\frame_couple.py:97: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "mode" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations "data": Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL), C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\ProfileView\frame_couple.py:98: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "mode" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations "metadata": Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL),
There are probably a lot more, you may want to deal with these Gtk issues now rather than when the deprecated Gtk becomes illegal.
I start my Python interpreter for the debug session with "-Wa" which seems to make these warnings show up in the console.
Keep up the good work. When you think it is ready for wider audience, leave a message, I will probably be the one to get it published to Gramps addons repos for general use.
Thanks Paul! If you have any other suggestions on code quality or features let me know. I did take a pass through and cleaned up a lot of pylint stuff recently and know more will probably be needed. I don't use a IDE although am sure it would be helpful. Also thanks for pointing out the deprecations, I agree makes sense to sort them out soon as well.