From: <dg...@us...> - 2010-03-25 19:37:13
|
Revision: 541 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=541&view=rev Author: dgranda Date: 2010-03-25 19:37:07 +0000 (Thu, 25 Mar 2010) Log Message: ----------- Patch to support 'with' statement in python < 2.6 Modified Paths: -------------- pytrainer/trunk/import/file_garmintools.py pytrainer/trunk/plugins/garmintools/garmintools.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/import/file_garmintools.py =================================================================== --- pytrainer/trunk/import/file_garmintools.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/import/file_garmintools.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,6 +17,9 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import logging import os import StringIO Modified: pytrainer/trunk/plugins/garmintools/garmintools.py =================================================================== --- pytrainer/trunk/plugins/garmintools/garmintools.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/plugins/garmintools/garmintools.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,6 +17,9 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import logging import os import StringIO Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-03-25 19:37:07 UTC (rev 541) @@ -17,18 +17,22 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Added to support python installations older than 2.6 +from __future__ import with_statement + import os import sys import logging import fnmatch import commands import StringIO +import traceback +import dateutil.parser + from lxml import etree from pytrainer.lib.xmlUtils import XMLParser -import dateutil.parser from datetime import date, timedelta, datetime from dateutil.tz import * # for tzutc() -import traceback class garmintools_full(): """ Plugin to import from a Garmin device using garmintools Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-03-21 09:59:37 UTC (rev 540) +++ pytrainer/trunk/pytrainer/main.py 2010-03-25 19:37:07 UTC (rev 541) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#540" + self.version ="1.7.1_svn#541" self.DB_version = 3 #Setup usage and permitted options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-05 01:00:54
|
Revision: 544 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=544&view=rev Author: jblance Date: 2010-04-05 01:00:47 +0000 (Mon, 05 Apr 2010) Log Message: ----------- New preferences tab which shows the settings of the pytrainer startup parameters Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/pytrainer/gui/windowprofile.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/profile.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2010-04-04 10:30:47 UTC (rev 543) +++ pytrainer/trunk/glade/profile.glade 2010-04-05 01:00:47 UTC (rev 544) @@ -1,2771 +1,1930 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - +<?xml version="1.0"?> <glade-interface> - -<widget class="GtkWindow" id="newprofile"> - <property name="visible">True</property> - <property name="title" translatable="yes">Preferences</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="icon">logo_mini.png</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="gtk_main_quit" last_modification_time="Mon, 27 Mar 2006 21:26:56 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkNotebook" id="notebook3"> - <property name="border_width">9</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - <signal name="switch_page" handler="on_switch_page" last_modification_time="Sat, 01 Apr 2006 14:42:27 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox24"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame14"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment14"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table19"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="n_rows">1</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkRadioButton" id="prf_metric_system"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Metric system</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="prf_us_system"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">U.S. customary units</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">prf_metric_system</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label20"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>System of Measurement</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame13"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment13"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table3"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">4</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkLabel" id="prf_ddbb_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Database type:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="prf_ddbbhost_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Database host:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_ddbbhost"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="prf_ddbbname_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Database name:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_ddbbname"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkComboBoxEntry" id="prf_ddbb"> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="has_frame">True</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_prf_ddbb_changed" last_modification_time="Mon, 24 Apr 2006 19:58:19 GMT"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="prf_ddbbuser_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Database user:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="prf_ddbbpass_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Database pass:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_ddbbuser"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_ddbbpass"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">False</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label19"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Database</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame15"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment15"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table20"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkLabel" id="label22"> - <property name="visible">True</property> - <property name="label" translatable="yes">Use this port for internal connections: </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry345"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - <property name="width_chars">6</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label23"> - <property name="visible">True</property> - <property name="label" translatable="yes"><small><b>Note:</b> Change this only if you know what you are doing</small></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label21"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Port Connnection</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-2147483645"> - <property name="visible">True</property> - <property name="label" translatable="yes">General</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame12"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment12"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table2"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">4</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkLabel" id="label14"> - <property name="visible">True</property> - <property name="label" translatable="yes">User name:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label15"> - <property name="visible">True</property> - <property name="label" translatable="yes">Gender:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkComboBoxEntry" id="prf_gender"> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="has_frame">True</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label17"> - <property name="visible">True</property> - <property name="label" translatable="yes">Height:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_height"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_name"> - <property name="width_request">160</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label18"> - <property name="visible">True</property> - <property name="label" translatable="yes">Date of birth:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox50"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkEntry" id="prf_age"> - <property name="width_request">108</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button46"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_calendar_clicked" last_modification_time="Sun, 02 Apr 2006 18:37:59 GMT"/> - - <child> - <widget class="GtkImage" id="image31"> - <property name="visible">True</property> - <property name="stock">gtk-index</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="prf_weight"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label16"> - <property name="visible">True</property> - <property name="label" translatable="yes">Weight:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label-2147483648"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Athlete Details</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="visible">True</property> - <property name="label" translatable="yes">Athlete</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkNotebook" id="notebook5"> - <property name="visible">True</property> - <property name="show_tabs">False</property> - <property name="show_border">False</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkFrame" id="sportlist"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment16"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="sportlist_"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="sportScrollWindow"> - <property name="height_request">170</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="sportTreeView"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <property name="fixed_height_mode">False</property> - <property name="hover_selection">False</property> - <property name="hover_expand">False</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label26"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button5"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-delete</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_delsport_clicked" last_modification_time="Tue, 17 Oct 2006 17:11:23 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button23"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-edit</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_editsport_clicked" last_modification_time="Tue, 17 Oct 2006 17:51:12 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button6"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-add</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_addsport_clicked" last_modification_time="Tue, 17 Oct 2006 17:11:05 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label23"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Sport List</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label135"> - <property name="visible">True</property> - <property name="label" translatable="yes">llist</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="addsport"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment18"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="addsport_"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkTable" id="table18"> - <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">5</property> - - <child> - <widget class="GtkEntry" id="newsportentry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label154"> - <property name="visible">True</property> - <property name="label" translatable="yes">Name:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label155"> - <property name="visible">True</property> - <property name="label" translatable="yes">M.E.T.:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="newmetentry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-2147483648"> - <property name="visible">True</property> - <property name="label" translatable="yes">Extra Weight:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="newweightentry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label156"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLinkButton" id="metlinkbutton"> - <property name="label" translatable="yes">More information on determining yor M.E.T sport coefficient on Wikipedia</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="relief">none</property> - <property name="uri">http://en.wikipedia.org/wiki/Metabolic_equivalent</property> - </widget> - <packing> - <property nam... [truncated message content] |
From: <jb...@us...> - 2010-04-05 02:34:46
|
Revision: 546 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=546&view=rev Author: jblance Date: 2010-04-05 02:34:40 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Command line options can now be changed by preferences gui - do not persist across restarts Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/pytrainer/extensions/googlemaps.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/gui/windowprofile.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2010-04-05 01:11:05 UTC (rev 545) +++ pytrainer/trunk/glade/profile.glade 2010-04-05 02:34:40 UTC (rev 546) @@ -1624,8 +1624,8 @@ <property name="items" translatable="yes">Error Warning Info -Debug -Unknown</property> +Debug</property> + <signal name="changed" handler="on_comboboxLogLevel_changed"/> </widget> <packing> <property name="left_attach">1</property> @@ -1667,6 +1667,7 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_checkbuttonValidate_toggled"/> </widget> <packing> <property name="left_attach">1</property> @@ -1712,6 +1713,7 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_checkbuttonCheck_toggled"/> </widget> <packing> <property name="left_attach">1</property> @@ -1758,6 +1760,7 @@ <property name="receives_default">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_checkbuttonGM3_toggled"/> </widget> <packing> <property name="left_attach">1</property> @@ -1804,6 +1807,7 @@ <property name="receives_default">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_checkbuttonUnifiedImport_toggled"/> </widget> <packing> <property name="left_attach">1</property> @@ -1839,8 +1843,22 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label2"> + <widget class="GtkLabel" id="labelNotification"> <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + <property name="label" translatable="yes"><small>This screen shows the state of command line configurable options for pytrainer. These options can be changed here which will affect the current instance of pytrainer, they will not be remembered next time though</small></property> + <property name="use_markup">True</property> + <property name="wrap">True</property> + <property name="width_chars">75</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelNote"> + <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> <property name="xpad">5</property> @@ -1849,7 +1867,7 @@ <property name="use_markup">True</property> </widget> <packing> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> </widget> Modified: pytrainer/trunk/pytrainer/extensions/googlemaps.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/googlemaps.py 2010-04-05 01:11:05 UTC (rev 545) +++ pytrainer/trunk/pytrainer/extensions/googlemaps.py 2010-04-05 02:34:40 UTC (rev 546) @@ -28,7 +28,7 @@ from pytrainer.record import Record class Googlemaps: - def __init__(self, data_path = None, vbox = None, waypoint = None, useGM3 = False): + def __init__(self, data_path = None, vbox = None, waypoint = None, pytrainer_main=None): logging.debug(">>") self.data_path = data_path self.conf = checkConf() @@ -38,7 +38,7 @@ vbox.show_all() self.htmlfile = "%s/index.html" % (self.conf.getValue("tmpdir")) self.waypoint=waypoint - self.useGM3 = useGM3 + self.pytrainer_main = pytrainer_main self.record = Record() logging.debug("<<") @@ -79,7 +79,7 @@ logging.debug("minlon: %s, maxlon: %s" % (minlon, maxlon)) points,levels = Points.encodePoints(pointlist) points = points.replace("\\","\\\\") - if self.useGM3: + if self.pytrainer_main.gm3: logging.debug("Using Google Maps version 3 API") #laps = gpx.getLaps() # [](elapsedTime, lat, lon, calories, distance) #"id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories", Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-05 01:11:05 UTC (rev 545) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-05 02:34:40 UTC (rev 546) @@ -78,9 +78,12 @@ self.notebook.set_current_page(1) #Disable import menu item unless specified on startup - if not self.testimport: - self.menu_importdata.set_sensitive(0) + self.set_unified_import(self.testimport) + def set_unified_import(self, status=False): + self.menu_importdata.set_sensitive(status) + self.parent.testimport = status + def _createXmlListView(self,file): menufile = XMLParser(file) savedOptions = [] @@ -139,8 +142,8 @@ self.drawareamonth = MonthGraph(self.month_vbox, self.window1, self.month_combovalue,self.month_combovalue2) self.drawareayear = YearGraph(self.year_vbox, self.window1, self.year_combovalue,self.year_combovalue2) - def createMap(self,Googlemaps,waypoint, useGM3): - self.googlemaps = Googlemaps(self.data_path, self.map_vbox,waypoint, useGM3) + def createMap(self,Googlemaps,waypoint): + self.googlemaps = Googlemaps(self.data_path, self.map_vbox,waypoint, pytrainer_main=self.parent) def updateSportList(self,listSport): logging.debug(">>") Modified: pytrainer/trunk/pytrainer/gui/windowprofile.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-04-05 01:11:05 UTC (rev 545) +++ pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-04-05 02:34:40 UTC (rev 546) @@ -168,7 +168,7 @@ elif self.pytrainer_main.log_level == logging.DEBUG: self.comboboxLogLevel.set_active(3) else: - self.comboboxLogLevel.set_active(4) + self.comboboxLogLevel.set_active(0) print "Unknown logging level specified" #Show if validation requested @@ -197,13 +197,75 @@ #TODO Allow changes to settings!!! #Disable editing as processing of changes not yet implemented - self.comboboxLogLevel.set_sensitive(0) + #self.comboboxLogLevel.set_sensitive(0) #logging.getLogger('').setLevel(self.log_level) - self.checkbuttonValidate.set_sensitive(0) - self.checkbuttonCheck.set_sensitive(0) - self.checkbuttonGM3.set_sensitive(0) - self.checkbuttonUnifiedImport.set_sensitive(0) + #self.checkbuttonValidate.set_sensitive(0) + #self.checkbuttonCheck.set_sensitive(0) + #self.checkbuttonGM3.set_sensitive(0) + #self.checkbuttonUnifiedImport.set_sensitive(0) + + def on_comboboxLogLevel_changed(self, widget): + active = self.comboboxLogLevel.get_active() + if active == 1: + logging.debug("Setting log level to WARNING") + self.pytrainer_main.log_level = logging.WARNING + elif active == 2: + logging.debug("Setting log level to INFO") + self.pytrainer_main.log_level = logging.INFO + elif active == 3: + logging.debug("Setting log level to DEBUG") + self.pytrainer_main.log_level = logging.DEBUG + else: + logging.debug("Setting log level to ERROR") + self.pytrainer_main.log_level = logging.ERROR + self.pytrainer_main.set_logging_level(self.pytrainer_main.log_level) + + def on_checkbuttonValidate_toggled(self, widget): + if self.checkbuttonValidate.get_active(): + logging.debug( "Validate activated") + self.pytrainer_main.validate = True + else: + logging.debug("Validate deactivated") + self.pytrainer_main.validate = False + + def on_checkbuttonCheck_toggled(self, widget): + if self.checkbuttonCheck.get_active(): + logging.debug( "Check activated") + if self.pytrainer_main.check is not True: + #Need to do sanitycheck + logging.debug("Need to do sanitycheck") + self.pytrainer_main.sanityCheck() + self.pytrainer_main.check = True + else: + logging.debug("Check deactivated") + self.pytrainer_main.check = False + + def on_checkbuttonGM3_toggled(self, widget): + if self.checkbuttonGM3.get_active(): + logging.debug("GM3 activated") + self.pytrainer_main.gm3 = True + else: + logging.debug("GM3 deactivated") + self.pytrainer_main.gm3 = False + def on_checkbuttonUnifiedImport_toggled(self, widget): + if self.checkbuttonUnifiedImport.get_active(): + logging.debug("Unified Import activated") + if self.pytrainer_main.testimport is not True: + #Need to enable unified import + logging.debug("Need to enable unified import") + self.pytrainer_main.windowmain.set_unified_import(True) + else: + #No change + logging.debug("No change to unified import") + else: + logging.debug("Unified Import deactivated") + if self.pytrainer_main.testimport is True: + logging.debug("Need to deactivate unified import") + self.pytrainer_main.windowmain.set_unified_import(False) + else: + logging.debug("No change to unified import") + def on_sportlistbutton_clicked(self,widget): sport_list = self.parent.getSportList() if sport_list == 0: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-05 01:11:05 UTC (rev 545) +++ pytrainer/trunk/pytrainer/main.py 2010-04-05 02:34:40 UTC (rev 546) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#544" + self.version ="1.7.1_svn#546" self.DB_version = 3 #Setup usage and permitted options @@ -156,12 +156,16 @@ self.loadPlugins() self.loadExtensions() self.windowmain.createGraphs(RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph) - self.windowmain.createMap(Googlemaps,self.waypoint, self.gm3) + self.windowmain.createMap(Googlemaps,self.waypoint) self.windowmain.createWaypointEditor(WaypointEditor,self.waypoint, parent=self) self.windowmain.on_calendar_selected(None) self.refreshMainSportList() self.windowmain.run() logging.debug('<<') + + def set_logging_level(self,level): + logging.debug("Setting logger to level: "+ str(level)) + logging.getLogger('').setLevel(level) def quit(self): logging.debug('--') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-05 03:18:02
|
Revision: 547 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=547&view=rev Author: jblance Date: 2010-04-05 03:17:55 +0000 (Mon, 05 Apr 2010) Log Message: ----------- More refactoring to glade files. pytrainer.glade now displays in Glade Interface Designer for easier modification Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/dialogselecttrack.py pytrainer/trunk/pytrainer/gui/filechooser.py pytrainer/trunk/pytrainer/main.py Added Paths: ----------- pytrainer/trunk/glade/filechooserdialog.glade pytrainer/trunk/glade/selecttrackdialog.glade Added: pytrainer/trunk/glade/filechooserdialog.glade =================================================================== --- pytrainer/trunk/glade/filechooserdialog.glade (rev 0) +++ pytrainer/trunk/glade/filechooserdialog.glade 2010-04-05 03:17:55 UTC (rev 547) @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<glade-interface> + <widget class="GtkFileChooserDialog" id="filechooserdialog"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="destroy_with_parent">True</property> + <property name="icon">logo_mini.png</property> + <property name="type_hint">dialog</property> + <property name="do_overwrite_confirmation">True</property> + <property name="local_only">False</property> + <signal name="destroy" handler="gtk_main_quit"/> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">24</property> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">end</property> + <child> + <widget class="GtkButton" id="button13"> + <property name="label">gtk-cancel</property> + <property name="response_id">-6</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_cancel_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button14"> + <property name="label">gtk-open</property> + <property name="response_id">-5</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_accept_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-05 02:34:40 UTC (rev 546) +++ pytrainer/trunk/glade/pytrainer.glade 2010-04-05 03:17:55 UTC (rev 547) @@ -1,8845 +1,4895 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - +<?xml version="1.0"?> <glade-interface> - -<widget class="GtkWindow" id="window1"> - <property name="visible">True</property> - <property name="title" translatable="yes">window1</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="icon">logo_mini.png</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="quit" last_modification_time="Sun, 17 Jun 2007 20:02:27 GMT"/> - - <child> - <widget class="GtkNotebook" id="notebook7"> - <property name="visible">True</property> - <property name="show_tabs">False</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="infoarea"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkMenuBar" id="menubar1"> - <property name="visible">True</property> - <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property> - <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property> - - <child> - <widget class="GtkMenuItem" id="menuitem1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_File</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem1_menu"> - - <child> - <widget class="GtkImageMenuItem" id="nuevo1"> - <property name="visible">True</property> - <property name="label">gtk-new</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_newrecord_clicked" last_modification_time="Sun, 26 Mar 2006 19:38:34 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menu_importdata"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Import</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_menu_importdata_activate" last_modification_time="Sun, 26 Mar 2006 19:38:34 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separador1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="export_csv"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Export as Text Separated by Commas</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_export_csv_activate" last_modification_time="Tue, 22 Aug 2006 18:22:41 GMT"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image27"> - <property name="visible">True</property> - <property name="stock">gtk-go-down</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="salir1"> - <property name="visible">True</property> - <property name="label">gtk-quit</property> - <property name="use_stock">True</property> - <signal name="activate" handler="quit" last_modification_time="Sat, 01 Apr 2006 13:57:22 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuitem2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Edit</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem2_menu"> - - <child> - <widget class="GtkImageMenuItem" id="preferencias1"> - <property name="visible">True</property> - <property name="label">gtk-preferences</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_edituser_activate" last_modification_time="Sat, 01 Apr 2006 13:54:19 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="view1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_View</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="view1_menu"> - - <child> - <widget class="GtkRadioMenuItem" id="classicview_item"> - <property name="visible">True</property> - <property name="label" translatable="yes"> _Classic View</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <signal name="activate" handler="on_classicview_activate" last_modification_time="Thu, 19 Oct 2006 15:37:58 GMT"/> - <accelerator key="c" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkRadioMenuItem" id="listview_item"> - <property name="visible">True</property> - <property name="label" translatable="yes"> _List View</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <property name="group">classicview_item</property> - <signal name="activate" handler="on_listview_activate" last_modification_time="Thu, 19 Oct 2006 15:37:47 GMT"/> - <accelerator key="l" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkRadioMenuItem" id="waipointsview_item"> - <property name="visible">True</property> - <property name="label" translatable="yes"> _Waypoints Editor</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <property name="group">classicview_item</property> - <signal name="activate" handler="on_waypointsview_activate" last_modification_time="Tue, 26 Jun 2007 12:01:49 GMT"/> - <accelerator key="w" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="tools1"> - <property name="visible">True</property> - <property name="label" translatable="yes">Tools</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_tools1_activate" last_modification_time="Mon, 30 Oct 2006 11:28:31 GMT"/> - - <child> - <widget class="GtkMenu" id="tools1_menu"> - - <child> - <widget class="GtkMenuItem" id="extensions1"> - <property name="visible">True</property> - <property name="label" translatable="yes">Extensions</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_extensions_activate" last_modification_time="Mon, 30 Oct 2006 12:09:15 GMT"/> - <accelerator key="e" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="gps_device_plugins1"> - <property name="visible">True</property> - <property name="label" translatable="yes">GPS Device Plugins</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_gpsplugins_activate" last_modification_time="Sun, 12 Nov 2006 17:37:52 GMT"/> - <accelerator key="p" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuitem4"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Help</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem4_menu"> - - <child> - <widget class="GtkImageMenuItem" id="acerca_de1"> - <property name="visible">True</property> - <property name="label">gtk-about</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_about_activate" last_modification_time="Sun, 30 Apr 2006 13:09:08 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkNotebook" id="notebook6"> - <property name="visible">True</property> - <property name="show_tabs">False</property> - <property name="show_border">False</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkHBox" id="classicarea"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkVPaned" id="vpaned1"> - <property name="width_request">235</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="position">190</property> - - <child> - <widget class="GtkCalendar" id="calendar"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="display_options">GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES</property> - <signal name="day_selected" handler="on_calendar_selected" last_modification_time="Mon, 03 Apr 2006 18:54:54 GMT"/> - <signal name="day_selected_double_click" handler="on_calendar_doubleclick" last_modification_time="Mon, 03 Apr 2006 18:55:39 GMT"/> - <signal name="next_month" handler="on_calendar_changemonth" last_modification_time="Wed, 10 May 2006 19:28:36 GMT"/> - <signal name="next_year" handler="on_calendar_next_year" last_modification_time="Tue, 09 May 2006 17:13:10 GMT"/> - <signal name="prev_month" handler="on_calendar_changemonth" last_modification_time="Wed, 10 May 2006 19:28:44 GMT"/> - <signal name="prev_year" handler="on_calendar_next_year" last_modification_time="Wed, 10 May 2006 19:29:06 GMT"/> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">False</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="recordTreeView"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <property name="fixed_height_mode">False</property> - <property name="hover_selection">False</property> - <property name="hover_expand">False</property> - <signal name="row_activated" handler="on_recordTree_clicked" last_modification_time="Wed, 10 May 2006 19:40:45 GMT"/> - <signal name="button_press_event" handler="on_allRecordTreeView_button_press" last_modification_time="Tue, 24 Oct 2006 18:59:19 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="framework"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">10</property> - - <child> - <widget class="GtkLabel" id="label47"> - <property name="visible">True</property> - <property name="label" translatable="yes">Sport</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkComboBoxEntry" id="sportlist"> - <property name="width_request">52</property> - <property name="visible">True</property> - <property name="items" translatable="yes">All Sports</property> - <property name="add_tearoffs">False</property> - <property name="has_frame">True</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_sportlist_changed" last_modification_time="Sun, 30 Apr 2006 19:35:58 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label48"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkNotebook" id="notebook"> - <property name="border_width">6</property> - <property name="width_request">650</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">True</property> - <property name="enable_popup">True</property> - <signal name="switch_page" handler="on_page_change" last_modification_time="Thu, 13 Apr 2006 11:55:38 GMT"/> - - <child> - <widget class="GtkNotebook" id="recordview"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_LEFT</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - <signal name="switch_page" handler="on_recordpage_change" last_modification_time="Thu, 10 Jan 2008 18:45:08 GMT"/> - - <child> - <widget class="GtkFrame" id="frame8"> - <property name="border_width">8</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment8"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox22"> - <property name="border_width">10</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkTable" id="table13"> - <property name="visible">True</property> - <property name="n_rows">10</property> - <property name="n_columns">6</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">3</property> - - <child> - <widget class="GtkLabel" id="record_sport"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_upositive"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_calories"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="ddsddsdsdsds"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Sport:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11124"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Duration:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11126"> - <property name="width_request">90</property> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Speed:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11137"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Pace:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11144"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Ascent:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11144"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Calories:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label11140"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Comments:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="r_maxspeed_unit"> - <property name="visible">True</property> - <property name="label" translatable="yes">km/h</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="r_maxpace_unit"> - <property name="visible">True</property> - <property name="label" translatable="yes">min/km</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="r_descent_unit"> - <property name="visible">True</property> - <property name="label" translatable="yes">m</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_distance"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_maxspeed"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_maxpace"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_date"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - - <child> - <widget class="GtkLabel" id="record_unegative"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label-2147483648"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Date:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11123"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Distance:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11134"> - <property name="width_request">90</property> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Max Speed</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11138"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Max Pace:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11145"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Descent:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - -<!-- <child> - <widget class="GtkLabel" id="label11145"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Date Time:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> ---> - - <child> - <widget class="GtkLabel" id="record_time"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> -<!-- - <child> - <widget class="GtkLabel" id="record_datetime"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="record_datetime_offset"> - <property name="visible">True</property> - <property name="label" translatable="yes">m</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> ---> - <child> - <widget class="GtkLabel" id="record_pace"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="r_pace_unit"> - <property name="visible">True</property> - <property name="label" translatable="yes">min/km</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - ... [truncated message content] |
From: <jb...@us...> - 2010-04-05 05:04:23
|
Revision: 548 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=548&view=rev Author: jblance Date: 2010-04-05 05:04:17 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Fix full screen map view Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/drawArea.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/recordgraph.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-05 03:17:55 UTC (rev 547) +++ pytrainer/trunk/glade/pytrainer.glade 2010-04-05 05:04:17 UTC (rev 548) @@ -1159,11 +1159,12 @@ </child> <child> <widget class="GtkButton" id="button27"> + <property name="visible">True</property> <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="receives_default">True</property> <signal name="clicked" handler="on_showmap_clicked"/> <child> - <widget class="GtkImage" id="image21"> + <widget class="GtkImage" id="image3"> <property name="visible">True</property> <property name="stock">gtk-fullscreen</property> </widget> @@ -1181,6 +1182,134 @@ <property name="position">0</property> </packing> </child> + <child> + <widget class="GtkHPaned" id="hpaned1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="position_set">True</property> + <child> + <widget class="GtkTable" id="tableConfig"> + <property name="visible">True</property> + <property name="n_rows">5</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="labelY1Axis"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><small>Y Axis</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Min"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 0 100 1 10 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Max"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 0 100 1 10 0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelGraphConfig"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><small>Graph Config Options</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="right_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkButton" id="buttonRefreshGraph"> + <property name="label" translatable="yes">Refresh Graph Display</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </widget> + <packing> + <property name="right_attach">3</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="resize">False</property> + <property name="shrink">True</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="record_graph_vbox"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="resize">True</property> + <property name="shrink">True</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> </widget> <packing> <property name="position">1</property> Modified: pytrainer/trunk/pytrainer/gui/drawArea.py =================================================================== --- pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-05 03:17:55 UTC (rev 547) +++ pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-05 05:04:17 UTC (rev 548) @@ -314,6 +314,7 @@ axis.set_title("%s vs %s" %(ylabel[0],ylabel[1])) else: axis.set_title("%s" %(ylabel[0])) + ylim = axis.get_ylim() canvas = FigureCanvasGTK(figure) # a gtk.DrawingArea canvas.show() @@ -323,8 +324,9 @@ for child in self.vbox.get_children(): logging.debug('Child available: '+str(child)) - + logging.debug('<<') + return ylim def drawPie(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None): logging.debug('>>') Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-05 03:17:55 UTC (rev 547) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-05 05:04:17 UTC (rev 548) @@ -134,7 +134,7 @@ self.parent.runExtension(extension,id) def createGraphs(self,RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph): - self.drawarearecord = RecordGraph(self.record_vbox, self.window1, self.record_combovalue, self.record_combovalue2, self.btnShowLaps) + self.drawarearecord = RecordGraph(self.record_graph_vbox, self.window1, self.record_combovalue, self.record_combovalue2, self.btnShowLaps, self.tableConfig) self.drawareaheartrate = HeartRateGraph(self.heartrate_vbox, self.window1, self.heartrate_vbox2) #self.drawareaday = DayGraph(self.day_vbox, self.day_combovalue) self.day_vbox.hide() @@ -144,6 +144,7 @@ def createMap(self,Googlemaps,waypoint): self.googlemaps = Googlemaps(self.data_path, self.map_vbox,waypoint, pytrainer_main=self.parent) + self.googlemaps_old = Googlemaps(self.data_path, self.map_vbox_old,waypoint, pytrainer_main=self.parent) def updateSportList(self,listSport): logging.debug(">>") @@ -389,9 +390,12 @@ self.drawareaday.drawgraph(record_list) logging.debug("<<") - def actualize_map(self,id_record): + def actualize_map(self,id_record, full_screen=False): logging.debug(">>") - self.googlemaps.drawMap(id_record) + if full_screen: + self.googlemaps_old.drawMap(id_record) + else: + self.googlemaps.drawMap(id_record) logging.debug("<<") def actualize_weekview(self, record_list, date_ini, date_end): @@ -874,7 +878,7 @@ def on_showmap_clicked(self,widget): self.infoarea.hide() self.maparea.show() - self.parent.refreshMapView() + self.parent.refreshMapView(full_screen=True) def on_hidemap_clicked(self,widget): self.maparea.hide() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-05 03:17:55 UTC (rev 547) +++ pytrainer/trunk/pytrainer/main.py 2010-04-05 05:04:17 UTC (rev 548) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#547" + self.version ="1.7.1_svn#548" self.DB_version = 3 #Setup usage and permitted options @@ -330,12 +330,12 @@ self.windowmain.actualize_hrview(record_list,zones,karvonen_method) logging.debug('<<') - def refreshMapView(self): + def refreshMapView(self, full_screen=False): logging.debug('>>') selected,iter = self.windowmain.recordTreeView.get_selection().get_selected() id_record = selected.get_value(iter,0) logging.debug('Trying to show map for record '+str(id_record)) - self.windowmain.actualize_map(id_record) + self.windowmain.actualize_map(id_record, full_screen) logging.debug('<<') def refreshListRecords(self): Modified: pytrainer/trunk/pytrainer/recordgraph.py =================================================================== --- pytrainer/trunk/pytrainer/recordgraph.py 2010-04-05 03:17:55 UTC (rev 547) +++ pytrainer/trunk/pytrainer/recordgraph.py 2010-04-05 05:04:17 UTC (rev 548) @@ -18,18 +18,26 @@ import logging from gui.drawArea import DrawArea +import gtk class RecordGraph: - def __init__(self, vbox = None, window = None, combovalue = None, combovalue2 = None, btnShowLaps = None): + def __init__(self, vbox = None, window = None, combovalue = None, combovalue2 = None, btnShowLaps = None, tableConfig = None): logging.debug(">>") self.drawarea = DrawArea(vbox, window) self.combovalue = combovalue self.combovalue2 = combovalue2 self.showLaps = btnShowLaps + self.config_table = tableConfig logging.debug("<<") def drawgraph(self,values,laps=None): logging.debug(">>") + #Get the config options + for child in self.config_table.get_children(): + if child.get_name() == "spinbuttonY1Max": + spinbuttonY1Max = child + elif child.get_name() == "spinbuttonY1Min": + spinbuttonY1Min = child xval = [] yval = [] xlab = [] @@ -61,6 +69,8 @@ self.combovalue2.set_active(0) value_selected2 = 0 xvalues, yvalues = self.get_values(values,value_selected) + max_yvalue = max(yvalues) + min_yvalue = min(yvalues) xlabel,ylabel,title,color = self.get_value_params(value_selected) xval.append(xvalues) @@ -77,6 +87,8 @@ value_selected2 = value_selected2-1 xlabel,ylabel,title,color = self.get_value_params(value_selected2) xvalues,yvalues = self.get_values(values,value_selected2) + max_yvalue=max(max(yvalues), max_yvalue) + min_yvalue=min(min(yvalues), min_yvalue) xval.append(xvalues) yval.append(yvalues) xlab.append(xlabel) @@ -85,7 +97,16 @@ col.append(color) logging.info("To show: tit: "+str(tit)+" | col: "+str(col)+" | xlab: "+str(xlab)+" | ylab: "+str(ylab)) #self.drawPlot(xvalues,yvalues,xlabel,ylabel,title,color,zones) - self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues) + ymin, ymax = self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues) + + max_yvalue = max(max_yvalue, ymax) + min_yvalue = min(min_yvalue, ymin) + adjY1Min = gtk.Adjustment(value=ymin, lower=min_yvalue,upper=max_yvalue, step_incr=1, page_incr=10) + adjY1Max = gtk.Adjustment(value=ymax, lower=min_yvalue,upper=max_yvalue, step_incr=1, page_incr=10) + spinbuttonY1Min.set_adjustment(adjY1Min) + spinbuttonY1Max.set_adjustment(adjY1Max) + spinbuttonY1Min.set_value(ymin) + spinbuttonY1Max.set_value(ymax) logging.debug("<<") def get_value_params(self,value): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-08 08:29:21
|
Revision: 551 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=551&view=rev Author: jblance Date: 2010-04-08 08:29:12 +0000 (Thu, 08 Apr 2010) Log Message: ----------- Minor fixes to graph display options - to ensure functionality that exists actually works... Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/drawArea.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/recordgraph.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-08 07:29:13 UTC (rev 550) +++ pytrainer/trunk/glade/pytrainer.glade 2010-04-08 08:29:12 UTC (rev 551) @@ -1212,7 +1212,8 @@ <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="width_chars">4</property> - <property name="adjustment">0 0 100 1 10 0</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> </widget> <packing> <property name="left_attach">1</property> @@ -1229,7 +1230,8 @@ <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="width_chars">4</property> - <property name="adjustment">0 0 100 1 10 0</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> </widget> <packing> <property name="left_attach">2</property> @@ -1243,8 +1245,7 @@ <child> <widget class="GtkLabel" id="labelGraphConfig"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes"><small>Graph Config Options</small></property> + <property name="label" translatable="yes"><small>Graph Display Options</small></property> <property name="use_markup">True</property> </widget> <packing> @@ -1253,19 +1254,21 @@ </packing> </child> <child> - <widget class="GtkButton" id="buttonRefreshGraph"> - <property name="label" translatable="yes">Refresh Graph Display</property> + <widget class="GtkButton" id="buttonResetGraph"> + <property name="label" translatable="yes">Reset Graph</property> <property name="visible">True</property> - <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="tooltip" translatable="yes">Reset Graph display to original settings</property> + <property name="yalign">1</property> + <signal name="clicked" handler="on_buttonResetGraph_clicked"/> </widget> <packing> <property name="right_attach">3</property> <property name="top_attach">4</property> <property name="bottom_attach">5</property> <property name="x_options"></property> - <property name="y_options"></property> + <property name="y_options">GTK_EXPAND</property> </packing> </child> <child> Modified: pytrainer/trunk/pytrainer/gui/drawArea.py =================================================================== --- pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-08 07:29:13 UTC (rev 550) +++ pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-08 08:29:12 UTC (rev 551) @@ -273,7 +273,7 @@ logging.debug('<<') - def drawPlot(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None,xzones=None): + def drawPlot(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None,xzones=None, ylimits=None): logging.debug('>>') logging.debug("Type: plot | title: "+str(title)+" | col: "+str(color)+" | xlabel: "+str(xlabel)+" | ylabel: "+str(ylabel)) logging.debug('xlabel: '+str(xlabel)+' | ylabel: '+str(ylabel)+' | title: '+str(title)) @@ -314,8 +314,16 @@ axis.set_title("%s vs %s" %(ylabel[0],ylabel[1])) else: axis.set_title("%s" %(ylabel[0])) - ylim = axis.get_ylim() + ylim_min, ylim_max = axis.get_ylim() + if ylimits is not None: + logging.debug("Using ylimits: %s" % str(ylimits)) + if ylimits[0] is not None: + ylim_min = ylimits[0] + if ylimits[1] is not None: + ylim_max = ylimits[1] + axis.set_ylim(ylim_min, ylim_max) + canvas = FigureCanvasGTK(figure) # a gtk.DrawingArea canvas.show() self.vbox.pack_start(canvas, True, True) @@ -326,7 +334,7 @@ logging.debug('Child available: '+str(child)) logging.debug('<<') - return ylim + return (ylim_min, ylim_max) def drawPie(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None): logging.debug('>>') Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-08 07:29:13 UTC (rev 550) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-08 08:29:12 UTC (rev 551) @@ -52,6 +52,8 @@ self.block = False self.activeSport = None self.gpxDir = gpxDir + self.record_list = None + self.laps = None def new(self): self.testimport = self.parent.testimport @@ -266,6 +268,8 @@ def actualize_recordgraph(self,record_list,laps=None): logging.debug(">>") + self.record_list = record_list + self.laps = laps if len(record_list)>0: self.record_vbox.set_sensitive(1) self.drawarearecord.drawgraph(record_list,laps) @@ -815,10 +819,30 @@ def createWaypointEditor(self,WaypointEditor,waypoint, parent=None): self.waypointeditor = WaypointEditor(self.data_path, self.waypointvbox,waypoint,parent) + + def zoom_graph(self, ylimits=None): + logging.debug(">>") + logging.debug("Reseting graph Y axis with ylimits: %s" % str(ylimits) ) + self.drawarearecord.drawgraph(self.record_list,self.laps, ylimits=ylimits) + logging.debug("<<") ###################### ## Lista de eventos ## ###################### + + def on_spinbuttonY1_value_changed(self, widget): + ymin = self.spinbuttonY1Min.get_value() + ymax = self.spinbuttonY1Max.get_value() + #Check to see if the min and max have the same... + if ymin == ymax: + if widget.get_name() == "spinbuttonY1Min": #User was changing the min spinbutton, so move max up + ymax += 1 + else: #Move min down + ymin -= 1 + self.zoom_graph(ylimits=(ymin, ymax)) + + def on_buttonResetGraph_clicked(self, widget): + self.zoom_graph() def on_edit_clicked(self,widget): selected,iter = self.recordTreeView.get_selection().get_selected() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-08 07:29:13 UTC (rev 550) +++ pytrainer/trunk/pytrainer/main.py 2010-04-08 08:29:12 UTC (rev 551) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#550" + self.version ="1.7.1_svn#551" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/pytrainer/recordgraph.py =================================================================== --- pytrainer/trunk/pytrainer/recordgraph.py 2010-04-08 07:29:13 UTC (rev 550) +++ pytrainer/trunk/pytrainer/recordgraph.py 2010-04-08 08:29:12 UTC (rev 551) @@ -30,7 +30,7 @@ self.config_table = tableConfig logging.debug("<<") - def drawgraph(self,values,laps=None): + def drawgraph(self,values,laps=None, ylimits=None): logging.debug(">>") #Get the config options for child in self.config_table.get_children(): @@ -97,7 +97,7 @@ col.append(color) logging.info("To show: tit: "+str(tit)+" | col: "+str(col)+" | xlab: "+str(xlab)+" | ylab: "+str(ylab)) #self.drawPlot(xvalues,yvalues,xlabel,ylabel,title,color,zones) - ymin, ymax = self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues) + ymin, ymax = self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues, ylimits=ylimits) max_yvalue = max(max_yvalue, ymax) min_yvalue = min(min_yvalue, ymin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-04-11 19:02:02
|
Revision: 558 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=558&view=rev Author: dgranda Date: 2010-04-11 19:01:56 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Updating version to 1.7.2 Modified Paths: -------------- pytrainer/trunk/pytrainer/main.py pytrainer/trunk/setup.py Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-11 19:01:06 UTC (rev 557) +++ pytrainer/trunk/pytrainer/main.py 2010-04-11 19:01:56 UTC (rev 558) @@ -63,7 +63,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.1_svn#555" + self.version ="1.7.2" self.DB_version = 3 #Setup usage and permitted options Modified: pytrainer/trunk/setup.py =================================================================== --- pytrainer/trunk/setup.py 2010-04-11 19:01:06 UTC (rev 557) +++ pytrainer/trunk/setup.py 2010-04-11 19:01:56 UTC (rev 558) @@ -15,7 +15,7 @@ return "share/pytrainer/extensions/%s"%extension_name, glob("extensions/%s/*"%extension_name) setup( name="pytrainer", - version="1.7.1", + version="1.7.2", description="The free sport tracking center", long_description="Pytrainer is a tool to log all your sport excursion coming from GPS devices (with a focus on ForeRunner 205, 305 and 405) or GPX (http://www.topografix.com) files. Pytrainer supports GPS track files and displays it in graphs, maps... ", author="Fiz Vazquez, John Blance, David Garcia Granda", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-14 08:56:39
|
Revision: 562 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=562&view=rev Author: jblance Date: 2010-04-14 08:56:33 +0000 (Wed, 14 Apr 2010) Log Message: ----------- Fix of plugins have refactor of global vars Modified Paths: -------------- pytrainer/trunk/import/file_garmintcxv1.py pytrainer/trunk/import/file_garmintcxv2.py pytrainer/trunk/import/file_garmintools.py pytrainer/trunk/import/file_gpxplus.py pytrainer/trunk/import/file_kml20.py pytrainer/trunk/import/tool_gant.py pytrainer/trunk/import/tool_garmintools.py pytrainer/trunk/import/tool_gpsbabel.py pytrainer/trunk/plugins/garmin-gpx/garmingpx.py pytrainer/trunk/plugins/garmin-hr/garminhr.py pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py pytrainer/trunk/plugins/garmintools/garmintools.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/plugins/googleearth/main.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/import/file_garmintcxv1.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv1.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/file_garmintcxv1.py 2010-04-14 08:56:33 UTC (rev 562) @@ -22,15 +22,14 @@ from lxml import etree from pytrainer.lib.xmlUtils import XMLParser -from pytrainer.lib.system import checkConf from pytrainer.lib.date import Date -#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush class garmintcxv1(): def __init__(self, parent = None, data_path = None): + logging.debug("init") self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) self.xmldoc = None Modified: pytrainer/trunk/import/file_garmintcxv2.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv2.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/file_garmintcxv2.py 2010-04-14 08:56:33 UTC (rev 562) @@ -23,14 +23,12 @@ from pytrainer.lib.date import Date from pytrainer.lib.xmlUtils import XMLParser -from pytrainer.lib.system import checkConf -#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush class garmintcxv2(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) self.xmldoc = None Modified: pytrainer/trunk/import/file_garmintools.py =================================================================== --- pytrainer/trunk/import/file_garmintools.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/file_garmintools.py 2010-04-14 08:56:33 UTC (rev 562) @@ -26,15 +26,11 @@ from lxml import etree from pytrainer.lib.date import Date -#from pytrainer.lib.xmlUtils import XMLParser -#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush -from pytrainer.lib.system import checkConf - class garmintools(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) self.xmldoc = None Modified: pytrainer/trunk/import/file_gpxplus.py =================================================================== --- pytrainer/trunk/import/file_gpxplus.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/file_gpxplus.py 2010-04-14 08:56:33 UTC (rev 562) @@ -23,15 +23,11 @@ from lxml import etree from pytrainer.lib.date import Date -#from pytrainer.lib.xmlUtils import XMLParser -#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush -from pytrainer.lib.system import checkConf - class gpxplus(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) self.xmldoc = None Modified: pytrainer/trunk/import/file_kml20.py =================================================================== --- pytrainer/trunk/import/file_kml20.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/file_kml20.py 2010-04-14 08:56:33 UTC (rev 562) @@ -25,16 +25,13 @@ from StringIO import StringIO from lxml import etree -from pytrainer.lib.xmlUtils import XMLParser -from pytrainer.lib.system import checkConf from pytrainer.lib.date import Date -#from pytrainer.gui.dialogs import fileChooserDialog, guiFlush class kml20(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) self.xmldoc = None Modified: pytrainer/trunk/import/tool_gant.py =================================================================== --- pytrainer/trunk/import/tool_gant.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/tool_gant.py 2010-04-14 08:56:33 UTC (rev 562) @@ -24,13 +24,12 @@ import dateutil.parser from dateutil.tz import * # for tzutc() -from pytrainer.lib.system import checkConf class gant(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) Modified: pytrainer/trunk/import/tool_garmintools.py =================================================================== --- pytrainer/trunk/import/tool_garmintools.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/tool_garmintools.py 2010-04-14 08:56:33 UTC (rev 562) @@ -24,13 +24,12 @@ import dateutil.parser from dateutil.tz import * # for tzutc() -from pytrainer.lib.system import checkConf class garmintools(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) Modified: pytrainer/trunk/import/tool_gpsbabel.py =================================================================== --- pytrainer/trunk/import/tool_gpsbabel.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/import/tool_gpsbabel.py 2010-04-14 08:56:33 UTC (rev 562) @@ -24,13 +24,12 @@ import dateutil.parser from dateutil.tz import * # for tzutc() -from pytrainer.lib.system import checkConf class gpsbabel(): def __init__(self, parent = None, data_path = None): self.parent = parent - self.conf = checkConf() - self.tmpdir = self.conf.getValue("tmpdir") + self.pytrainer_main = parent.parent + self.tmpdir = self.pytrainer_main.profile.tmpdir self.main_data_path = data_path self.data_path = os.path.dirname(__file__) Modified: pytrainer/trunk/plugins/garmin-gpx/garmingpx.py =================================================================== --- pytrainer/trunk/plugins/garmin-gpx/garmingpx.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmin-gpx/garmingpx.py 2010-04-14 08:56:33 UTC (rev 562) @@ -33,7 +33,7 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir self.validate = validate self.data_path = os.path.dirname(__file__) self.sport = self.getConfValue("Force_sport_to") Modified: pytrainer/trunk/plugins/garmin-hr/garminhr.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-04-14 08:56:33 UTC (rev 562) @@ -33,7 +33,7 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.input_dev = self.getConfValue("device") Modified: pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-04-14 08:56:33 UTC (rev 562) @@ -37,7 +37,7 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") Modified: pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py =================================================================== --- pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-04-14 08:56:33 UTC (rev 562) @@ -26,7 +26,7 @@ class garminTCXv2(): def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") Modified: pytrainer/trunk/plugins/garmintools/garmintools.py =================================================================== --- pytrainer/trunk/plugins/garmintools/garmintools.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmintools/garmintools.py 2010-04-14 08:56:33 UTC (rev 562) @@ -31,7 +31,7 @@ class garmintools(): def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-04-14 08:56:33 UTC (rev 562) @@ -43,8 +43,8 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.confdir = self.parent.conf.getValue("confdir") - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.confdir = self.parent.profile.confdir + self.tmpdir = self.parent.conf.profile.tmpdir # Tell garmintools where to save retrieved data from GPS device os.environ['GARMIN_SAVE_RUNS']=self.tmpdir self.data_path = os.path.dirname(__file__) Modified: pytrainer/trunk/plugins/googleearth/main.py =================================================================== --- pytrainer/trunk/plugins/googleearth/main.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/plugins/googleearth/main.py 2010-04-14 08:56:33 UTC (rev 562) @@ -29,7 +29,7 @@ self.parent = parent self.validate = validate self.data_path = os.path.dirname(__file__) - self.tmpdir = self.parent.conf.getValue("tmpdir") + self.tmpdir = self.parent.profile.tmpdir def run(self): logging.debug(">>") Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-14 08:33:10 UTC (rev 561) +++ pytrainer/trunk/pytrainer/main.py 2010-04-14 08:56:33 UTC (rev 562) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#561" + self.version ="1.7.2_svn#562" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-14 10:59:33
|
Revision: 563 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=563&view=rev Author: jblance Date: 2010-04-14 10:59:25 +0000 (Wed, 14 Apr 2010) Log Message: ----------- Allow Y1 axis customisation - min, max, line color and line weight Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/drawArea.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/recordgraph.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-14 08:56:33 UTC (rev 562) +++ pytrainer/trunk/glade/pytrainer.glade 2010-04-14 10:59:25 UTC (rev 563) @@ -1188,107 +1188,325 @@ <property name="can_focus">True</property> <property name="position_set">True</property> <child> - <widget class="GtkTable" id="tableConfig"> + <widget class="GtkVBox" id="vboxGraphYConfig"> <property name="visible">True</property> - <property name="n_rows">5</property> - <property name="n_columns">3</property> + <property name="orientation">vertical</property> <child> - <widget class="GtkLabel" id="labelY1Axis"> + <widget class="GtkLabel" id="labelGraphConfig"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes"><small>Y Axis</small></property> + <property name="label" translatable="yes"><small>Graph Display Options</small></property> <property name="use_markup">True</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options"></property> - <property name="y_options"></property> + <property name="expand">False</property> + <property name="position">0</property> </packing> </child> <child> - <widget class="GtkSpinButton" id="spinbuttonY1Min"> + <widget class="GtkFrame" id="frameYAxisLimits"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="width_chars">4</property> - <property name="adjustment">0 -500 1000 1 10 0</property> - <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="left_padding">10</property> + <child> + <widget class="GtkTable" id="tableConfig"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="labelY1AxisLimits"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="xpad">1</property> + <property name="label" translatable="yes"><small>Limits</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelYMin"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Min</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelYMax"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Max</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Min"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Max"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelY1LineColor"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Line Color</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkColorButton" id="colorbuttonY1LineColor"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="xalign">0</property> + <property name="color">#000000000000</property> + <signal name="color_set" handler="on_colorbuttonY1LineColor_color_set"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">3</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelY1LineWeight"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Line Weight</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1LineWeight"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">2</property> + <property name="invisible_char">●</property> + <property name="adjustment">1 0 10 1 1 0</property> + <signal name="value_changed" handler="on_spinbuttonY1LineWeight_value_changed"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="labelY1Axis"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Y1 Axis</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_SHRINK</property> - <property name="y_options">GTK_SHRINK</property> + <property name="position">1</property> </packing> </child> <child> - <widget class="GtkSpinButton" id="spinbuttonY1Max"> + <widget class="GtkFrame" id="frameY2Axis"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="width_chars">4</property> - <property name="adjustment">0 -500 1000 1 10 0</property> - <signal name="value_changed" handler="on_spinbuttonY1_value_changed"/> + <property name="sensitive">False</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="left_padding">10</property> + <child> + <widget class="GtkTable" id="tableConfig1"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="labelY1AxisLimits1"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><small>Limits</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelYMin1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Min</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelYMax1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Max</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Min2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1Max2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="labelY2Axis"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Y2 Axis</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> </widget> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_SHRINK</property> - <property name="y_options">GTK_SHRINK</property> + <property name="position">2</property> </packing> </child> <child> - <widget class="GtkLabel" id="labelGraphConfig"> - <property name="visible">True</property> - <property name="label" translatable="yes"><small>Graph Display Options</small></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="right_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - <child> <widget class="GtkButton" id="buttonResetGraph"> <property name="label" translatable="yes">Reset Graph</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="tooltip" translatable="yes">Reset Graph display to original settings</property> + <property name="has_tooltip">True</property> <property name="yalign">1</property> <signal name="clicked" handler="on_buttonResetGraph_clicked"/> </widget> <packing> - <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options"></property> - <property name="y_options">GTK_EXPAND</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">3</property> </packing> </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </widget> <packing> <property name="resize">False</property> Modified: pytrainer/trunk/pytrainer/gui/drawArea.py =================================================================== --- pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-14 08:56:33 UTC (rev 562) +++ pytrainer/trunk/pytrainer/gui/drawArea.py 2010-04-14 10:59:25 UTC (rev 563) @@ -273,7 +273,7 @@ logging.debug('<<') - def drawPlot(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None,xzones=None, ylimits=None): + def drawPlot(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None,xzones=None, ylimits=None, y1_linewidth=None): logging.debug('>>') logging.debug("Type: plot | title: "+str(title)+" | col: "+str(color)+" | xlabel: "+str(xlabel)+" | ylabel: "+str(ylabel)) logging.debug('xlabel: '+str(xlabel)+' | ylabel: '+str(ylabel)+' | title: '+str(title)) @@ -284,7 +284,10 @@ for value in xvalues: if i<1: axis = figure.add_subplot(111) - axis.plot(xvalues[i],yvalues[i], color=color[i]) + line = axis.plot(xvalues[i],yvalues[i], color=color[i]) + if y1_linewidth is not None: + line[0].set_linewidth(y1_linewidth) + linewidth = line[0].get_linewidth() axis.grid(True) for tl in axis.get_yticklabels(): @@ -334,7 +337,7 @@ logging.debug('Child available: '+str(child)) logging.debug('<<') - return (ylim_min, ylim_max) + return {'y1_min': ylim_min, 'y1_max': ylim_max, 'y1_linewidth': linewidth} def drawPie(self,xvalues,yvalues,xlabel,ylabel,title,color,zones=None): logging.debug('>>') Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-14 08:56:33 UTC (rev 562) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-14 10:59:25 UTC (rev 563) @@ -55,6 +55,9 @@ self.gpxDir = gpxDir self.record_list = None self.laps = None + self.y1_limits = None + self.y1_color = None + self.y1_linewidth = 1 def new(self): self.testimport = self.pytrainer_main.startup_options.testimport @@ -809,10 +812,10 @@ def createWaypointEditor(self,WaypointEditor,waypoint, parent=None): self.waypointeditor = WaypointEditor(self.data_path, self.waypointvbox,waypoint,parent) - def zoom_graph(self, ylimits=None): + def zoom_graph(self, y1limits=None, y1color=None, y1_linewidth=1): logging.debug(">>") - logging.debug("Reseting graph Y axis with ylimits: %s" % str(ylimits) ) - self.drawarearecord.drawgraph(self.record_list,self.laps, ylimits=ylimits) + logging.debug("Reseting graph Y axis with ylimits: %s" % str(y1limits) ) + self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=y1limits, y1color=y1color, y1_linewidth=y1_linewidth) logging.debug("<<") ###################### @@ -820,18 +823,34 @@ ###################### def on_spinbuttonY1_value_changed(self, widget): - ymin = self.spinbuttonY1Min.get_value() - ymax = self.spinbuttonY1Max.get_value() + y1min = self.spinbuttonY1Min.get_value() + y1max = self.spinbuttonY1Max.get_value() #Check to see if the min and max have the same... - if ymin == ymax: + if y1min == y1max: if widget.get_name() == "spinbuttonY1Min": #User was changing the min spinbutton, so move max up - ymax += 1 + y1max += 1 else: #Move min down - ymin -= 1 - self.zoom_graph(ylimits=(ymin, ymax)) + y1min -= 1 + self.y1_limits=(y1min, y1max) + self.zoom_graph(y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) def on_buttonResetGraph_clicked(self, widget): + #self.zoom_graph() + #Reset stored values + self.y1_limits = None + self.y1_color = None + self.y1_linewidth = 1 self.zoom_graph() + + def on_colorbuttonY1LineColor_color_set(self, widget): + y1color = widget.get_color() + cs = y1color.to_string() + self.y1_color = cs[0:3] + cs[5:7] + cs[9:11] + self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) + + def on_spinbuttonY1LineWeight_value_changed(self, widget): + self.y1_linewidth = self.spinbuttonY1LineWeight.get_value_as_int() + self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) def on_edit_clicked(self,widget): selected,iter = self.recordTreeView.get_selection().get_selected() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-14 08:56:33 UTC (rev 562) +++ pytrainer/trunk/pytrainer/main.py 2010-04-14 10:59:25 UTC (rev 563) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#562" + self.version ="1.7.2_svn#563" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() Modified: pytrainer/trunk/pytrainer/recordgraph.py =================================================================== --- pytrainer/trunk/pytrainer/recordgraph.py 2010-04-14 08:56:33 UTC (rev 562) +++ pytrainer/trunk/pytrainer/recordgraph.py 2010-04-14 10:59:25 UTC (rev 563) @@ -30,7 +30,7 @@ self.config_table = tableConfig logging.debug("<<") - def drawgraph(self,values,laps=None, ylimits=None): + def drawgraph(self,values,laps=None, y1limits=None, y1color=None, y1_linewidth=1): logging.debug(">>") #Get the config options for child in self.config_table.get_children(): @@ -38,6 +38,11 @@ spinbuttonY1Max = child elif child.get_name() == "spinbuttonY1Min": spinbuttonY1Min = child + elif child.get_name() == "colorbuttonY1LineColor": + colorbuttonY1LineColor = child + elif child.get_name() == "spinbuttonY1LineWeight": + spinbuttonY1LineWeight = child + xval = [] yval = [] xlab = [] @@ -72,6 +77,11 @@ max_yvalue = max(yvalues) min_yvalue = min(yvalues) xlabel,ylabel,title,color = self.get_value_params(value_selected) + if y1color is not None: + _color = gtk.gdk.Color(y1color) + color = y1color + else: + _color = gtk.gdk.Color(color) xval.append(xvalues) yval.append(yvalues) @@ -83,6 +93,9 @@ tit.append(title) col.append(color) + #_color = gtk.gdk.Color(color) + colorbuttonY1LineColor.set_color(_color) + if value_selected2 > 0: value_selected2 = value_selected2-1 xlabel,ylabel,title,color = self.get_value_params(value_selected2) @@ -97,7 +110,10 @@ col.append(color) logging.info("To show: tit: "+str(tit)+" | col: "+str(col)+" | xlab: "+str(xlab)+" | ylab: "+str(ylab)) #self.drawPlot(xvalues,yvalues,xlabel,ylabel,title,color,zones) - ymin, ymax = self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues, ylimits=ylimits) + plot_stats = self.drawarea.drawPlot(xval,yval,xlab,ylab,tit,col,None,lapValues, ylimits=y1limits, y1_linewidth=y1_linewidth) + ymin = plot_stats['y1_min'] + ymax = plot_stats['y1_max'] + y1_linewidth = plot_stats['y1_linewidth'] max_yvalue = max(max_yvalue, ymax) min_yvalue = min(min_yvalue, ymin) @@ -107,6 +123,8 @@ spinbuttonY1Max.set_adjustment(adjY1Max) spinbuttonY1Min.set_value(ymin) spinbuttonY1Max.set_value(ymax) + spinbuttonY1LineWeight.set_value(y1_linewidth) + logging.debug("<<") def get_value_params(self,value): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-15 08:49:17
|
Revision: 565 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=565&view=rev Author: jblance Date: 2010-04-15 08:49:07 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Bug fixes for global variables, thanks to Druzee and DGranda Modified Paths: -------------- pytrainer/trunk/plugins/garmintools/garmintools.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/pytrainer/gui/windowprofile.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/plugins.py Removed Paths: ------------- pytrainer/trunk/pytrainer/lib/system.py Modified: pytrainer/trunk/plugins/garmintools/garmintools.py =================================================================== --- pytrainer/trunk/plugins/garmintools/garmintools.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/plugins/garmintools/garmintools.py 2010-04-15 08:49:07 UTC (rev 565) @@ -31,7 +31,8 @@ class garmintools(): def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.tmpdir = self.pytrainer_main.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") @@ -39,7 +40,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -93,7 +94,7 @@ def inDatabase(self, tree): #comparing date and start time (sport may have been changed in DB after import) time = self.detailsFromFile(tree) - if self.parent.parent.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): + if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): return True else: return False Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-04-15 08:49:07 UTC (rev 565) @@ -43,8 +43,9 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.confdir = self.parent.profile.confdir - self.tmpdir = self.parent.conf.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.confdir = self.pytrainer_main.profile.confdir + self.tmpdir = self.pytrainer_main.profile.tmpdir # Tell garmintools where to save retrieved data from GPS device os.environ['GARMIN_SAVE_RUNS']=self.tmpdir self.data_path = os.path.dirname(__file__) @@ -64,7 +65,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -93,7 +94,7 @@ if len(selectedFiles) > 0: logging.info("Dumping "+str(len(selectedFiles))+" binary files found") dumpFiles = self.dumpBinaries(selectedFiles) - self.listStringDBUTC = self.parent.parent.ddbb.select("records","date_time_utc") + self.listStringDBUTC = self.pytrainer_main.ddbb.select("records","date_time_utc") if self.maxGap > 0: logging.info("Starting import. Comparison will be made with "+str(self.maxGap)+" seconds interval") else: Modified: pytrainer/trunk/pytrainer/gui/windowprofile.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-04-15 08:49:07 UTC (rev 565) @@ -31,7 +31,8 @@ self.pytrainer_main = pytrainer_main self.data_path = data_path SimpleGladeApp.__init__(self, data_path+glade_path, root, domain) - self.conf_options = [ + self.conf_options = parent.profile_options + ''''self.conf_options = [ "prf_name", "prf_gender", "prf_weight", @@ -46,7 +47,7 @@ "prf_minhr", "prf_hrzones_karvonen", "prf_us_system" - ] + ]''' def new(self): self.gender_options = { @@ -76,10 +77,13 @@ def setValues(self,list_options): - for i in self.conf_options: + for i in self.conf_options.keys(): if not list_options.has_key(i): continue - var = getattr(self,i) + try: + var = getattr(self,i) + except AttributeError as e: + continue if i != "prf_gender" and i != "prf_ddbb" and i !="prf_hrzones_karvonen" and i!="prf_us_system": var.set_text(list_options[i]) elif i == "prf_hrzones_karvonen" or i == "prf_us_system": @@ -99,18 +103,25 @@ self._ddbb_value_active() def saveOptions(self): - list_options = [] - for i in self.conf_options: - var = getattr(self,i) + list_options = {} + for i in self.conf_options.keys(): + try: + var = getattr(self,i) + except AttributeError as e: + continue if i != "prf_gender" and i != "prf_ddbb" and i != "prf_hrzones_karvonen" and i != "prf_us_system": - list_options.append((i,var.get_text())) + #list_options.append((i,var.get_text())) + list_options[i] = var.get_text() elif i == "prf_hrzones_karvonen" or i == "prf_us_system": if var.get_active(): - list_options.append((i,"True")) + #list_options.append((i,"True")) + list_options[i] = "True" else: - list_options.append((i,"False")) + #list_options.append((i,"False")) + list_options[i] = "False" else: - list_options.append((i,var.get_active_text())) + #list_options.append((i,var.get_active_text())) + list_options[i] = var.get_active_text() self.parent.setProfile(list_options) def on_calendar_clicked(self,widget): Deleted: pytrainer/trunk/pytrainer/lib/system.py =================================================================== --- pytrainer/trunk/pytrainer/lib/system.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/pytrainer/lib/system.py 2010-04-15 08:49:07 UTC (rev 565) @@ -1,25 +0,0 @@ -# -*- coding: iso-8859-1 -*- - -#Copyright (C) Fiz Vazquez vu...@si... - -#This program is free software; you can redistribute it and/or -#modify it under the terms of the GNU General Public License -#as published by the Free Software Foundation; either version 2 -#of the License, or (at your option) any later version. - -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -import os -import sys - -class checkConf: - def __init__(self): - print "ERROR system.py not used anymore" - raise Exception Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/pytrainer/main.py 2010-04-15 08:49:07 UTC (rev 565) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#564" + self.version ="1.7.2_svn#565" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() Modified: pytrainer/trunk/pytrainer/plugins.py =================================================================== --- pytrainer/trunk/pytrainer/plugins.py 2010-04-14 11:11:42 UTC (rev 564) +++ pytrainer/trunk/pytrainer/plugins.py 2010-04-15 08:49:07 UTC (rev 565) @@ -103,7 +103,7 @@ def getPluginConfParams(self,pathPlugin): info = XMLParser(pathPlugin+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): params = info.getAllValues("conf-values") params.append(("status","0")) @@ -119,7 +119,7 @@ def setPluginConfParams(self,pathPlugin,savedOptions): info = XMLParser(pathPlugin+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.conf.getValue("plugindir")+"/"+code + plugindir = self.pytrainer_main.profile.plugindir+"/"+code if not os.path.isdir(plugindir): os.mkdir(plugindir) if not os.path.isfile(plugindir+"/conf.xml"): @@ -129,6 +129,6 @@ info.createXMLFile("pytrainer-plugin",savedOptions) def getCodeConfValue(self,code,value): - plugindir = self.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir info = XMLParser(plugindir+"/"+code+"/conf.xml") return info.getValue("pytrainer-plugin",value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-15 09:08:02
|
Revision: 566 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=566&view=rev Author: jblance Date: 2010-04-15 09:07:55 +0000 (Thu, 15 Apr 2010) Log Message: ----------- More global variables fixes... Modified Paths: -------------- pytrainer/trunk/plugins/garmin-gpx/garmingpx.py pytrainer/trunk/plugins/garmin-hr/garminhr.py pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py pytrainer/trunk/plugins/googleearth/main.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/plugins/garmin-gpx/garmingpx.py =================================================================== --- pytrainer/trunk/plugins/garmin-gpx/garmingpx.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/plugins/garmin-gpx/garmingpx.py 2010-04-15 09:07:55 UTC (rev 566) @@ -33,7 +33,8 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.tmpdir = self.pytrainer_main.profile.tmpdir self.validate = validate self.data_path = os.path.dirname(__file__) self.sport = self.getConfValue("Force_sport_to") @@ -41,7 +42,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -77,8 +78,8 @@ return True else: #To validate GPX as used for pytrainer must test against both Topograpfix and Cluetrust - topografixXSLfile = os.path.realpath(self.parent.parent.data_path)+ "/schemas/Topografix_gpx11.xsd" - cluetrustXSLfile = os.path.realpath(self.parent.parent.data_path)+ "/schemas/Cluetrust_gpxdata10.xsd" + topografixXSLfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/Topografix_gpx11.xsd" + cluetrustXSLfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/Cluetrust_gpxdata10.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, topografixXSLfile) and validator.validateXSL(filename, cluetrustXSLfile) @@ -89,7 +90,7 @@ only valid for GPX files with a single activity """ time = self.detailsFromGPX(filename) - if self.parent.parent.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): + if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): return True else: return False @@ -110,5 +111,3 @@ return None else: return timeElement.text - - Modified: pytrainer/trunk/plugins/garmin-hr/garminhr.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-04-15 09:07:55 UTC (rev 566) @@ -33,7 +33,8 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.tmpdir = self.pytrainer_main.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.input_dev = self.getConfValue("device") @@ -42,7 +43,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -124,7 +125,7 @@ logging.debug("Not validating %s" % (filename) ) return True else: #Validate TCXv1, note are validating against gpsbabels 'broken' result... - xslfile = os.path.realpath(self.parent.parent.data_path)+ "/schemas/GarminTrainingCenterDatabase_v1-gpsbabel.xsd" + xslfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/GarminTrainingCenterDatabase_v1-gpsbabel.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, xslfile) @@ -157,7 +158,7 @@ else: time = timeElement.text #comparing date and start time (sport may have been changed in DB after import) - if self.parent.parent.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): + if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): logging.debug("Not importing track for time %s" % (time)) return False else: Modified: pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-04-15 09:07:55 UTC (rev 566) @@ -37,7 +37,8 @@ """ def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.tmpdir = self.pytrainer_main.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") @@ -45,7 +46,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -86,7 +87,7 @@ logging.debug("Not validating %s" % (filename) ) return True else: #Validate TCXv1, note are validating against gpsbabels 'broken' result... - xslfile = os.path.realpath(self.parent.parent.data_path)+ "/schemas/GarminTrainingCenterDatabase_v1-gpsbabel.xsd" + xslfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/GarminTrainingCenterDatabase_v1-gpsbabel.xsd" from lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, xslfile) @@ -103,7 +104,7 @@ else: time = timeElement.text #comparing date and start time (sport may have been changed in DB after import) - if self.parent.parent.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): + if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): logging.debug("Not importing track for time %s" % (time)) return False else: @@ -132,4 +133,3 @@ transform = etree.XSLT(xslt_doc) result_tree = transform(track) result_tree.write(gpxfile, xml_declaration=True) - Modified: pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py =================================================================== --- pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-04-15 09:07:55 UTC (rev 566) @@ -26,7 +26,8 @@ class garminTCXv2(): def __init__(self, parent = None, validate=False): self.parent = parent - self.tmpdir = self.parent.profile.tmpdir + self.pytrainer_main = parent.pytrainer_main + self.tmpdir = self.pytrainer_main.profile.tmpdir self.data_path = os.path.dirname(__file__) self.validate = validate self.sport = self.getConfValue("Force_sport_to") @@ -34,7 +35,7 @@ def getConfValue(self, confVar): info = XMLParser(self.data_path+"/conf.xml") code = info.getValue("pytrainer-plugin","plugincode") - plugindir = self.parent.conf.getValue("plugindir") + plugindir = self.pytrainer_main.profile.plugindir if not os.path.isfile(plugindir+"/"+code+"/conf.xml"): value = None else: @@ -74,7 +75,7 @@ logging.debug("Not validating %s" % (filename) ) return True else: - xslfile = os.path.realpath(self.parent.parent.data_path)+ "/schemas/GarminTrainingCenterDatabase_v2.xsd" + xslfile = os.path.realpath(self.pytrainer_main.data_path)+ "/schemas/GarminTrainingCenterDatabase_v2.xsd" from pytrainer.lib.xmlValidation import xmlValidator validator = xmlValidator() return validator.validateXSL(filename, xslfile) @@ -89,7 +90,7 @@ def inDatabase(self, activity): #comparing date and start time (sport may have been changed in DB after import) time = self.detailsFromTCX(activity) - if self.parent.parent.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): + if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): return True else: return False @@ -121,4 +122,3 @@ xml_doc = activity result_tree = transform(xml_doc) result_tree.write(gpxfile, xml_declaration=True) - Modified: pytrainer/trunk/plugins/googleearth/main.py =================================================================== --- pytrainer/trunk/plugins/googleearth/main.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/plugins/googleearth/main.py 2010-04-15 09:07:55 UTC (rev 566) @@ -27,9 +27,10 @@ class googleearth(): def __init__(self, parent = None, validate=False): self.parent = parent + self.pytrainer_main = parent.pytrainer_main self.validate = validate self.data_path = os.path.dirname(__file__) - self.tmpdir = self.parent.profile.tmpdir + self.tmpdir = self.pytrainer_main.profile.tmpdir def run(self): logging.debug(">>") Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-15 08:49:07 UTC (rev 565) +++ pytrainer/trunk/pytrainer/main.py 2010-04-15 09:07:55 UTC (rev 566) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#565" + self.version ="1.7.2_svn#566" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-04-15 10:06:53
|
Revision: 567 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=567&view=rev Author: jblance Date: 2010-04-15 10:06:46 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Remove negative width warning Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-15 09:07:55 UTC (rev 566) +++ pytrainer/trunk/glade/pytrainer.glade 2010-04-15 10:06:46 UTC (rev 567) @@ -1211,15 +1211,14 @@ <property name="visible">True</property> <property name="left_padding">10</property> <child> - <widget class="GtkTable" id="tableConfig"> + <widget class="GtkTable" id="tableConfigY1"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">3</property> <child> <widget class="GtkLabel" id="labelY1AxisLimits"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="xpad">1</property> <property name="label" translatable="yes"><small>Limits</small></property> <property name="use_markup">True</property> </widget> @@ -1293,7 +1292,7 @@ <widget class="GtkLabel" id="labelY1LineColor"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes"><small>Line Color</small></property> + <property name="label" translatable="yes"><small>Color</small></property> <property name="use_markup">True</property> </widget> <packing> @@ -1313,7 +1312,7 @@ </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">3</property> + <property name="right_attach">2</property> <property name="top_attach">2</property> <property name="bottom_attach">3</property> <property name="x_options">GTK_SHRINK</property> @@ -1324,7 +1323,7 @@ <widget class="GtkLabel" id="labelY1LineWeight"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="yes"><small>Line Weight</small></property> + <property name="label" translatable="yes"><small>Weight</small></property> <property name="use_markup">True</property> </widget> <packing> @@ -1339,12 +1338,12 @@ <property name="can_focus">True</property> <property name="max_length">2</property> <property name="invisible_char">●</property> - <property name="adjustment">1 0 10 1 1 0</property> + <property name="adjustment">1 1 10 1 1 0</property> <signal name="value_changed" handler="on_spinbuttonY1LineWeight_value_changed"/> </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">3</property> + <property name="right_attach">2</property> <property name="top_attach">3</property> <property name="bottom_attach">4</property> <property name="x_options">GTK_SHRINK</property> @@ -1352,24 +1351,68 @@ </packing> </child> <child> + <widget class="GtkLabel" id="labelY1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Y1</property> + </widget> + <packing> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelY1LineSmoothing"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Smoothing</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY1LineSmoothing"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="max_length">2</property> + <property name="invisible_char">●</property> + <property name="adjustment">1 0 10 1 1 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </widget> </child> </widget> </child> <child> - <widget class="GtkLabel" id="labelY1Axis"> - <property name="visible">True</property> - <property name="label" translatable="yes"><small>Y1 Axis</small></property> - <property name="use_markup">True</property> - </widget> + <placeholder/> <packing> <property name="type">label_item</property> </packing> </child> </widget> <packing> + <property name="expand">False</property> <property name="position">1</property> </packing> </child> @@ -1383,26 +1426,25 @@ <property name="visible">True</property> <property name="left_padding">10</property> <child> - <widget class="GtkTable" id="tableConfig1"> + <widget class="GtkTable" id="tableConfigY2"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">5</property> <property name="n_columns">3</property> <child> - <widget class="GtkLabel" id="labelY1AxisLimits1"> + <widget class="GtkLabel" id="labelY2AxisLimits"> <property name="visible">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="label" translatable="yes"><small>Limits</small></property> <property name="use_markup">True</property> </widget> <packing> <property name="top_attach">1</property> <property name="bottom_attach">2</property> - <property name="x_options"></property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="labelYMin1"> + <widget class="GtkLabel" id="labelY2Min"> <property name="visible">True</property> <property name="label" translatable="yes"><small>Min</small></property> <property name="use_markup">True</property> @@ -1414,7 +1456,7 @@ </packing> </child> <child> - <widget class="GtkLabel" id="labelYMax1"> + <widget class="GtkLabel" id="labelY2Max"> <property name="visible">True</property> <property name="label" translatable="yes"><small>Max</small></property> <property name="use_markup">True</property> @@ -1426,7 +1468,7 @@ </packing> </child> <child> - <widget class="GtkSpinButton" id="spinbuttonY1Min2"> + <widget class="GtkSpinButton" id="spinbuttonY2Min"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> @@ -1443,12 +1485,12 @@ </packing> </child> <child> - <widget class="GtkSpinButton" id="spinbuttonY1Max2"> + <widget class="GtkSpinButton" id="spinbuttonY2Max"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="width_chars">4</property> - <property name="adjustment">0 -500 1000 1 10 0</property> + <property name="adjustment">1 -500 1000 1 10 0</property> </widget> <packing> <property name="left_attach">2</property> @@ -1460,9 +1502,75 @@ </packing> </child> <child> - <placeholder/> + <widget class="GtkLabel" id="labelY2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Y2</property> + </widget> + <packing> + <property name="y_options"></property> + </packing> </child> <child> + <widget class="GtkLabel" id="labelY2LineColor"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Color</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelY2LineWeight"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Weight</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkColorButton" id="colorbuttonY2LineColor"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="xalign">0</property> + <property name="color">#000000000000</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY2LineWeight"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">2</property> + <property name="invisible_char">●</property> + <property name="adjustment">1 0 10 1 1 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> <placeholder/> </child> <child> @@ -1471,23 +1579,227 @@ <child> <placeholder/> </child> + <child> + <widget class="GtkLabel" id="labelY2LineSmoothing"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Smoothing</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonY2LineSmoothing"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="max_length">2</property> + <property name="invisible_char">●</property> + <property name="adjustment">1 0 10 1 1 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> </widget> </child> </widget> </child> <child> - <widget class="GtkLabel" id="labelY2Axis"> + <placeholder/> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frameXAxis"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment6"> <property name="visible">True</property> - <property name="label" translatable="yes"><small>Y2 Axis</small></property> - <property name="use_markup">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkTable" id="tableConfigX"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="labelX"> + <property name="visible">True</property> + <property name="label" translatable="yes">X</property> + </widget> + <packing> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelXAxisLimits"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Limits</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonXMin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkSpinButton" id="spinbuttonXMax"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="width_chars">4</property> + <property name="adjustment">0 -500 1000 1 10 0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_SHRINK</property> + <property name="y_options">GTK_SHRINK</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelXMin"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Min</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelXMax"> + <property name="visible">True</property> + <property name="label" translatable="yes"><small>Max</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelXAxisDistance"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Distance</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkRadioButton" id="radiobuttonDistance"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_EXPAND</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <widget class="GtkLabel" id="labelXAxisTime"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Time</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkRadioButton" id="radiobuttonTime"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobuttonDistance</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_EXPAND</property> + </packing> + </child> + </widget> + </child> </widget> + </child> + <child> + <placeholder/> <packing> <property name="type">label_item</property> </packing> </child> </widget> <packing> - <property name="position">2</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">4</property> </packing> </child> <child> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-15 09:07:55 UTC (rev 566) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-15 10:06:46 UTC (rev 567) @@ -140,7 +140,7 @@ self.parent.runExtension(extension,id) def createGraphs(self,RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph): - self.drawarearecord = RecordGraph(self.record_graph_vbox, self.window1, self.record_combovalue, self.record_combovalue2, self.btnShowLaps, self.tableConfig) + self.drawarearecord = RecordGraph(self.record_graph_vbox, self.window1, self.record_combovalue, self.record_combovalue2, self.btnShowLaps, self.tableConfigY1) self.drawareaheartrate = HeartRateGraph(self.heartrate_vbox, self.window1, self.heartrate_vbox2, pytrainer_main=self.pytrainer_main) #self.drawareaday = DayGraph(self.day_vbox, self.day_combovalue) self.day_vbox.hide() @@ -822,11 +822,15 @@ ## Lista de eventos ## ###################### + def on_hpaned1_move_handle(self, widget): + print "Handler" + print widget + def on_spinbuttonY1_value_changed(self, widget): y1min = self.spinbuttonY1Min.get_value() y1max = self.spinbuttonY1Max.get_value() #Check to see if the min and max have the same... - if y1min == y1max: + if y1min == y1max: if widget.get_name() == "spinbuttonY1Min": #User was changing the min spinbutton, so move max up y1max += 1 else: #Move min down Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-15 09:07:55 UTC (rev 566) +++ pytrainer/trunk/pytrainer/main.py 2010-04-15 10:06:46 UTC (rev 567) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#566" + self.version ="1.7.2_svn#567" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-04-30 08:52:24
|
Revision: 571 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=571&view=rev Author: dgranda Date: 2010-04-30 08:52:15 +0000 (Fri, 30 Apr 2010) Log Message: ----------- Start building interface to enable equipment handling Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2010-04-17 14:02:34 UTC (rev 570) +++ pytrainer/trunk/glade/profile.glade 2010-04-30 08:52:15 UTC (rev 571) @@ -6,7 +6,6 @@ <property name="visible">True</property> <property name="title" translatable="yes">Preferences</property> <property name="icon">logo_mini.png</property> - <signal name="destroy" handler="gtk_main_quit"/> <child> <widget class="GtkVBox" id="vbox4"> <property name="visible">True</property> @@ -1605,7 +1604,7 @@ <child> <widget class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="n_rows">5</property> + <property name="n_rows">6</property> <property name="n_columns">3</property> <child> <widget class="GtkLabel" id="labelLogLevel"> @@ -1832,6 +1831,51 @@ <property name="bottom_attach">5</property> </packing> </child> + <child> + <widget class="GtkLabel" id="labelEquip"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="label" translatable="yes">Equipment handling</property> + </widget> + <packing> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="checkbuttonEquip"> + <property name="label" translatable="yes">--equip</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelEquipDescription"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + <property name="label" translatable="yes"><small>Want to track equipment?</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + </packing> + </child> </widget> </child> </widget> Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-17 14:02:34 UTC (rev 570) +++ pytrainer/trunk/pytrainer/main.py 2010-04-30 08:52:15 UTC (rev 571) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#569" + self.version ="1.7.2_svn#571" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -124,7 +124,7 @@ For more help on valid options try: %prog -h ''' parser = OptionParser(usage=usage) - parser.set_defaults(log_level=logging.ERROR, validate=False, gm3=True, testimport=False) + parser.set_defaults(log_level=logging.ERROR, validate=False, gm3=True, testimport=False, equip=False) parser.add_option("-d", "--debug", action="store_const", const=logging.DEBUG, dest="log_level", help="enable logging at debug level") parser.add_option("-i", "--info", action="store_const", const=logging.INFO, dest="log_level", help="enable logging at info level") parser.add_option("-w", "--warn", action="store_const", const=logging.WARNING, dest="log_level", help="enable logging at warning level") @@ -132,6 +132,7 @@ parser.add_option("--check", action="store_true", dest="check", help="triggers database (only sqlite based) and configuration file sanity checks, adding fields if necessary. Backup of database is done before any change. Details at info or debug logging level") parser.add_option("--gmaps2", action="store_false", dest="gm3", help="Use old Google Maps API version (v2)") parser.add_option("--testimport", action="store_true", dest="testimport", help="EXPERIMENTAL: show new import functionality - for testing only USE AT YOUR OWN RISK") + parser.add_option("--equip", action="store_false", dest="equip", help="EXPERIMENTAL: enable equipment management") (options, args) = parser.parse_args() return options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-05-01 08:49:34
|
Revision: 573 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=573&view=rev Author: dgranda Date: 2010-05-01 08:49:28 +0000 (Sat, 01 May 2010) Log Message: ----------- Restoring quit handler in glade files and making some labels non translatable Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2010-04-30 13:56:48 UTC (rev 572) +++ pytrainer/trunk/glade/profile.glade 2010-05-01 08:49:28 UTC (rev 573) @@ -6,6 +6,7 @@ <property name="visible">True</property> <property name="title" translatable="yes">Preferences</property> <property name="icon">logo_mini.png</property> + <signal name="destroy" handler="quit"/> <child> <widget class="GtkVBox" id="vbox4"> <property name="visible">True</property> @@ -173,7 +174,7 @@ <child> <widget class="GtkComboBoxEntry" id="prf_ddbb"> <property name="visible">True</property> - <property name="items" translatable="yes"></property> + <property name="items" translatable="no"></property> <signal name="changed" handler="on_prf_ddbb_changed"/> </widget> <packing> @@ -403,7 +404,7 @@ <child> <widget class="GtkComboBoxEntry" id="prf_gender"> <property name="visible">True</property> - <property name="items" translatable="yes"></property> + <property name="items" translatable="no"></property> </widget> <packing> <property name="left_attach">1</property> @@ -1037,7 +1038,7 @@ </child> <child> <widget class="GtkLabel" id="sportnamedel"> - <property name="label" translatable="yes">label-2147483648</property> + <property name="label" translatable="no">label-2147483648</property> </widget> <packing> <property name="expand">False</property> @@ -1661,7 +1662,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonValidate"> - <property name="label" translatable="yes">--valid</property> + <property name="label" translatable="no">--valid</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1707,7 +1708,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonCheck"> - <property name="label" translatable="yes">--check</property> + <property name="label" translatable="no">--check</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1753,7 +1754,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonGM3"> - <property name="label" translatable="yes">--gmaps2*</property> + <property name="label" translatable="no">--gmaps2*</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1800,7 +1801,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonUnifiedImport"> - <property name="label" translatable="yes">--testimport</property> + <property name="label" translatable="no">--testimport</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1846,7 +1847,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonEquip"> - <property name="label" translatable="yes">--equip</property> + <property name="label" translatable="no">--equip</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">False</property> Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-04-30 13:56:48 UTC (rev 572) +++ pytrainer/trunk/glade/pytrainer.glade 2010-05-01 08:49:28 UTC (rev 573) @@ -6,6 +6,7 @@ <property name="visible">True</property> <property name="title" translatable="no">window1</property> <property name="icon">logo_mini.png</property> + <signal name="destroy" handler="quit"/> <child> <widget class="GtkNotebook" id="notebook7"> <property name="visible">True</property> Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-30 13:56:48 UTC (rev 572) +++ pytrainer/trunk/pytrainer/main.py 2010-05-01 08:49:28 UTC (rev 573) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#571" + self.version ="1.7.2_svn#573" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-05-15 06:05:34
|
Revision: 577 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=577&view=rev Author: jblance Date: 2010-05-15 06:05:28 +0000 (Sat, 15 May 2010) Log Message: ----------- Update to wordpress extension to upload using XML POST - committing changes made with Brian to get extension working Modified Paths: -------------- pytrainer/trunk/extensions/wordpress/wordpress.py pytrainer/trunk/extensions/wordpress/wordpresslib.py pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/extensions/googlemaps.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/extensions/wordpress/wordpress.py =================================================================== --- pytrainer/trunk/extensions/wordpress/wordpress.py 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/extensions/wordpress/wordpress.py 2010-05-15 06:05:28 UTC (rev 577) @@ -1,10 +1,31 @@ -#!/usr/bin/env python -from optparse import OptionParser +# -*- coding: iso-8859-1 -*- + +#Copyright (C) Fiz Vazquez vu...@si... + +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. + +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + import os import sys +import shutil +import logging -import wordpresslib -import googlemaps +import gtk +import httplib2 + +import wordpresslib #TODO remove need for this library +import googlemaps #TODO remove this separate googlemaps class import pytrainer.lib.points as Points from pytrainer.lib.date import Date @@ -17,56 +38,122 @@ self.conf_dir = conf_dir def run(self, id): + #Show user something is happening + msg = _("Posting to Wordpress blog") + md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE, msg) + md.set_title(_("Wordpress Extension Processing")) + md.set_modal(True) + md.show() + while gtk.events_pending(): # This allows the GUI to update + gtk.main_iteration() # before completion of this entire action + logging.debug("before request posting") options = self.options self.wordpressurl = options["wordpressurl"] self.user = options["wordpressuser"] self.password = options["wordpresspass"] - self.gpxfile = "%s/gpx/%s.gpx " %(self.conf_dir,id) + self.gpxfile = "%s/gpx/%s.gpx" %(self.conf_dir,id) self.googlekey = options["googlekey"] self.idrecord = id #options.idrecord self.wordpresscategory = options["wordpresscategory"] - print self.wordpressurl, self.user, self.password, self.gpxfile, self.googlekey, self.googlekey, self.idrecord, self.wordpresscategory - + debug_msg = "%s, %s, %s, %s, %s, %s" % (self.wordpressurl, self.user, self.gpxfile, self.googlekey, self.idrecord, self.wordpresscategory) + logging.debug(debug_msg) try: - self.wp = wordpresslib.WordPressClient(self.wordpressurl, self.user, self.password) + self.wp = wordpresslib.WordPressClient(self.wordpressurl, self.user, self.password) #TODO remove need for wordpresslib?? self.error = False except: self.error = True self.log = "Url, user or pass are incorrect. Please, check your configuration" self.loadRecordInfo() - blog_title = self.createTitle() - blog_category = self.createCategory() + if self.title is None: + self.title = "No Title" + blog_route = self.createRoute() + blog_body = self.createBody() + blog_table = self.createTable() + blog_figureHR = self.createFigureHR() + blog_figureStage = self.createFigureStage() + blog_foot = self.createFoot() + + self.description = "<![CDATA["+blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot+"]]>" + xmlstuff = '''<methodCall> +<methodName>metaWeblog.newPost</methodName> +<params> +<param> +<value> +<string>MyBlog</string> +</value> +</param> +<param> +<value>%s</value> +</param> +<param> +<value> +<string>%s</string> +</value> +</param> +<param> +<struct> +<member> +<name>categories</name> +<value> +<array> +<data> +<value>%s</value> +</data> +</array> +</value> +</member> +<member> +<name>description</name> +<value>%s</value> +</member> +<member> +<name>title</name> +<value>%s</value> +</member> +</struct> +</param> +<param> + <value> + <boolean>1</boolean> + </value> +</param> +</params> +</methodCall> +''' % (self.user, self.password, self.wordpresscategory, self.description, self.title) - if self.error == False: - blog_route = self.createRoute() - blog_body = self.createBody() - blog_table = self.createTable() - blog_figureHR = self.createFigureHR() - blog_figureStage = self.createFigureStage() - blog_foot = self.createFoot() - self.wp.selectBlog(0) - - post = wordpresslib.WordPressPost() - post.title = blog_title - post.description = blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot - post.categories = blog_category - idNewPost = self.wp.newPost(post, True) - print "The post has been submited" #TODO Notification to user - + #POST request to Wordpress blog + h = httplib2.Http() + res, content = h.request(self.wordpressurl, 'POST', body=xmlstuff) + logging.debug("after request posting") + logging.debug("Got response status: %s, reason: %s, content: %s" % (res.status, res.reason, content)) + if res.reason == 'OK': + res_msg = "Successfully posted to Wordpress." else: - print self.log + res_msg = "Some error occured\nGot a status %s, reason %s\nContent was: %s" % (res.status, res.reason, content) + #Close 'Please wait' dialog + md.destroy() + #Show the user the result + md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, res_msg) + md.set_title(_("Wordpress Extension Upload Complete")) + md.set_modal(False) + md.run() + md.destroy() def createRoute(self): + gpxpath = "/tmp/gpstrace.gpx.txt" htmlpath = "/tmp/index.html" #TODO fix to use correct tmp dir - kmlpath = "/tmp/gps.kml" #TODO fix to use correct tmp dir + kmlpath = "/tmp/gps.kml.txt" #TODO fix to use correct tmp dir description_route = '' if os.path.isfile(self.gpxfile): + #copy gpx file to new name + shutil.copy(self.gpxfile, gpxpath) #create the html file googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) #TODO fix to use main googlemaps and remove extensions copy #create the kml file os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) #TODO fix to remove gpsbabel - gfile = self.wp.newMediaObject(self.gpxfile) + #gfile = self.wp.newMediaObject(self.gpxfile) + gfile = self.wp.newMediaObject(gpxpath) hfile = self.wp.newMediaObject(htmlpath) kfile = self.wp.newMediaObject(kmlpath) Modified: pytrainer/trunk/extensions/wordpress/wordpresslib.py =================================================================== --- pytrainer/trunk/extensions/wordpress/wordpresslib.py 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/extensions/wordpress/wordpresslib.py 2010-05-15 06:05:28 UTC (rev 577) @@ -56,6 +56,7 @@ import xmlrpclib import datetime import time +import logging class WordPressException(exceptions.Exception): """Custom exception for WordPress client operations @@ -223,7 +224,7 @@ """ blogContent = { 'title' : post.title, - 'description' : post.description + 'description' : "<![CDATA["+post.description+"]]>" } # add categories @@ -237,6 +238,8 @@ # insert new post idNewPost = int(self._server.metaWeblog.newPost(self.blogId, self.user, self.password, blogContent, 0)) + logging.debug("idNewPost: %d" % idNewPost) + logging.debug(blogContent) # set categories for new post self.setPostCategories(idNewPost, categories) Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/glade/pytrainer.glade 2010-05-15 06:05:28 UTC (rev 577) @@ -4,7 +4,7 @@ <!-- interface-naming-policy toplevel-contextual --> <widget class="GtkWindow" id="window1"> <property name="visible">True</property> - <property name="title" translatable="no">window1</property> + <property name="title">window1</property> <property name="icon">logo_mini.png</property> <signal name="destroy" handler="quit"/> <child> @@ -14,7 +14,6 @@ <child> <widget class="GtkVBox" id="infoarea"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> @@ -264,7 +263,6 @@ <child> <widget class="GtkVBox" id="framework"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox8"> <property name="visible">True</property> @@ -337,7 +335,6 @@ <widget class="GtkVBox" id="vbox22"> <property name="visible">True</property> <property name="border_width">10</property> - <property name="orientation">vertical</property> <child> <widget class="GtkTable" id="table13"> <property name="visible">True</property> @@ -490,7 +487,7 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">5</property> - <property name="label" translatable="no">km/h</property> + <property name="label">km/h</property> </widget> <packing> <property name="left_attach">5</property> @@ -506,7 +503,7 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">5</property> - <property name="label" translatable="no">min/km</property> + <property name="label">min/km</property> </widget> <packing> <property name="left_attach">5</property> @@ -522,7 +519,7 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">5</property> - <property name="label" translatable="no">m</property> + <property name="label">m</property> </widget> <packing> <property name="left_attach">5</property> @@ -718,7 +715,7 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">5</property> - <property name="label" translatable="no">min/km</property> + <property name="label">min/km</property> </widget> <packing> <property name="left_attach">2</property> @@ -749,7 +746,7 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="xpad">5</property> - <property name="label" translatable="no">m</property> + <property name="label">m</property> </widget> <packing> <property name="left_attach">2</property> @@ -821,7 +818,7 @@ <widget class="GtkLabel" id="record_hour"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="position">0</property> @@ -830,7 +827,7 @@ <child> <widget class="GtkLabel" id="label11132"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -841,7 +838,7 @@ <child> <widget class="GtkLabel" id="record_minute"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -852,7 +849,7 @@ <child> <widget class="GtkLabel" id="label11133"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -864,7 +861,7 @@ <widget class="GtkLabel" id="record_second"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -1078,7 +1075,6 @@ <child> <widget class="GtkVBox" id="record_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox30"> <property name="visible">True</property> @@ -1190,7 +1186,6 @@ <child> <widget class="GtkVBox" id="vboxGraphYConfig"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkLabel" id="labelGraphConfig"> <property name="visible">True</property> @@ -1828,7 +1823,6 @@ <child> <widget class="GtkVBox" id="record_graph_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <placeholder/> </child> @@ -1860,12 +1854,90 @@ </packing> </child> <child> - <widget class="GtkVBox" id="map_vbox"> + <widget class="GtkVBox" id="maparea_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> - <placeholder/> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <child> + <widget class="GtkButton" id="buttonRedrawMap"> + <property name="label" translatable="yes">Redraw Map</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <signal name="clicked" handler="on_buttonRedrawMap_clicked"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelMapDisplayType"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><small>Display map using:</small></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="padding">5</property> + <property name="pack_type">end</property> + <property name="position">2</property> + </packing> + </child> + <child> + <widget class="GtkRadioButton" id="radiobuttonOSM"> + <property name="label" translatable="yes">Open Street Map</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobuttonGMap</property> + <signal name="toggled" handler="on_radiobuttonMap_toggled"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkRadioButton" id="radiobuttonGMap"> + <property name="label" translatable="yes">Google</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_radiobuttonMap_toggled"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> </child> + <child> + <widget class="GtkVBox" id="map_vbox"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> </widget> <packing> <property name="position">2</property> @@ -1885,7 +1957,6 @@ <child> <widget class="GtkVBox" id="heartrate_vbox_"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame11"> <property name="visible">True</property> @@ -2402,7 +2473,6 @@ <child> <widget class="GtkVBox" id="heartrate_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <placeholder/> </child> @@ -2411,7 +2481,7 @@ <child> <widget class="GtkLabel" id="label-8"> <property name="visible">True</property> - <property name="label" translatable="no">label-2147483648</property> + <property name="label">label-2147483648</property> </widget> <packing> <property name="tab_fill">False</property> @@ -2420,7 +2490,6 @@ </child> <child> <widget class="GtkVBox" id="heartrate_vbox2"> - <property name="orientation">vertical</property> <child> <placeholder/> </child> @@ -2432,7 +2501,7 @@ <child> <widget class="GtkLabel" id="label-9"> <property name="visible">True</property> - <property name="label" translatable="no">label-2147483647</property> + <property name="label">label-2147483647</property> </widget> <packing> <property name="position">1</property> @@ -2476,7 +2545,6 @@ <child> <widget class="GtkVBox" id="dayview"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame1"> <property name="visible">True</property> @@ -2555,7 +2623,7 @@ <widget class="GtkLabel" id="day_hour"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="fill">False</property> @@ -2565,7 +2633,7 @@ <child> <widget class="GtkLabel" id="label77"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -2576,7 +2644,7 @@ <child> <widget class="GtkLabel" id="day_minute"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -2587,7 +2655,7 @@ <child> <widget class="GtkLabel" id="label78"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -2598,7 +2666,7 @@ <child> <widget class="GtkLabel" id="day_second"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -3002,7 +3070,6 @@ <child> <widget class="GtkVBox" id="day_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox41"> <property name="visible">True</property> @@ -3089,7 +3156,6 @@ <child> <widget class="GtkVBox" id="weekview"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame4"> <property name="visible">True</property> @@ -3168,7 +3234,7 @@ <widget class="GtkLabel" id="weeka_hour"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="no">000</property> + <property name="label">000</property> </widget> <packing> <property name="fill">False</property> @@ -3178,7 +3244,7 @@ <child> <widget class="GtkLabel" id="label108"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -3189,7 +3255,7 @@ <child> <widget class="GtkLabel" id="weeka_minute"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -3200,7 +3266,7 @@ <child> <widget class="GtkLabel" id="label109"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -3211,7 +3277,7 @@ <child> <widget class="GtkLabel" id="weeka_second"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -3370,7 +3436,7 @@ <widget class="GtkLabel" id="label110"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="no"> </property> + <property name="label"> </property> </widget> <packing> <property name="left_attach">2</property> @@ -3616,7 +3682,6 @@ <child> <widget class="GtkVBox" id="week_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox19"> <property name="visible">True</property> @@ -3714,7 +3779,6 @@ <child> <widget class="GtkVBox" id="monthview"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame2"> <property name="visible">True</property> @@ -3793,7 +3857,7 @@ <widget class="GtkLabel" id="montha_hour"> <property name="visible">True</property> <property name="xalign">1</property> - <property name="label" translatable="no">000</property> + <property name="label">000</property> </widget> <packing> <property name="fill">False</property> @@ -3803,7 +3867,7 @@ <child> <widget class="GtkLabel" id="label5"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -3814,7 +3878,7 @@ <child> <widget class="GtkLabel" id="montha_minute"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -3825,7 +3889,7 @@ <child> <widget class="GtkLabel" id="label6"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -3836,7 +3900,7 @@ <child> <widget class="GtkLabel" id="montha_second"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -3995,7 +4059,7 @@ <widget class="GtkLabel" id="label10"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="no"> </property> + <property name="label"> </property> </widget> <packing> <property name="left_attach">2</property> @@ -4008,7 +4072,6 @@ <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes"><b>Beats avg:</b></property> - <property name="use_markup">True</property> </widget> <packing> @@ -4242,7 +4305,6 @@ <child> <widget class="GtkVBox" id="month_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox3"> <property name="visible">True</property> @@ -4339,7 +4401,6 @@ <child> <widget class="GtkVBox" id="yearview"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame7"> <property name="visible">True</property> @@ -4494,7 +4555,7 @@ <child> <widget class="GtkLabel" id="yeara_hour"> <property name="visible">True</property> - <property name="label" translatable="no">000</property> + <property name="label">000</property> </widget> <packing> <property name="fill">False</property> @@ -4504,7 +4565,7 @@ <child> <widget class="GtkLabel" id="label126"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -4515,7 +4576,7 @@ <child> <widget class="GtkLabel" id="yeara_minute"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -4526,7 +4587,7 @@ <child> <widget class="GtkLabel" id="label127"> <property name="visible">True</property> - <property name="label" translatable="no">:</property> + <property name="label">:</property> </widget> <packing> <property name="expand">False</property> @@ -4537,7 +4598,7 @@ <child> <widget class="GtkLabel" id="yeara_second"> <property name="visible">True</property> - <property name="label" translatable="no">00</property> + <property name="label">00</property> </widget> <packing> <property name="expand">False</property> @@ -4866,7 +4927,6 @@ <child> <widget class="GtkVBox" id="year_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox20"> <property name="visible">True</property> @@ -4964,7 +5024,6 @@ <widget class="GtkVBox" id="equipview"> <property name="visible">True</property> <property name="sensitive">False</property> - <property name="orientation">vertical</property> <child> <placeholder/> </child> @@ -4999,7 +5058,7 @@ <child> <widget class="GtkLabel" id="label154"> <property name="visible">True</property> - <property name="label" translatable="no">label154</property> + <property name="label">label154</property> </widget> <packing> <property name="tab_fill">False</property> @@ -5009,7 +5068,6 @@ <child> <widget class="GtkVBox" id="listarea"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox36"> <property name="height_request">43</property> @@ -5125,7 +5183,7 @@ <child> <widget class="GtkLabel" id="llllll"> <property name="visible">True</property> - <property name="label" translatable="no">label155</property> + <property name="label">label155</property> </widget> <packing> <property name="position">1</property> @@ -5136,7 +5194,6 @@ <child> <widget class="GtkVBox" id="waypointarea"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame10"> <property name="visible">True</property> @@ -5409,7 +5466,7 @@ <child> <widget class="GtkLabel" id="label-46"> <property name="visible">True</property> - <property name="label" translatable="no">label-2147483648</property> + <property name="label">label-2147483648</property> </widget> <packing> <property name="position">2</property> @@ -5437,7 +5494,7 @@ <child> <widget class="GtkLabel" id="label14"> <property name="visible">True</property> - <property name="label" translatable="no">label162</property> + <property name="label">label162</property> </widget> <packing> <property name="tab_fill">False</property> @@ -5447,7 +5504,6 @@ <child> <widget class="GtkVBox" id="maparea"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkHBox" id="hbox31"> <property name="visible">True</property> @@ -5497,7 +5553,6 @@ <child> <widget class="GtkVBox" id="map_vbox_old"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <placeholder/> </child> @@ -5524,7 +5579,7 @@ <child> <widget class="GtkLabel" id="label163"> <property name="visible">True</property> - <property name="label" translatable="no">label163</property> + <property name="label">label163</property> </widget> <packing> <property name="position">1</property> Modified: pytrainer/trunk/pytrainer/extensions/googlemaps.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/googlemaps.py 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/pytrainer/extensions/googlemaps.py 2010-05-15 06:05:28 UTC (rev 577) @@ -216,7 +216,7 @@ except: #Error processing lap lat or lon #dont show this lap - print "Error processing lap "+ str(lapNumber) + " id: " + str(lap[0]) + " (lat,lon) ( " + str(lap[6]) + "," +str (lap[7]) + ")" + logging.debug( "Error processing lap "+ str(lapNumber) + " id: " + str(lap[0]) + " (lat,lon) ( " + str(lap[6]) + "," +str (lap[7]) + ")" ) content += ''' Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-15 06:05:28 UTC (rev 577) @@ -83,6 +83,10 @@ #Disable import menu item unless specified on startup self.set_unified_import(self.testimport) + + #Set correct map viewer + #self.radiobuttonOSM.set_active(0) + self.radiobuttonGMap.set_active(1) def set_unified_import(self, status=False): self.menu_importdata.set_sensitive(status) @@ -392,9 +396,19 @@ def actualize_map(self,id_record, full_screen=False): logging.debug(">>") + #Check which type of map viewer to use + if self.radiobuttonOSM.get_active(): + map_view = "OSM" + elif self.radiobuttonGMap.get_active(): + map_view = "GMAP" + else: + map_view = "GMAP" + print map_view + if full_screen: self.googlemaps_old.drawMap(id_record) else: + self.googlemaps.drawMap(id_record) logging.debug("<<") @@ -820,6 +834,17 @@ ## Lista de eventos ## ###################### + def on_buttonRedrawMap_clicked(self, widget): + print 'on_buttonRedrawMap_clicked' + self.parent.refreshMapView() + + def on_radiobuttonMap_toggled(self, widget): + #Ignore the deselected toggle event + if widget.get_active() == False: + return + logging.debug( 'on_radiobuttonMap_toggled '+ widget.get_name()+ ' activated') + self.parent.refreshMapView() + def on_hpaned1_move_handle(self, widget): print "Handler" print widget Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-05-06 09:44:19 UTC (rev 576) +++ pytrainer/trunk/pytrainer/main.py 2010-05-15 06:05:28 UTC (rev 577) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#573" + self.version ="1.7.2_svn#577" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -78,7 +78,7 @@ self.prf_us_system = True else: self.prf_us_system = False - self.ddbb = DDBB(self.profile) #TODO set this up so other modules can reference this and not have to duplicate this + self.ddbb = DDBB(self.profile) logging.debug('connecting to DDBB') self.ddbb.connect() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-05-15 07:15:22
|
Revision: 578 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=578&view=rev Author: jblance Date: 2010-05-15 07:15:15 +0000 (Sat, 15 May 2010) Log Message: ----------- Modifications to support OSM as a map viewer - added preference to chose default, changes to map screen to allow viewer selection. OSM not implemented yet Modified Paths: -------------- pytrainer/trunk/glade/profile.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/gui/windowprofile.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/profile.py Modified: pytrainer/trunk/glade/profile.glade =================================================================== --- pytrainer/trunk/glade/profile.glade 2010-05-15 06:05:28 UTC (rev 577) +++ pytrainer/trunk/glade/profile.glade 2010-05-15 07:15:15 UTC (rev 578) @@ -10,7 +10,6 @@ <child> <widget class="GtkVBox" id="vbox4"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkNotebook" id="notebook3"> <property name="visible">True</property> @@ -20,7 +19,6 @@ <child> <widget class="GtkVBox" id="vbox24"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame14"> <property name="visible">True</property> @@ -32,12 +30,8 @@ <property name="visible">True</property> <property name="left_padding">12</property> <child> - <widget class="GtkTable" id="table19"> + <widget class="GtkHBox" id="hbox2"> <property name="visible">True</property> - <property name="border_width">5</property> - <property name="n_columns">2</property> - <property name="column_spacing">5</property> - <property name="row_spacing">5</property> <child> <widget class="GtkRadioButton" id="prf_metric_system"> <property name="label" translatable="yes">Metric system</property> @@ -45,11 +39,13 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> + <property name="active">True</property> <property name="draw_indicator">True</property> </widget> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="expand">False</property> + <property name="padding">5</property> + <property name="position">0</property> </packing> </child> <child> @@ -63,10 +59,9 @@ <property name="group">prf_metric_system</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="expand">False</property> + <property name="padding">5</property> + <property name="position">1</property> </packing> </child> </widget> @@ -91,6 +86,72 @@ </packing> </child> <child> + <widget class="GtkFrame" id="frameDefaultMapViewer"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkRadioButton" id="radiobuttonDefaultGMap"> + <property name="label" translatable="yes">Google</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="padding">5</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkRadioButton" id="radiobuttonDefaultOSM"> + <property name="label" translatable="yes">Open Street Map</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobuttonDefaultGMap</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="labelDefaultMapViewer"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Default Map Viewer</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> <widget class="GtkFrame" id="frame13"> <property name="visible">True</property> <property name="border_width">5</property> @@ -174,7 +235,7 @@ <child> <widget class="GtkComboBoxEntry" id="prf_ddbb"> <property name="visible">True</property> - <property name="items" translatable="no"></property> + <property name="items"></property> <signal name="changed" handler="on_prf_ddbb_changed"/> </widget> <packing> @@ -265,7 +326,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -344,7 +405,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </widget> @@ -404,7 +465,7 @@ <child> <widget class="GtkComboBoxEntry" id="prf_gender"> <property name="visible">True</property> - <property name="items" translatable="no"></property> + <property name="items"></property> </widget> <packing> <property name="left_attach">1</property> @@ -596,7 +657,6 @@ <widget class="GtkVBox" id="sportlist_"> <property name="visible">True</property> <property name="border_width">5</property> - <property name="orientation">vertical</property> <child> <widget class="GtkScrolledWindow" id="sportScrollWindow"> <property name="height_request">170</property> @@ -717,7 +777,6 @@ <widget class="GtkVBox" id="addsport_"> <property name="visible">True</property> <property name="border_width">5</property> - <property name="orientation">vertical</property> <child> <widget class="GtkTable" id="table18"> <property name="visible">True</property> @@ -934,14 +993,12 @@ <widget class="GtkVBox" id="deletesport_"> <property name="visible">True</property> <property name="border_width">5</property> - <property name="orientation">vertical</property> <child> <placeholder/> </child> <child> <widget class="GtkVBox" id="vbox17"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkLabel" id="label144"> <property name="visible">True</property> @@ -1038,7 +1095,7 @@ </child> <child> <widget class="GtkLabel" id="sportnamedel"> - <property name="label" translatable="no">label-2147483648</property> + <property name="label">label-2147483648</property> </widget> <packing> <property name="expand">False</property> @@ -1081,7 +1138,6 @@ <widget class="GtkVBox" id="editsport_"> <property name="visible">True</property> <property name="border_width">5</property> - <property name="orientation">vertical</property> <child> <widget class="GtkTable" id="table17"> <property name="visible">True</property> @@ -1309,7 +1365,6 @@ <child> <widget class="GtkVBox" id="vbox25"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkFrame" id="frame17"> <property name="visible">True</property> @@ -1597,7 +1652,6 @@ <child> <widget class="GtkVBox" id="vbox_startup_params"> <property name="visible">True</property> - <property name="orientation">vertical</property> <child> <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> @@ -1662,7 +1716,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonValidate"> - <property name="label" translatable="no">--valid</property> + <property name="label">--valid</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1708,7 +1762,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonCheck"> - <property name="label" translatable="no">--check</property> + <property name="label">--check</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1754,7 +1808,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonGM3"> - <property name="label" translatable="no">--gmaps2*</property> + <property name="label">--gmaps2*</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1801,7 +1855,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonUnifiedImport"> - <property name="label" translatable="no">--testimport</property> + <property name="label">--testimport</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -1847,7 +1901,7 @@ </child> <child> <widget class="GtkCheckButton" id="checkbuttonEquip"> - <property name="label" translatable="no">--equip</property> + <property name="label">--equip</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">False</property> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-15 06:05:28 UTC (rev 577) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-15 07:15:15 UTC (rev 578) @@ -85,8 +85,10 @@ self.set_unified_import(self.testimport) #Set correct map viewer - #self.radiobuttonOSM.set_active(0) - self.radiobuttonGMap.set_active(1) + if self.pytrainer_main.profile.getValue("pytraining","default_viewer") == "1": + self.radiobuttonOSM.set_active(1) + else: + self.radiobuttonGMap.set_active(1) def set_unified_import(self, status=False): self.menu_importdata.set_sensitive(status) @@ -398,18 +400,19 @@ logging.debug(">>") #Check which type of map viewer to use if self.radiobuttonOSM.get_active(): - map_view = "OSM" + #Use OSM to draw map + logging.debug("Using OSM to draw map....") + self.googlemaps.drawMap(-9999) #TODO placeholder for OSM code elif self.radiobuttonGMap.get_active(): - map_view = "GMAP" + #Use Google to draw map + logging.debug("Using Google to draw map") + if full_screen: + self.googlemaps_old.drawMap(id_record) #TODO - sort this to be more generic, maybe pass map target? + else: + self.googlemaps.drawMap(id_record) #TODO - sort this to be more generic, maybe pass map target? else: - map_view = "GMAP" - print map_view - - if full_screen: - self.googlemaps_old.drawMap(id_record) - else: - - self.googlemaps.drawMap(id_record) + #Unknown map type... + logging.error("Unknown map viewer requested") logging.debug("<<") def actualize_weekview(self, record_list, date_ini, date_end): @@ -835,7 +838,7 @@ ###################### def on_buttonRedrawMap_clicked(self, widget): - print 'on_buttonRedrawMap_clicked' + logging.debug('on_buttonRedrawMap_clicked') self.parent.refreshMapView() def on_radiobuttonMap_toggled(self, widget): Modified: pytrainer/trunk/pytrainer/gui/windowprofile.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-05-15 06:05:28 UTC (rev 577) +++ pytrainer/trunk/pytrainer/gui/windowprofile.py 2010-05-15 07:15:15 UTC (rev 578) @@ -32,22 +32,6 @@ self.data_path = data_path SimpleGladeApp.__init__(self, data_path+glade_path, root, domain) self.conf_options = parent.profile_options - ''''self.conf_options = [ - "prf_name", - "prf_gender", - "prf_weight", - "prf_height", - "prf_age", - "prf_ddbb", - "prf_ddbbhost", - "prf_ddbbname", - "prf_ddbbuser", - "prf_ddbbpass", - "prf_maxhr", - "prf_minhr", - "prf_hrzones_karvonen", - "prf_us_system" - ]''' def new(self): self.gender_options = { @@ -64,7 +48,7 @@ for i in self.gender_options: self.prf_gender.insert_text(i,self.gender_options[i]) - #hacemos lo propio para el combobox ddbb + #hacemos lo propio para el combobox ddbb for i in self.ddbb_type: self.prf_ddbb.insert_text(i,self.ddbb_type[i]) @@ -73,55 +57,66 @@ for column_index, column_name in enumerate(column_names): column = gtk.TreeViewColumn(column_name, gtk.CellRendererText(), text=column_index) column.set_resizable(True) - self.sportTreeView.append_column(column) - + self.sportTreeView.append_column(column) def setValues(self,list_options): for i in self.conf_options.keys(): if not list_options.has_key(i): + print 'no list options for: ' + i continue - try: - var = getattr(self,i) - except AttributeError as e: - continue - if i != "prf_gender" and i != "prf_ddbb" and i !="prf_hrzones_karvonen" and i!="prf_us_system": - var.set_text(list_options[i]) - elif i == "prf_hrzones_karvonen" or i == "prf_us_system": - if list_options[i]=="True": - var.set_active(True) - elif i == "prf_gender": - for j in self.gender_options: - if self.gender_options[j]==list_options[i]: - var.set_active(j) - elif i == "prf_ddbb": - for j in self.ddbb_type: - if self.ddbb_type[j]==list_options[i]: - var.set_active(j) - if j==0: - self._ddbb_value_deactive() - else: - self._ddbb_value_active() + if i == "default_viewer": + if list_options[i] == "1": + logging.debug("Setting defult map viewer to OSM") + self.radiobuttonDefaultOSM.set_active(1) + else: + logging.debug("Setting defult map viewer to Google") + self.radiobuttonDefaultGMap.set_active(1) + else: + try: + var = getattr(self,i) + except AttributeError as e: + continue + if i == "prf_hrzones_karvonen" or i == "prf_us_system": + if list_options[i]=="True": + var.set_active(True) + elif i == "prf_gender": + for j in self.gender_options: + if self.gender_options[j]==list_options[i]: + var.set_active(j) + elif i == "prf_ddbb": + for j in self.ddbb_type: + if self.ddbb_type[j]==list_options[i]: + var.set_active(j) + if j==0: + self._ddbb_value_deactive() + else: + self._ddbb_value_active() + else: + var.set_text(list_options[i]) + def saveOptions(self): list_options = {} for i in self.conf_options.keys(): - try: - var = getattr(self,i) - except AttributeError as e: - continue - if i != "prf_gender" and i != "prf_ddbb" and i != "prf_hrzones_karvonen" and i != "prf_us_system": - #list_options.append((i,var.get_text())) - list_options[i] = var.get_text() - elif i == "prf_hrzones_karvonen" or i == "prf_us_system": - if var.get_active(): - #list_options.append((i,"True")) - list_options[i] = "True" + if i == "default_viewer": + if self.radiobuttonDefaultOSM.get_active(): + list_options[i] = "1" else: - #list_options.append((i,"False")) - list_options[i] = "False" + list_options[i] = "0" else: - #list_options.append((i,var.get_active_text())) - list_options[i] = var.get_active_text() + try: + var = getattr(self,i) + except AttributeError as e: + continue + if i == "prf_hrzones_karvonen" or i == "prf_us_system": + if var.get_active(): + list_options[i] = "True" + else: + list_options[i] = "False" + elif i == "prf_gender" or i == "prf_ddbb": + list_options[i] = var.get_active_text() + else: + list_options[i] = var.get_text() self.parent.setProfile(list_options) def on_calendar_clicked(self,widget): Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-05-15 06:05:28 UTC (rev 577) +++ pytrainer/trunk/pytrainer/main.py 2010-05-15 07:15:15 UTC (rev 578) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#577" + self.version ="1.7.2_svn#578" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -318,6 +318,10 @@ def refreshMapView(self, full_screen=False): logging.debug('>>') + if self.windowmain is None: + logging.debug('Called before windowmain initialisation') + logging.debug('<<') + return selected,iter = self.windowmain.recordTreeView.get_selection().get_selected() id_record = selected.get_value(iter,0) logging.debug('Trying to show map for record '+str(id_record)) Modified: pytrainer/trunk/pytrainer/profile.py =================================================================== --- pytrainer/trunk/pytrainer/profile.py 2010-05-15 06:05:28 UTC (rev 577) +++ pytrainer/trunk/pytrainer/profile.py 2010-05-15 07:15:15 UTC (rev 578) @@ -68,6 +68,7 @@ "prf_minhr":"", "auto_launch_file_selection":"False", "import_default_tab":"0", + "default_viewer":"0", } #Parse pytrainer configuration file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-05-16 01:36:58
|
Revision: 579 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=579&view=rev Author: jblance Date: 2010-05-16 01:36:52 +0000 (Sun, 16 May 2010) Log Message: ----------- Graph options changes - add button to show options, move show laps to options Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-05-15 07:15:15 UTC (rev 578) +++ pytrainer/trunk/glade/pytrainer.glade 2010-05-16 01:36:52 UTC (rev 579) @@ -1081,11 +1081,23 @@ <property name="border_width">5</property> <property name="spacing">8</property> <child> - <widget class="GtkLabel" id="label162"> + <widget class="GtkButton" id="buttonShowOptions"> <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip" translatable="yes">Show graph display options</property> + <signal name="clicked" handler="on_buttonShowOptions_clicked"/> + <child> + <widget class="GtkImage" id="image4"> + <property name="visible">True</property> + <property name="stock">gtk-preferences</property> + </widget> + </child> </widget> <packing> - <property name="position">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> </packing> </child> <child> @@ -1100,7 +1112,7 @@ </widget> <packing> <property name="expand">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -1111,7 +1123,7 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> @@ -1129,29 +1141,11 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="btnShowLaps"> - <property name="label" translatable="yes">Show Laps</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_btnShowLaps_toggled"/> - </widget> - <packing> <property name="position">4</property> </packing> </child> <child> - <widget class="GtkLabel" id="label-2147483645"> - <property name="visible">True</property> - </widget> - <packing> - <property name="position">5</property> - </packing> + <placeholder/> </child> <child> <widget class="GtkButton" id="button27"> @@ -1169,7 +1163,8 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">6</property> + <property name="pack_type">end</property> + <property name="position">0</property> </packing> </child> </widget> @@ -1408,7 +1403,7 @@ </widget> <packing> <property name="expand">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -1619,7 +1614,7 @@ </widget> <packing> <property name="expand">False</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> @@ -1798,6 +1793,56 @@ </packing> </child> <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + </widget> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="btnShowLaps"> + <property name="label" translatable="yes">Show Laps</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_btnShowLaps_toggled"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="padding">5</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label18"> + <property name="visible">True</property> + </widget> + <packing> + <property name="position">6</property> + </packing> + </child> + <child> <widget class="GtkButton" id="buttonResetGraph"> <property name="label" translatable="yes">Reset Graph</property> <property name="visible">True</property> @@ -1811,7 +1856,7 @@ <property name="expand">False</property> <property name="fill">False</property> <property name="pack_type">end</property> - <property name="position">3</property> + <property name="position">1</property> </packing> </child> </widget> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-15 07:15:15 UTC (rev 578) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-16 01:36:52 UTC (rev 579) @@ -837,6 +837,19 @@ ## Lista de eventos ## ###################### + def on_buttonShowOptions_clicked(self, widget): + position_set = self.hpaned1.get_property('position-set') + if position_set: + #Currently not showing options - show them + self.hpaned1.set_property('position-set', False) + self.buttonShowOptions.set_tooltip_text(_('Hide graph display options') ) + else: + #Hide options + self.hpaned1.set_position(0) + self.buttonShowOptions.set_tooltip_text(_('Show graph display options') ) + logging.debug('Position: %d' % self.hpaned1.get_position() ) + logging.debug('Position set: %s' % self.hpaned1.get_property('position-set') ) + def on_buttonRedrawMap_clicked(self, widget): logging.debug('on_buttonRedrawMap_clicked') self.parent.refreshMapView() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-05-15 07:15:15 UTC (rev 578) +++ pytrainer/trunk/pytrainer/main.py 2010-05-16 01:36:52 UTC (rev 579) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#578" + self.version ="1.7.2_svn#579" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-05-16 02:16:17
|
Revision: 580 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=580&view=rev Author: jblance Date: 2010-05-16 02:16:10 +0000 (Sun, 16 May 2010) Log Message: ----------- Update plugins and import to write GPX files as UTF8 instead of ASCII Modified Paths: -------------- pytrainer/trunk/import/file_garmintcxv1.py pytrainer/trunk/import/file_garmintcxv2.py pytrainer/trunk/import/file_garmintools.py pytrainer/trunk/import/file_gpxplus.py pytrainer/trunk/plugins/garmin-hr/garminhr.py pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py pytrainer/trunk/plugins/garmintools/garmintools.py pytrainer/trunk/plugins/garmintools_full/garmintools_full.py pytrainer/trunk/plugins/googleearth/main.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/import/file_garmintcxv1.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv1.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/import/file_garmintcxv1.py 2010-05-16 02:16:10 UTC (rev 580) @@ -84,17 +84,17 @@ distance = "" index = "%d:%d" % (self.activities.index((sport, activities)), activities.index(activity)) self.activitiesSummary.append( (index, - inDatabase, - startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), - distance , - str(duration), + inDatabase, + startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), + distance , + str(duration), sport, ) ) #print self.activitiesSummary return True except: #Not valid file - return False + return False return False def getActivities(self, tree): @@ -160,5 +160,5 @@ #xml_doc = etree.parse(filename) xml_doc = activity result_tree = transform(xml_doc) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/import/file_garmintcxv2.py =================================================================== --- pytrainer/trunk/import/file_garmintcxv2.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/import/file_garmintcxv2.py 2010-05-16 02:16:10 UTC (rev 580) @@ -162,5 +162,5 @@ #xml_doc = etree.parse(filename) xml_doc = activity result_tree = transform(xml_doc) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/import/file_garmintools.py =================================================================== --- pytrainer/trunk/import/file_garmintools.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/import/file_garmintools.py 2010-05-16 02:16:10 UTC (rev 580) @@ -69,10 +69,10 @@ distance, duration = self.getDetails(xmldoc, startTime) distance = distance / 1000.0 self.activitiesSummary.append( (0, - indatabase, - startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), - "%0.2f" % distance , - str(duration), + indatabase, + startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), + "%0.2f" % distance , + str(duration), sport, ) ) return True @@ -80,7 +80,7 @@ #Not garmintools dump file return False return False - + def getDateTime(self, time_): return Date().getDateTime(time_) @@ -154,5 +154,5 @@ xslt_doc = etree.parse(self.data_path+"/translate_garmintools.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(tree) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/import/file_gpxplus.py =================================================================== --- pytrainer/trunk/import/file_gpxplus.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/import/file_gpxplus.py 2010-05-16 02:16:10 UTC (rev 580) @@ -62,10 +62,10 @@ duration = self.getDetails(xmldoc, startTime) distance = "" self.activitiesSummary.append( (0, - indatabase, - startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), - distance , - str(duration), + indatabase, + startTime[1].strftime("%Y-%m-%dT%H:%M:%S"), + distance , + str(duration), sport, ) ) return True @@ -73,7 +73,7 @@ #Not gpx file return False return False - + def getDateTime(self, time_): return Date().getDateTime(time_) @@ -122,5 +122,5 @@ return sport, gpxFile def createGPXfile(self, gpxfile, tree): - tree.write(gpxfile, xml_declaration=True) + tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/plugins/garmin-hr/garminhr.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/garmin-hr/garminhr.py 2010-05-16 02:16:10 UTC (rev 580) @@ -63,10 +63,10 @@ #TODO Remove Zenity below outgps = commands.getstatusoutput("gpsbabel -t -i garmin -f %s -o gtrnctr -F %s | zenity --progress --pulsate --text='Loading Data' auto-close" % (self.input_dev, gpsbabelOutputFile) ) if outgps[0]==0: - if outgps[1] == "Found no Garmin USB devices.": # check localizations + if outgps[1] == "Found no Garmin USB devices.": # check localizations logging.error ("GPSBabel found no Garmin USB devices") os.popen("zenity --error --text='GPSBabel found no Garmin USB devices'"); - pass + pass else: #gpsbabel worked - now process file... if self.valid_input_file(gpsbabelOutputFile): for (sport, tracks) in self.getTracks(gpsbabelOutputFile): @@ -156,7 +156,7 @@ logging.debug("Error no time found in track") return False else: - time = timeElement.text + time = timeElement.text #comparing date and start time (sport may have been changed in DB after import) if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): logging.debug("Not importing track for time %s" % (time)) @@ -170,7 +170,7 @@ xslt_doc = etree.parse(self.data_path+"/translate.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(track) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py =================================================================== --- pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/garmin-hr-file/garminhrfile.py 2010-05-16 02:16:10 UTC (rev 580) @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: iso-8859-1 -*- -#Copyright (C) +#Copyright (C) #Based on plugin by Fiz Vazquez vu...@si... @@ -102,7 +102,7 @@ logging.debug("Error no time found in track") return False else: - time = timeElement.text + time = timeElement.text #comparing date and start time (sport may have been changed in DB after import) if self.pytrainer_main.ddbb.select("records","*","date_time_utc=\"%s\"" % (time)): logging.debug("Not importing track for time %s" % (time)) @@ -132,4 +132,4 @@ xslt_doc = etree.parse(self.data_path+"/translate.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(track) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py =================================================================== --- pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/garmin-tcxv2/garmin-tcxv2.py 2010-05-16 02:16:10 UTC (rev 580) @@ -59,9 +59,9 @@ for activity in activities: if not self.inDatabase(activity): sport = self.getSport(activity) - gpxfile = "%s/garmin-tcxv2-%d.gpx" % (self.tmpdir, len(importfiles)) + gpxfile = "%s/garmin-tcxv2-%d.gpx" % (self.tmpdir, len(importfiles)) self.createGPXfile(gpxfile, activity) - importfiles.append((gpxfile, sport)) + importfiles.append((gpxfile, sport)) else: logging.debug("File:%s activity %d already in database. Skipping import." % (filename, activities.index(activity)) ) else: @@ -121,4 +121,4 @@ #xml_doc = etree.parse(filename) xml_doc = activity result_tree = transform(xml_doc) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/plugins/garmintools/garmintools.py =================================================================== --- pytrainer/trunk/plugins/garmintools/garmintools.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/garmintools/garmintools.py 2010-05-16 02:16:10 UTC (rev 580) @@ -67,9 +67,9 @@ tree = etree.parse(fileString) if not self.inDatabase(tree): sport = self.getSport(tree) - gpxfile = "%s/garmintools-%d.gpx" % (self.tmpdir, len(importfiles)) + gpxfile = "%s/garmintools-%d.gpx" % (self.tmpdir, len(importfiles)) self.createGPXfile(gpxfile, tree) - importfiles.append((gpxfile, sport)) + importfiles.append((gpxfile, sport)) else: logging.debug("%s already in database. Skipping import." % (filename,) ) else: @@ -129,5 +129,5 @@ xslt_doc = etree.parse(self.data_path+"/translate.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(tree) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/plugins/garmintools_full/garmintools_full.py =================================================================== --- pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/garmintools_full/garmintools_full.py 2010-05-16 02:16:10 UTC (rev 580) @@ -81,7 +81,7 @@ if numError >= 0: #TODO Remove Zenity below outgps = commands.getstatusoutput("garmin_save_runs | zenity --progress --pulsate --text='Loading Data' auto-close") - if outgps[0]==0: + if outgps[0]==0: # now we should have a lot of gmn (binary) files under $GARMIN_SAVE_RUNS foundFiles = self.searchFiles(self.tmpdir, "gmn") logging.info("Retrieved "+str(len(foundFiles))+" entries from GPS device") @@ -109,7 +109,7 @@ if numError == -1: os.popen("zenity --error --text='No Garmin device found\nCheck your configuration'"); elif numError == -2: - os.popen("zenity --error --text='Can not find garmintools binaries\nCheck your configuration'") + os.popen("zenity --error --text='Can not find garmintools binaries\nCheck your configuration'") else: #No garmin device found #TODO Remove Zenity below os.popen("zenity --error --text='Can not handle Garmin device (wrong module loaded)\nCheck your configuration'"); @@ -150,7 +150,7 @@ #if not self.inDatabase(tree, filename): if not self.entryExists(tree, filename): sport = self.getSport(tree) - gpxfile = "%s/garmintools-%d.gpx" % (self.tmpdir, len(importfiles)) + gpxfile = "%s/garmintools-%d.gpx" % (self.tmpdir, len(importfiles)) self.createGPXfile(gpxfile, tree) importfiles.append((gpxfile, sport)) else: @@ -208,7 +208,7 @@ stringStartDate = stringStartUTC[0:10] for entry in listStringStartUTC: #logging.debug("start: "+str(startDatetime)+" | entry: "+str(entry)+" | gap: "+str(datetimePlusDelta)) - if entry[0] is not None: + if entry[0] is not None: if str(entry[0]).startswith(stringStartDate): deltaGap = timedelta(seconds=gap) datetimeStartUTC = datetime.strptime(stringStartUTC,"%Y-%m-%dT%H:%M:%SZ") @@ -220,7 +220,7 @@ break else: if (stringStartUTC,) in listStringStartUTC: # strange way to store results from DB - found = True + found = True logging.debug("<<") return found @@ -252,7 +252,7 @@ xslt_doc = etree.parse(self.data_path+"/translate.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(tree) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') def dumpBinaries(self, listFiles): logging.debug(">>") Modified: pytrainer/trunk/plugins/googleearth/main.py =================================================================== --- pytrainer/trunk/plugins/googleearth/main.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/plugins/googleearth/main.py 2010-05-16 02:16:10 UTC (rev 580) @@ -43,7 +43,7 @@ if self.valid_input_file(filename): if not self.inDatabase(filename): sport = self.getSport(filename) #TODO Fix sport determination - gpxfile = "%s/googleearth-%d.gpx" % (self.tmpdir, len(importfiles)) + gpxfile = "%s/googleearth-%d.gpx" % (self.tmpdir, len(importfiles)) outgps = commands.getstatusoutput("gpsbabel -t -i kml -f %s -o gpx -F %s" % (filename, gpxfile) ) #self.createGPXfile(gpxfile, filename) #TODO Fix processing so not dependant on the broken gpsbabel importfiles.append((gpxfile, sport)) @@ -66,7 +66,7 @@ #from pytrainer.lib.xmlValidation import xmlValidator #validator = xmlValidator() #return validator.validateXSL(filename, xslfile) - + def inDatabase(self, filename): """ Function to determine if a given file has already been imported into the database only compares date and start time (sport may have been changed in DB after import) @@ -76,11 +76,11 @@ # return True #else: return False - + def getSport(self, filename): #TODO Fix sport determination return "Run" - + def detailsFromKML(self, filename): """ Function to return the first time element from a KML file """ #TODO @@ -91,7 +91,7 @@ # return None #else: # return timeElement.text - + def createGPXfile(self, gpxfile, filename): ''' Function to transform a GPSBabel kml file to a valid GPX+ file ''' @@ -99,5 +99,5 @@ xslt_doc = etree.parse(self.data_path+"/translate.xsl") transform = etree.XSLT(xslt_doc) result_tree = transform(filename) - result_tree.write(gpxfile, xml_declaration=True) + result_tree.write(gpxfile, xml_declaration=True, encoding='UTF-8') Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-05-16 01:36:52 UTC (rev 579) +++ pytrainer/trunk/pytrainer/main.py 2010-05-16 02:16:10 UTC (rev 580) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#579" + self.version ="1.7.2_svn#580" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-05-16 03:00:30
|
Revision: 581 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=581&view=rev Author: jblance Date: 2010-05-16 03:00:24 +0000 (Sun, 16 May 2010) Log Message: ----------- PyTrainer window remembers size between restarts Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/main.py pytrainer/trunk/pytrainer/profile.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-05-16 02:16:10 UTC (rev 580) +++ pytrainer/trunk/glade/pytrainer.glade 2010-05-16 03:00:24 UTC (rev 581) @@ -7,6 +7,7 @@ <property name="title">window1</property> <property name="icon">logo_mini.png</property> <signal name="destroy" handler="quit"/> + <signal name="configure_event" handler="on_window1_configure_event"/> <child> <widget class="GtkNotebook" id="notebook7"> <property name="visible">True</property> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-16 02:16:10 UTC (rev 580) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-05-16 03:00:24 UTC (rev 581) @@ -63,6 +63,11 @@ self.menublocking = 0 self.selected_view="day" self.window1.set_title ("pyTrainer %s" % self.version) + try: + width, height = self.pytrainer_main.profile.getValue("pytraining","window_size").split(',') + self.window1.resize(int(width), int(height)) + except: + pass self.record_list = [] #create the columns for the listdayrecord column_names=[_("id"),_("Start"), _("Sport"),_("Kilometer")] @@ -83,17 +88,17 @@ #Disable import menu item unless specified on startup self.set_unified_import(self.testimport) - + #Set correct map viewer if self.pytrainer_main.profile.getValue("pytraining","default_viewer") == "1": self.radiobuttonOSM.set_active(1) else: self.radiobuttonGMap.set_active(1) - + def set_unified_import(self, status=False): self.menu_importdata.set_sensitive(status) self.parent.testimport = status - + def _createXmlListView(self,file): menufile = XMLParser(file) savedOptions = [] @@ -106,13 +111,13 @@ savedOptions.append(("time","False")) savedOptions.append(("beats","False")) savedOptions.append(("calories","False")) - menufile.createXMLFile("listviewmenu",savedOptions) + menufile.createXMLFile("listviewmenu",savedOptions) def removeImportPlugin(self, plugin): for widget in self.menuitem1_menu: if widget.get_name() == plugin[1]: self.menuitem1_menu.remove(widget) - + def removeExtension(self, extension): for widget in self.recordbuttons_hbox: if widget.get_name() == extension[1]: @@ -151,12 +156,12 @@ self.drawareaweek = WeekGraph(self.weekview, self.window1, self.week_combovalue, self.week_combovalue2) self.drawareamonth = MonthGraph(self.month_vbox, self.window1, self.month_combovalue,self.month_combovalue2) self.drawareayear = YearGraph(self.year_vbox, self.window1, self.year_combovalue,self.year_combovalue2) - + def createMap(self,Googlemaps,waypoint): self.googlemaps = Googlemaps(self.data_path, self.map_vbox,waypoint, pytrainer_main=self.parent) self.googlemaps_old = Googlemaps(self.data_path, self.map_vbox_old,waypoint, pytrainer_main=self.parent) - def updateSportList(self,listSport): + def updateSportList(self,listSport): logging.debug(">>") liststore = self.sportlist.get_model() if self.sportlist.get_active() is not 0: @@ -181,7 +186,7 @@ column.set_sort_column_id(i) treeview.append_column(column) i+=1 - + def actualize_recordview(self,record_list): logging.debug(">>") if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": @@ -203,7 +208,7 @@ if len(record_list)>0: record_list=record_list[0] - + self.recordview.set_sensitive(1) sport = record_list[0] date = record_list[1] @@ -219,7 +224,7 @@ maxpace = self.parseFloat(record_list[13]) #Get datetime from DB, use local time if available otherwise use date_time_utc and create a local datetime... - #TODO get data from date_time_local and parse + #TODO get data from date_time_local and parse date_time_local = record_list[17] date_time_utc = record_list[16] if date_time_local is not None: #Have a local time stored in DB @@ -231,7 +236,7 @@ recordDate = dateTime.strftime("%x") recordTime = dateTime.strftime("%X") recordDateTimeOffset = dateTime.strftime("%z") - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": self.record_distance.set_text("%0.2f" %km2miles(distance)) self.record_upositive.set_text("%0.2f" %m2feet(upositive)) @@ -240,7 +245,7 @@ self.record_maxspeed.set_text("%0.2f" %km2miles(maxspeed)) self.record_pace.set_text("%0.2f" %pacekm2miles(pace)) self.record_maxpace.set_text("%0.2f" %pacekm2miles(maxpace)) - + else: self.record_distance.set_text("%0.2f" %distance) self.record_upositive.set_text("%0.2f" %upositive) @@ -249,7 +254,7 @@ self.record_maxspeed.set_text("%0.2f" %maxspeed) self.record_pace.set_text("%0.2f" %pace) self.record_maxpace.set_text("%0.2f" %maxpace) - + self.record_sport.set_text(sport) #self.record_date.set_text(str(date)) self.record_date.set_text(recordDate) @@ -290,7 +295,7 @@ self.record_vbox.remove(child) self.record_vbox.set_sensitive(0) logging.debug("<<") - + def actualize_heartrategraph(self,record_list): logging.debug(">>") self.drawareaheartrate.drawgraph(record_list) @@ -354,12 +359,12 @@ maxspeed = self.parseFloat(record[9]) if record[10] > maxbeats: maxbeats = self.parseFloat(record[10]) - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": distance = km2miles(distance) maxspeed = km2miles(maxspeed) - - if tbeats > 0: + + if tbeats > 0: tbeats = tbeats/(timeinseconds/60/60) if distance > 0: average = distance/(timeinseconds/60/60) @@ -367,7 +372,7 @@ maxpace = "%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60) if average > 0: pace = "%d.%02d" %((3600/average)/60,(3600/average)%60) - + self.dayview.set_sensitive(1) self.day_distance.set_text("%0.2f" %distance) hour,min,sec=self.parent.date.second2time(timeinseconds) @@ -382,11 +387,11 @@ self.day_maxpace.set_text(maxpace) self.day_calories.set_text("%0.0f" %calories) self.day_topic.set_text(str(record[1])) - + else: self.dayview.set_sensitive(0) logging.debug("<<") - + def actualize_daygraph(self,record_list): logging.debug(">>") if len(record_list)>0: @@ -395,14 +400,14 @@ self.day_vbox.set_sensitive(0) self.drawareaday.drawgraph(record_list) logging.debug("<<") - + def actualize_map(self,id_record, full_screen=False): logging.debug(">>") #Check which type of map viewer to use if self.radiobuttonOSM.get_active(): #Use OSM to draw map logging.debug("Using OSM to draw map....") - self.googlemaps.drawMap(-9999) #TODO placeholder for OSM code + self.googlemaps.drawMap(-9999) #TODO placeholder for OSM code elif self.radiobuttonGMap.get_active(): #Use Google to draw map logging.debug("Using Google to draw map") @@ -414,7 +419,7 @@ #Unknown map type... logging.error("Unknown map viewer requested") logging.debug("<<") - + def actualize_weekview(self, record_list, date_ini, date_end): logging.debug(">>") date_s = datetime.datetime.strptime(date_ini, "%Y-%m-%d") @@ -430,7 +435,7 @@ pace = "0.00" maxpace = "0.00" maxbeats = 0 - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": self.w_distance_unit.set_text(_("miles")) self.w_speed_unit.set_text(_("miles/h")) @@ -458,24 +463,24 @@ maxspeed = self.parseFloat(record[7]) if record[8] > maxbeats: maxbeats = self.parseFloat(record[8]) - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": km = km2miles(km) maxspeed = km2miles(maxspeed) - + if time_in_min > 0: - tbeats = tbeats/time_in_min + tbeats = tbeats/time_in_min else: tbeats = 0 average = (km/(time/3600)) - + if maxspeed > 0: #maxpace = 60/maxspeed maxpace = "%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60) if average > 0: #pace = 60/average pace = "%d.%02d" %((3600/average)/60,(3600/average)%60) - + self.weeka_distance.set_text("%0.2f" %km) hour,min,sec = self.parent.date.second2time(time) self.weeka_hour.set_text("%d" %hour) @@ -505,7 +510,7 @@ pace = "0.00" maxpace = "0.00" maxbeats = 0 - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": self.m_distance_unit.set_text(_("miles")) self.m_speed_unit.set_text(_("miles/h")) @@ -518,7 +523,7 @@ self.m_maxspeed_unit.set_text(_("km/h")) self.m_pace_unit.set_text(_("min/km")) self.m_maxpace_unit.set_text(_("min/km")) - + if num_records>0: for record in record_list: km += self.parseFloat(record[1]) @@ -533,24 +538,24 @@ maxspeed = self.parseFloat(record[7]) if record[8] > maxbeats: maxbeats = self.parseFloat(record[8]) - + if self.pytrainer_main.profile.getValue("pytraining","prf_us_system") == "True": km = km2miles(km) maxspeed = km2miles(maxspeed) - + if time_in_min > 0: - tbeats = tbeats/time_in_min + tbeats = tbeats/time_in_min else: tbeats = 0 average = (km/(time/3600)) - + if maxspeed > 0: #maxpace = 60/maxspeed maxpace = "%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60) if average > 0: #pace = 60/average pace = "%d.%02d" %((3600/average)/60,(3600/average)%60) - + self.montha_distance.set_text("%0.2f" %km) hour,min,sec = self.parent.date.second2time(time) self.montha_hour.set_text("%d" %hour) @@ -572,7 +577,7 @@ logging.debug(">>") self.drawareamonth.drawgraph(record_list, daysInMonth) logging.debug("<<") - + def actualize_yearview(self,record_list, year): logging.debug(">>") self.year_date.set_text("%d" %int(year)) @@ -599,11 +604,11 @@ if record[8] > maxbeats: maxbeats = self.parseFloat(record[8]) if time_in_min > 0: - tbeats = tbeats/time_in_min + tbeats = tbeats/time_in_min else: tbeats = 0 average = (km/(time/3600)) - + if maxspeed > 0: #maxpace = 60/maxspeed maxpace = "%d.%02d" %((3600/maxspeed)/60,(3600/maxspeed)%60) @@ -628,7 +633,7 @@ self.yearview.set_sensitive(0) self.drawareayear.drawgraph([]) logging.debug("<<") - + def actualize_yeargraph(self,record_list): logging.debug(">>") self.drawareayear.drawgraph(record_list) @@ -718,7 +723,7 @@ self.waypointeditor.createHtml(default_waypoint) self.waypointeditor.drawMap() logging.debug("<<") - + def set_waypoint_type(self, type): x = 0 tree_model = self.waypoint_type.get_model() @@ -733,8 +738,8 @@ self.waypoint_type.insert_text(0, type) self.waypoint_type.set_active(0) return - - + + def on_waypointTreeView_button_press(self, treeview, event): x = int(event.x) y = int(event.y) @@ -749,7 +754,7 @@ id_waypoint=selected.get_value(iter,0) self.parent.refreshWaypointView(id_waypoint) return False - + def on_listareasearch_clicked(self,widget): lisOpt = { _("Title"):"title", @@ -759,12 +764,12 @@ _("Time"):"time", _("Beats"):"beats", _("Average"):"average", - _("Calories"):"calories" + _("Calories"):"calories" } search_string = self.lsa_searchvalue.get_text() #ddbb_field = lisOpt[self.lsa_searchoption.get_active_text()] - self.parent.searchListView("title like '%"+search_string+"%'") - + self.parent.searchListView("title like '%"+search_string+"%'") + def create_menulist(self,column_names): i=0 for name in column_names: @@ -775,7 +780,7 @@ self.menulistviewOptions.append(item) i+=1 self.menulistviewOptions.show_all() - + def on_menulistview_activate(self,widget,widget2,widget_position): listMenus = { 0:"title", @@ -786,7 +791,7 @@ 5:"beats", 6:"average", 7:"calories" } - + items = self.menulistviewOptions.get_children() if items[widget_position-1].get_active(): newValue = "False" @@ -795,7 +800,7 @@ menufile = XMLParser(self.fileconf) menufile.setValue("listviewmenu",listMenus[widget_position-1],newValue) self.showAllRecordTreeViewColumns() - + def showAllRecordTreeViewColumns(self): menufile = XMLParser(self.fileconf) listMenus = { @@ -823,10 +828,10 @@ if numcolumn != 0 and self.menublocking != 1: menuItems[numcolumn-1].set_active(visible) self.menublocking = 1 - + def createWaypointEditor(self,WaypointEditor,waypoint, parent=None): self.waypointeditor = WaypointEditor(self.data_path, self.waypointvbox,waypoint,parent) - + def zoom_graph(self, y1limits=None, y1color=None, y1_linewidth=1): logging.debug(">>") logging.debug("Reseting graph Y axis with ylimits: %s" % str(y1limits) ) @@ -836,35 +841,40 @@ ###################### ## Lista de eventos ## ###################### - + + def on_window1_configure_event(self, widget, event): + #print widget #window widget + #print event # resize event + self.size = self.window1.get_size() + def on_buttonShowOptions_clicked(self, widget): position_set = self.hpaned1.get_property('position-set') if position_set: #Currently not showing options - show them self.hpaned1.set_property('position-set', False) - self.buttonShowOptions.set_tooltip_text(_('Hide graph display options') ) + self.buttonShowOptions.set_tooltip_text(_('Hide graph display options') ) else: #Hide options self.hpaned1.set_position(0) - self.buttonShowOptions.set_tooltip_text(_('Show graph display options') ) + self.buttonShowOptions.set_tooltip_text(_('Show graph display options') ) logging.debug('Position: %d' % self.hpaned1.get_position() ) logging.debug('Position set: %s' % self.hpaned1.get_property('position-set') ) - + def on_buttonRedrawMap_clicked(self, widget): logging.debug('on_buttonRedrawMap_clicked') self.parent.refreshMapView() - + def on_radiobuttonMap_toggled(self, widget): #Ignore the deselected toggle event if widget.get_active() == False: return logging.debug( 'on_radiobuttonMap_toggled '+ widget.get_name()+ ' activated') self.parent.refreshMapView() - + def on_hpaned1_move_handle(self, widget): print "Handler" print widget - + def on_spinbuttonY1_value_changed(self, widget): y1min = self.spinbuttonY1Min.get_value() y1max = self.spinbuttonY1Max.get_value() @@ -876,7 +886,7 @@ y1min -= 1 self.y1_limits=(y1min, y1max) self.zoom_graph(y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) - + def on_buttonResetGraph_clicked(self, widget): #self.zoom_graph() #Reset stored values @@ -884,13 +894,13 @@ self.y1_color = None self.y1_linewidth = 1 self.zoom_graph() - + def on_colorbuttonY1LineColor_color_set(self, widget): y1color = widget.get_color() cs = y1color.to_string() self.y1_color = cs[0:3] + cs[5:7] + cs[9:11] self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) - + def on_spinbuttonY1LineWeight_value_changed(self, widget): self.y1_linewidth = self.spinbuttonY1LineWeight.get_value_as_int() self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=self.y1_limits, y1color=self.y1_color, y1_linewidth=self.y1_linewidth) @@ -904,19 +914,19 @@ selected,iter = self.recordTreeView.get_selection().get_selected() id_record = selected.get_value(iter,0) self.parent.removeRecord(id_record) - + def on_export_csv_activate(self,widget): self.parent.exportCsv() - + def on_newrecord_clicked(self,widget): self.parent.newRecord() - + def on_edituser_activate(self,widget): self.parent.editProfile() - + def on_calendar_doubleclick(self,widget): self.parent.newRecord() - + def on_sportlist_changed(self,widget): logging.debug("--") if self.sportlist.get_active() != self.activeSport: @@ -924,7 +934,7 @@ self.parent.refreshGraphView(self.selected_view) else: logging.debug("on_sportlist_changed called with no change") - + def on_page_change(self,widget,gpointer,page): logging.debug("--") if page == 0: @@ -938,7 +948,7 @@ elif page == 4: self.selected_view="year" self.parent.refreshGraphView(self.selected_view) - + def on_recordpage_change(self,widget,gpointer,page): if page == 0: selected_view="info" @@ -949,12 +959,12 @@ elif page == 3: selected_view="heartrate" self.parent.refreshRecordGraphView(selected_view) - + def on_showmap_clicked(self,widget): self.infoarea.hide() self.maparea.show() self.parent.refreshMapView(full_screen=True) - + def on_hidemap_clicked(self,widget): self.maparea.hide() self.infoarea.show() @@ -962,11 +972,11 @@ def on_btnShowLaps_toggled(self,widget): logging.debug("--") self.parent.refreshGraphView(self.selected_view) - + def on_day_combovalue_changed(self,widget): logging.debug("--") self.parent.refreshGraphView(self.selected_view) - + def on_week_combovalue_changed(self,widget): logging.debug("--") self.parent.refreshGraphView(self.selected_view) @@ -974,11 +984,11 @@ def on_month_combovalue_changed(self,widget): logging.debug("--") self.parent.refreshGraphView(self.selected_view) - + def on_year_combovalue_changed(self,widget): logging.debug("--") self.parent.refreshGraphView(self.selected_view) - + def on_calendar_selected(self,widget): logging.debug("--") if self.block: @@ -997,7 +1007,7 @@ self.selected_view="month" self.parent.refreshListRecords() self.parent.refreshGraphView(self.selected_view) - + def on_calendar_next_year(self,widget): logging.debug("--") self.block = True @@ -1005,20 +1015,20 @@ self.selected_view="year" self.parent.refreshListRecords() self.parent.refreshGraphView(self.selected_view) - + def on_classicview_activate(self,widget): self.waypointarea.hide() self.listarea.hide() self.selected_view = "record" self.classicarea.show() - + def on_listview_activate(self,widget): self.waypointarea.hide() self.classicarea.hide() self.selected_view = "listview" self.parent.refreshListView() self.listarea.show() - + def on_waypointsview_activate(self,widget): self.listarea.hide() self.classicarea.hide() @@ -1027,14 +1037,14 @@ def on_menu_importdata_activate(self,widget): self.parent.importData() - + def on_extensions_activate(self,widget): self.parent.editExtensions() def on_gpsplugins_activate(self,widget): self.parent.editGpsPlugins() #hasta aqui revisado - + def on_allRecordTreeView_button_press(self, treeview, event): logging.debug(">>") #print "on_allRecordTreeView_" @@ -1059,7 +1069,7 @@ self.parent.refreshGraphView("record") logging.debug("<<") return False - + def actualize_recordTreeView(self, record_list): logging.debug(">>") iterOne = False @@ -1070,7 +1080,7 @@ gobject.TYPE_STRING, #Distance object) for i in record_list: - #Get lap info + #Get lap info id_record = i[8] laps = self.parent.record.getLaps(id_record) iter = store.append(None) @@ -1090,12 +1100,12 @@ ) if laps is not None: for lap in laps: - #"id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number", - lapNumber = "%s%d" % ( _("lap"), int(lap[9])+1 ) + #"id_lap, record, elapsed_time, distance, start_lat, start_lon, end_lat, end_lon, calories, lap_number", + lapNumber = "%s%d" % ( _("lap"), int(lap[9])+1 ) distance = "%0.2f" % (float(lap[3]) / 1000.0) timeHours = int(float(lap[2]) / 3600) timeMin = int((float(lap[2]) / 3600.0 - timeHours) * 60) - timeSec = float(lap[2]) - (timeHours * 3600) - (timeMin * 60) + timeSec = float(lap[2]) - (timeHours * 3600) - (timeMin * 60) if timeHours > 0: duration = "%d%s%02d%s%02d%s" % (timeHours, _("h"), timeMin, _("m"), timeSec, _("s")) else: @@ -1114,7 +1124,7 @@ self.recordTreeView.get_selection().select_iter(iterOne) logging.debug("<<") #if len(record_list)>0: - + def parseFloat(self,string): try: return float(string) @@ -1140,6 +1150,9 @@ return None def quit(self, *args): + window_size = "%d, %d" % self.size + + self.pytrainer_main.profile.setValue("pytraining","window_size", window_size) self.parent.quit() #sys.exit("Exit!") #self.parent.webservice.stop() @@ -1149,7 +1162,7 @@ self.notebook.set_current_page(2) self.selected_view="year" self.actualize_yearview() - + def on_recordTree_clicked(self,widget,num,num2): selected,iter = self.recordTreeView.get_selection().get_selected() self.parent.editRecord(selected.get_value(iter,0)) @@ -1164,16 +1177,16 @@ desc = self.waypoint_description.get_text() sym = self.waypoint_type.get_active_text() self.parent.updateWaypoint(id_waypoint,lat,lon,name,desc,sym) - + def on_removewaypoint_clicked(self,widget): selected,iter = self.waypointTreeView.get_selection().get_selected() id_waypoint = selected.get_value(iter,0) self.parent.removeWaypoint(id_waypoint) def on_hrpiebutton_clicked(self,widget): - self.heartrate_vbox2.show() - self.heartrate_vbox.hide() - + self.heartrate_vbox2.show() + self.heartrate_vbox.hide() + def on_hrplotbutton_clicked(self,widget): - self.heartrate_vbox.show() - self.heartrate_vbox2.hide() + self.heartrate_vbox.show() + self.heartrate_vbox2.hide() Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-05-16 02:16:10 UTC (rev 580) +++ pytrainer/trunk/pytrainer/main.py 2010-05-16 03:00:24 UTC (rev 581) @@ -57,9 +57,9 @@ from lib.heartrate import * class pyTrainer: - def __init__(self,filename = None, data_path = None): + def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#580" + self.version ="1.7.2_svn#581" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -80,18 +80,18 @@ self.prf_us_system = False self.ddbb = DDBB(self.profile) logging.debug('connecting to DDBB') - self.ddbb.connect() + self.ddbb.connect() #Get user's DB version currentDB_version = self.profile.getValue("pytraining","DB_version") logging.debug("Current DB version: "+str(currentDB_version)) - # DB check can be triggered either via new version (mandatory) or as runtime parameter (--check) + # DB check can be triggered either via new version (mandatory) or as runtime parameter (--check) if self.startup_options.check: # User requested check - self.sanityCheck() + self.sanityCheck() elif currentDB_version is None: # No stored DB version - check DB etc - self.sanityCheck() + self.sanityCheck() elif self.DB_version > int(currentDB_version): # DB version expected is newer than user's version - check DB etc - self.sanityCheck() + self.sanityCheck() else: logging.info('No sanity check requested') self.record = Record(data_path,self) @@ -108,19 +108,19 @@ self.windowmain.createMap(Googlemaps,self.waypoint) self.windowmain.createWaypointEditor(WaypointEditor,self.waypoint, parent=self) self.windowmain.on_calendar_selected(None) - self.refreshMainSportList() + self.refreshMainSportList() self.windowmain.run() - logging.debug('<<') + logging.debug('<<') - + def get_options(self): ''' Define usage and accepted options for command line startup - + returns: options - dict with option: value pairs ''' usage = '''usage: %prog [options] - + For more help on valid options try: %prog -h ''' parser = OptionParser(usage=usage) @@ -147,13 +147,13 @@ rotHandler.setFormatter(formatter) logging.getLogger('').addHandler(rotHandler) self.set_logging_level(self.startup_options.log_level) - + def set_logging_level(self, level): '''Set level of information written to log''' logging.debug("Setting logger to level: "+ str(level)) logging.getLogger('').setLevel(level) - def quit(self): + def quit(self): logging.debug('--') logging.info("Exit!") #self.webservice.stop() @@ -171,7 +171,7 @@ txtbutton = self.plugins.loadPlugin(plugin) self.windowmain.addImportPlugin(txtbutton) logging.debug('<<') - + def loadExtensions(self): logging.debug('>>') activeextensions = self.extension.getActiveExtensions() @@ -188,8 +188,8 @@ self.pluginClass = self.plugins.importClass(pathPlugin) pluginFiles = self.pluginClass.run() if pluginFiles is not None: - logging.debug("Plugin returned %d files" % (len(pluginFiles)) ) - #process returned GPX files + logging.debug("Plugin returned %d files" % (len(pluginFiles)) ) + #process returned GPX files for (pluginFile, sport) in pluginFiles: if os.path.isfile(pluginFile): logging.info('File exists. Size: %d. Sport: %s' % (os.path.getsize(pluginFile), sport)) @@ -213,13 +213,13 @@ # alert = self.extension.runExtension(pathExtension,id) logging.debug('<<') - + def refreshMainSportList(self): logging.debug('>>') listSport = self.profile.getSportList() self.windowmain.updateSportList(listSport) logging.debug('<<') - + def refreshGraphView(self, view, sport=None): logging.debug('>>') if self.windowmain is None: @@ -271,7 +271,7 @@ else: print "Unknown view %s" % view logging.debug('<<') - + def refreshRecordGraphView(self, view): logging.debug('>>') logging.info('Working on '+view+' graph') @@ -315,7 +315,7 @@ karvonen_method = self.profile.getValue("pytraining","prf_hrzones_karvonen") self.windowmain.actualize_hrview(record_list,zones,karvonen_method) logging.debug('<<') - + def refreshMapView(self, full_screen=False): logging.debug('>>') if self.windowmain is None: @@ -345,19 +345,19 @@ record_list = self.record.getAllRecordList() self.windowmain.actualize_listview(record_list) logging.debug('<<') - + def refreshWaypointView(self,default_waypoint=None,redrawmap=1): logging.debug('>>') waypoint_list = self.waypoint.getAllWaypoints() self.windowmain.actualize_waypointview(waypoint_list,default_waypoint,redrawmap) logging.debug('<<') - + def searchListView(self,condition): logging.debug('>>') record_list = self.record.getRecordListByCondition(condition) self.windowmain.actualize_listview(record_list) logging.debug('<<') - + def editExtensions(self): logging.debug('>>') before = self.extension.getActiveExtensions() @@ -375,8 +375,8 @@ self.setMenuPlugins(activeplugins_before, activeplugins_after) self.refreshListRecords() self.refreshGraphView(self.windowmain.selected_view) - logging.debug('<<') - + logging.debug('<<') + def editGpsPlugins(self): logging.debug('>>') activeplugins_before = self.plugins.getActivePlugins() @@ -385,7 +385,7 @@ #Need to check for plugins that have been disabled (were active and now are not) self.setMenuPlugins(activeplugins_before, activeplugins_after) logging.debug('<<') - + def setMenuPlugins(self, activeplugins_before, activeplugins_after): logging.debug('>>') #Need to check for plugins that have been disabled (were active and now are not) @@ -401,7 +401,7 @@ txtbutton = self.plugins.loadPlugin(plugin) self.windowmain.addImportPlugin(txtbutton) logging.debug('<<') - + def setExtensions(self, before, after): logging.debug('>>') #Need to check for extensions that have been disabled (were active and now are not) @@ -449,7 +449,7 @@ warning.run() self.refreshListRecords() logging.debug('<<') - + def removeWaypoint(self,id_waypoint, confirm = False): logging.debug('>>') if confirm: @@ -468,14 +468,14 @@ self.waypoint.updateWaypoint(id_waypoint,lat,lon,name,desc,sym) self.refreshWaypointView(id_waypoint) logging.debug('<<') - + def exportCsv(self): logging.debug('>>') from save import Save save = Save(self.data_path, self.record) save.run() - logging.debug('<<') - + logging.debug('<<') + def editProfile(self): logging.debug('>>') self.profile.editProfile() @@ -483,7 +483,7 @@ def sanityCheck(self): """23.11.2009 - dgranda - Checks database and configuration file + Checks database and configuration file args: none returns: none""" logging.debug('>>') Modified: pytrainer/trunk/pytrainer/profile.py =================================================================== --- pytrainer/trunk/pytrainer/profile.py 2010-05-16 02:16:10 UTC (rev 580) +++ pytrainer/trunk/pytrainer/profile.py 2010-05-16 03:00:24 UTC (rev 581) @@ -36,18 +36,18 @@ self.gpxdir = None self.extensiondir = None self.plugindir = None - #Set configuration parameters + #Set configuration parameters self._setHome() self._setConfFiles() self._setTempDir() self._setExtensionDir() self._setPluginDir() self._setGpxDir() - + #Clear temp dir logging.debug("clearing tmp directory %s" % self.tmpdir) self._clearTempDir() - + #Profile Options and Defaults self.profile_options = { "prf_name":"default", @@ -69,6 +69,7 @@ "auto_launch_file_selection":"False", "import_default_tab":"0", "default_viewer":"0", + "window_size":"800, 640", } #Parse pytrainer configuration file @@ -87,7 +88,7 @@ print "Unsupported sys.platform: %s." % sys.platform sys.exit(1) self.home = os.environ[variable] - + def _setTempDir(self): self.tmpdir = self.confdir+"/tmp" if not os.path.isdir(self.tmpdir): @@ -105,7 +106,7 @@ fullname = (os.path.join(self.tmpdir, name)) if os.path.isfile(fullname): os.remove(os.path.join(self.tmpdir, name)) - + def _setConfFiles(self): if sys.platform == "win32": self.confdir = self.home+"/pytrainer" @@ -117,17 +118,17 @@ self.conffile = self.confdir+"/conf.xml" if not os.path.isdir(self.confdir): os.mkdir(self.confdir) - + def _setGpxDir(self): self.gpxdir = self.confdir+"/gpx" if not os.path.isdir(self.gpxdir): os.mkdir(self.gpxdir) - + def _setExtensionDir(self): self.extensiondir = self.confdir+"/extensions" if not os.path.isdir(self.extensiondir): os.mkdir(self.extensiondir) - + def _setPluginDir(self): self.plugindir = self.confdir+"/plugins" if not os.path.isdir(self.plugindir): @@ -142,7 +143,7 @@ def _parse_config_file(self, config_file): ''' Parse the xml configuration file and convert to a dict - + returns: dict with option as key ''' if config_file is None: @@ -170,10 +171,10 @@ value = pytraining_tag.get(key) #If property is not found, set it to the default if value is None: - config_needs_update = True + config_needs_update = True value = default config[key] = value - #Added a property, so update config + #Added a property, so update config if config_needs_update: self.setProfile(config) return config @@ -182,7 +183,7 @@ logging.error(str(e)) logging.error("Fatal error, exiting") exit(-3) - + def getValue(self, tag, variable): if tag != "pytraining": print "ERROR - pytraining is the only profile tag supported" @@ -190,12 +191,12 @@ elif not self.configuration.has_key(variable): return None return self.configuration[variable] - + def setValue(self, tag, variable, value, delay_write=False): logging.debug(">>") if tag != "pytraining": print "ERROR - pytraining is the only profile tag supported" - logging.debug("Setting %s to %s" % (variable, value)) + logging.debug("Setting %s to %s" % (variable, value)) self.xml_tree.getroot().set(variable, value.decode('utf-8')) if not delay_write: logging.debug("Writting...") @@ -207,7 +208,7 @@ for option, value in list_options.items(): logging.debug("Adding "+option+"|"+value) self.setValue("pytraining",option,value,delay_write=True) - self.xml_tree.write(self.config_file, xml_declaration=True, encoding='UTF-8') + self.xml_tree.write(self.config_file, xml_declaration=True, encoding='UTF-8') logging.debug("<<") def getSportList(self): @@ -223,7 +224,7 @@ """31.08.2008 - dgranda It adds a new sport. arguments: - sport: sport's name + sport: sport's name met: weight: returns: id_sports from new sport""" @@ -234,7 +235,7 @@ sport_id = self.pytrainer_main.ddbb.select("sports","id_sports","name=\"%s\"" %(sport)) logging.debug("<<") return sport_id - + def delSport(self,sport): logging.debug(">>") condition = "name=\"%s\"" %sport @@ -243,15 +244,15 @@ self.pytrainer_main.ddbb.delete("records","sport=\"%d\""%id_sport) self.pytrainer_main.ddbb.delete("sports","id_sports=\"%d\""%id_sport) logging.debug("<<") - + def updateSport(self,oldnamesport,newnamesport,newmetsport,newweightsport): logging.debug("--") self.pytrainer_main.ddbb.update("sports","name,met,weight",[newnamesport,newmetsport,newweightsport],"name=\"%s\""%oldnamesport) - + def getSportInfo(self,namesport): logging.debug("--") return self.pytrainer_main.ddbb.select("sports","name,met,weight","name=\"%s\""%namesport)[0] - + def build_ddbb(self): logging.debug("--") self.pytrainer_main.ddbb.build_ddbb() @@ -267,7 +268,7 @@ profilewindow.setValues(self.configuration) profilewindow.run() logging.debug("<<") - + def actualize_mainsportlist(self): logging.debug("--") self.pytrainer_main.refreshMainSportList() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dg...@us...> - 2010-06-08 16:58:37
|
Revision: 598 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=598&view=rev Author: dgranda Date: 2010-06-08 16:58:31 +0000 (Tue, 08 Jun 2010) Log Message: ----------- Added some structure for equipment view Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-06-07 17:30:56 UTC (rev 597) +++ pytrainer/trunk/glade/pytrainer.glade 2010-06-08 16:58:31 UTC (rev 598) @@ -5070,10 +5070,69 @@ <child> <widget class="GtkVBox" id="equipview"> <property name="visible">True</property> - <property name="sensitive">False</property> + <property name="sensitive">True</property> <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="border_width">5</property> + <property name="spacing">8</property> + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="label" translatable="yes">Category:</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkComboBoxEntry" id="record_combovalue1"> + <property name="visible">True</property> + <property name="sensitive">True</property> + <property name="items" translatable="yes">Running shoes +GPS watch +T-shirts +Tyres +Socks</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <widget class="GtkButton" id="button3"> + <property name="label" translatable="yes">New equipment</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image_position">right</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> <placeholder/> </child> + <child> + <placeholder/> + </child> </widget> <packing> <property name="position">5</property> @@ -5081,7 +5140,7 @@ </child> <child> <widget class="GtkLabel" id="label15"> - <property name="sensitive">False</property> + <property name="visible">True</property> <property name="label" translatable="yes">Equipment</property> </widget> <packing> Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-06-07 17:30:56 UTC (rev 597) +++ pytrainer/trunk/pytrainer/main.py 2010-06-08 16:58:31 UTC (rev 598) @@ -57,7 +57,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#596" + self.version ="1.7.2_svn#598" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-07-05 09:21:41
|
Revision: 601 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=601&view=rev Author: jblance Date: 2010-07-05 09:21:33 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Update to wordpress extension to publish in US units and data if this preference is selected Modified Paths: -------------- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py pytrainer/trunk/extensions/wordpress/wordpress.py pytrainer/trunk/pytrainer/lib/activity.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/extensions/openstreetmap/openstreetmap.py =================================================================== --- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-07-05 08:36:27 UTC (rev 600) +++ pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-07-05 09:21:33 UTC (rev 601) @@ -19,7 +19,7 @@ self.tags = "" self.visibility = "private" - def run(self, id): + def run(self, id, activity=None): #TODO Convert to use activity... logging.debug(">>") uri = "http://api.openstreetmap.org/api/0.6/gpx/create" #URI for uploading traces to OSM if 'username' not in self.options or self.options['username'] == "" or 'password' not in self.options or self.options['password'] == "": @@ -50,7 +50,7 @@ self.display_options_window() fields = (("description",self.description), ("tags",self.tags), ("visibility",self.visibility)) logging.debug("Added fields: %s" % str(fields)) - #Multipart encode the request + #Multipart encode the request boundary, body = self.multipart_encode(fields=fields, files=(("file", f),)) content_type = 'multipart/form-data; boundary=%s' % boundary #Finished with the file so close it @@ -68,7 +68,7 @@ md.set_title(_("Openstreetmap Extension Processing")) md.set_modal(True) md.show() - while gtk.events_pending(): # This allows the GUI to update + while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action logging.debug("before request posting") #POST request to OSM @@ -91,44 +91,44 @@ else: logging.error("GPX file: %s NOT found!!!" % (gpx_file)) logging.debug("<<") - + def display_options_window(self): self.prefwindow = gtk.Dialog(title=_("Please add any additional information for this upload"), parent=None, flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) self.prefwindow.set_modal(False) table = gtk.Table(1,2) self.entryList = [] - #Add description + #Add description label = gtk.Label("<b>Description</b>") label.set_use_markup(True) entry = gtk.Entry() self.entryList.append(entry) - table.attach(label,0,1,0,1) + table.attach(label,0,1,0,1) table.attach(entry,1,2,0,1) #Add tags label = gtk.Label("<b>Tags</b>") label.set_use_markup(True) entry = gtk.Entry() - self.entryList.append(entry) + self.entryList.append(entry) table.attach(label,0,1,1,2) table.attach(entry,1,2,1,2) #Add visibility label = gtk.Label("<b>Visibility</b>") label.set_use_markup(True) combobox = gtk.combo_box_new_text() - combobox.append_text("private") + combobox.append_text("private") combobox.append_text("public") - combobox.append_text("trackable") + combobox.append_text("trackable") combobox.append_text("identifiable") combobox.set_active(0) table.attach(combobox,1,2,2,3) - self.entryList.append(combobox) + self.entryList.append(combobox) table.attach(label,0,1,2,3) #Buld dialog and show self.prefwindow.vbox.pack_start(table) self.prefwindow.show_all() self.prefwindow.connect("response", self.on_options_ok_clicked) self.prefwindow.run() - + def on_options_ok_clicked(self, widget, response_id): widget.destroy() self.description = self.entryList[0].get_text() @@ -138,7 +138,7 @@ self.tags = self.entryList[1].get_text() self.visibility = self.entryList[2].get_active_text() logging.debug("Description: %s, tags: %s, visibility: %s" % ( self.description, self.tags, self.visibility) ) - + def multipart_encode(self, fields, files, boundary = None, buffer = None): ''' Multipart encode data for posting Modified: pytrainer/trunk/extensions/wordpress/wordpress.py =================================================================== --- pytrainer/trunk/extensions/wordpress/wordpress.py 2010-07-05 08:36:27 UTC (rev 600) +++ pytrainer/trunk/extensions/wordpress/wordpress.py 2010-07-05 09:21:33 UTC (rev 601) @@ -37,14 +37,14 @@ self.options = options self.conf_dir = conf_dir - def run(self, id): + def run(self, id, activity=None): #Show user something is happening msg = _("Posting to Wordpress blog") md = gtk.MessageDialog(self.pytrainer_main.windowmain.window1, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE, msg) md.set_title(_("Wordpress Extension Processing")) md.set_modal(True) md.show() - while gtk.events_pending(): # This allows the GUI to update + while gtk.events_pending(): # This allows the GUI to update gtk.main_iteration() # before completion of this entire action logging.debug("before request posting") options = self.options @@ -53,11 +53,12 @@ self.password = options["wordpresspass"] self.gpxfile = "%s/gpx/%s.gpx" %(self.conf_dir,id) self.googlekey = options["googlekey"] - self.idrecord = id #options.idrecord + self.idrecord = id + self.activity = activity self.wordpresscategory = options["wordpresscategory"] - debug_msg = "%s, %s, %s, %s, %s, %s" % (self.wordpressurl, self.user, self.gpxfile, self.googlekey, self.idrecord, self.wordpresscategory) + debug_msg = "%s, %s, %s, %s, %s, %s" % (self.wordpressurl, self.user, self.gpxfile, self.googlekey, self.idrecord, self.wordpresscategory) logging.debug(debug_msg) - try: + try: self.wp = wordpresslib.WordPressClient(self.wordpressurl, self.user, self.password) #TODO remove need for wordpresslib?? self.error = False except: @@ -66,58 +67,59 @@ self.loadRecordInfo() if self.title is None: self.title = "No Title" + blog_table = self.createTable() blog_route = self.createRoute() blog_body = self.createBody() - blog_table = self.createTable() + blog_figureHR = self.createFigureHR() blog_figureStage = self.createFigureStage() blog_foot = self.createFoot() - + self.description = "<![CDATA["+blog_body+blog_table+blog_route+blog_figureHR+blog_figureStage+blog_foot+"]]>" - xmlstuff = '''<methodCall> -<methodName>metaWeblog.newPost</methodName> -<params> -<param> -<value> -<string>MyBlog</string> -</value> -</param> -<param> -<value>%s</value> -</param> -<param> -<value> -<string>%s</string> -</value> -</param> -<param> -<struct> -<member> -<name>categories</name> -<value> -<array> + xmlstuff = '''<methodCall> +<methodName>metaWeblog.newPost</methodName> +<params> +<param> +<value> +<string>MyBlog</string> +</value> +</param> +<param> +<value>%s</value> +</param> +<param> +<value> +<string>%s</string> +</value> +</param> +<param> +<struct> +<member> +<name>categories</name> +<value> +<array> <data> -<value>%s</value> -</data> -</array> -</value> -</member> -<member> -<name>description</name> <value>%s</value> -</member> -<member> -<name>title</name> -<value>%s</value> -</member> -</struct> -</param> +</data> +</array> +</value> +</member> +<member> +<name>description</name> +<value>%s</value> +</member> +<member> +<name>title</name> +<value>%s</value> +</member> +</struct> +</param> <param> <value> <boolean>1</boolean> </value> -</param> -</params> +</param> +</params> </methodCall> ''' % (self.user, self.password, self.wordpresscategory, self.description, self.title) @@ -138,7 +140,7 @@ md.set_modal(False) md.run() md.destroy() - + def createRoute(self): gpxpath = "/tmp/gpstrace.gpx.txt" htmlpath = "/tmp/index.html" #TODO fix to use correct tmp dir @@ -150,8 +152,8 @@ #create the html file googlemaps.drawMap(self.gpxfile,self.googlekey,htmlpath) #TODO fix to use main googlemaps and remove extensions copy #create the kml file - os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) #TODO fix to remove gpsbabel - + os.system("gpsbabel -t -i gpx -f %s -o kml,points=0,line_color=ff0000ff -F %s" %(self.gpxfile,kmlpath)) #TODO fix to remove gpsbabel + #gfile = self.wp.newMediaObject(self.gpxfile) gfile = self.wp.newMediaObject(gpxpath) hfile = self.wp.newMediaObject(htmlpath) @@ -163,28 +165,33 @@ return description_route def loadRecordInfo(self): - date = Date() - record = self.pytrainer_main.record.getrecordInfo(self.idrecord)[0] + #date = Date() + #record = self.pytrainer_main.record.getrecordInfo(self.idrecord)[0] #"sports.name,date,distance,time,beats,comments,average,calories,id_record,title,upositive,unegative,maxspeed,maxpace,pace,maxbeats,date_time_utc,date_time_local", - self.sport = record[0] - self.date = record[1] - self.distance = record[2] - self.time = date.second2time(float(record[3])) - self.beats = record[4] - self.comments = record[5] - self.average = record[6] - self.calories = record[7] - self.title = record[9] - self.upositive = record[10] - self.unegative = record[11] - self.maxspeed = record[12] - self.maxpace = record[13] - self.pace = record[14] - self.maxbeats = record[15] + self.sport = self.activity.sport_name + self.date = self.activity.date + self.distance = self.activity.distance + self.time = "%d:%02d:%02d" % (self.activity.time_tuple) + print self.time + self.beats = self.activity.beats + self.comments = self.activity.comments + self.average = self.activity.average + self.calories = self.activity.calories + self.title = self.activity.title + self.upositive = self.activity.upositive + self.unegative = self.activity.unegative + self.maxspeed = self.activity.maxspeed + self.maxpace = self.activity.maxpace + self.pace = self.activity.pace + self.maxbeats = self.activity.maxbeats + self.distance_unit = self.activity.distance_unit + self.speed_unit = self.activity.speed_unit + self.pace_unit = self.activity.pace_unit + self.height_unit = self.activity.height_unit def createBody(self): - return '''<b> Description: </b><br/>%s<br/>''' %self.comments - + return '''<b> Description: </b><br/>%s<br/>''' %self.activity.comments + def createTable(self): description_table = ''' <br/> @@ -196,22 +203,22 @@ <td>%s</td> </tr> <tr> - <td><strong>Distance:</strong></td> + <td><strong>Distance (%s):</strong></td> + <td>%.2f</td> + <td><strong>Time (hh:mm:ss):</strong></td> <td>%s</td> - <td><strong>Time (hh, mm, ss):</strong></td> - <td>%s</td> </tr> <tr> - <td><strong>Max speed:</strong></td> - <td>%s</td> - <td><strong>Avg speed (km/h):</strong></td> - <td>%s</td> + <td><strong>Max speed (%s):</strong></td> + <td>%.2f</td> + <td><strong>Avg speed (%s):</strong></td> + <td>%.2f</td> </tr> <tr> - <td><strong>Max pace (min/km):</strong></td> - <td>%s</td> - <td><strong>Avg pace (min/km):</strong></td> - <td>%s</td> + <td><strong>Max pace (%s):</strong></td> + <td>%.2f</td> + <td><strong>Avg pace (%s):</strong></td> + <td>%.2f</td> </tr> <tr> <td><strong>Max pulse:</strong></td> @@ -220,13 +227,16 @@ <td>%s</td> </tr> <tr> - <td><strong>Acc elevation +:</strong></td> - <td>%s</td> - <td><strong>Acc elevation -:</strong></td> - <td>%s</td> + <td><strong>Acc elevation (+%s):</strong></td> + <td>%.2f</td> + <td><strong>Acc elevation (-%s):</strong></td> + <td>%.2f</td> </tr> - </table> - ''' %(self.sport,self.date,self.distance,self.time,self.maxspeed,self.average,self.maxpace,self.pace,self.maxbeats,self.beats,self.upositive,self.unegative) + </table> + ''' %( self.sport, self.date, self.distance_unit, self.distance, self.time, self.speed_unit, self.maxspeed, + self.speed_unit, self.average, self.pace_unit, self.maxpace,self.pace_unit, self.pace, + self.maxbeats, self.beats, self.height_unit, self.upositive, self.height_unit, self.unegative) + print description_table return description_table def createFigureHR(self): @@ -251,13 +261,13 @@ def createFoot(self): return ''' <br/><center>Powered by <a href='http://sourceforge.net/projects/pytrainer/'>Pytrainer</a></center>''' - + def createTitle(self): if self.title==None: self.error = True self.log = "A Title must be defined. Please, configure the record properly" return self.title - + def createCategory(self): if self.wordpresscategory==None: self.error = True Modified: pytrainer/trunk/pytrainer/lib/activity.py =================================================================== --- pytrainer/trunk/pytrainer/lib/activity.py 2010-07-05 08:36:27 UTC (rev 600) +++ pytrainer/trunk/pytrainer/lib/activity.py 2010-07-05 09:21:33 UTC (rev 601) @@ -22,6 +22,7 @@ import dateutil.parser from dateutil.tz import * # for tzutc() +from pytrainer.lib.date import Date from pytrainer.lib.gpx import Gpx from pytrainer.lib.graphdata import GraphData from pytrainer.lib.unitsconversor import * @@ -38,6 +39,7 @@ distance_unit - (string) unit to use for distance speed_unit - (string) unit to use for speed height_unit - (string) unit to use for height + pace_unit - (string) unit to use for pace gpx_file - (string) gpx file name gpx - (Gpx class) actual gpx instance sport_name - (string) sport name @@ -45,6 +47,7 @@ title - (string) title of activity date - (string) date of activity time - (int) activity duration in seconds + time_tuple - (tuple) activity duration as hours, min, secs tuple beats - (int) average heartrate for activity maxbeats - (int) maximum heartrate for activity comments - (string) activity comments @@ -136,6 +139,7 @@ self.title = dict['title'] self.date = dict['date'] self.time = self._int(dict['time']) + self.time_tuple = Date().second2time(self.time) self.beats = self._int(dict['beats']) self.comments = dict['comments'] self.calories = self._int(dict['calories']) Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-07-05 08:36:27 UTC (rev 600) +++ pytrainer/trunk/pytrainer/main.py 2010-07-05 09:21:33 UTC (rev 601) @@ -38,15 +38,7 @@ from importdata import Importdata from plugins import Plugins from profile import Profile -#from recordgraph import RecordGraph -#from daygraph import DayGraph -#from weekgraph import WeekGraph -#from monthgraph import MonthGraph -#from yeargraph import YearGraph -#from heartrategraph import HeartRateGraph -#from extensions.mapviewer import MapViewer -#from extensions.waypointeditor import WaypointEditor from gui.windowimportdata import WindowImportdata from gui.windowmain import Main from gui.warning import Warning @@ -57,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#600" + self.version ="1.7.2_svn#601" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -71,11 +63,6 @@ logging.debug('Checking configuration and profile...') self.profile = Profile(self.data_path,self) self.windowmain = None - - #if self.profile.getValue("pytraining","prf_us_system") == "True": #TODO perhaps move to use dict? - # self.prf_us_system = True - #else: - # self.prf_us_system = False self.ddbb = DDBB(self.profile) logging.debug('connecting to DDBB') self.ddbb.connect() @@ -105,9 +92,6 @@ self.loadPlugins() self.loadExtensions() self.windowmain.setup() - #self.windowmain.createGraphs(RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph) - #self.windowmain.createMap(MapViewer,self.waypoint) - #self.windowmain.createWaypointEditor(WaypointEditor,self.waypoint, parent=self) self.windowmain.on_calendar_selected(None) self.refreshMainSportList() self.windowmain.run() @@ -206,9 +190,11 @@ def runExtension(self,extension,id): logging.debug('>>') + print("Extension id: %s" % str(id)) + activity = self.activitypool.get_activity(id) txtbutton,pathExtension,type = extension self.extensionClass = self.extension.importClass(pathExtension) - self.extensionClass.run(id) + self.extensionClass.run(id, activity) #if type == "record": # #Si es record le tenemos que crear el googlemaps, el gpx y darle el id de la bbdd # alert = self.extension.runExtension(pathExtension,id) @@ -469,8 +455,6 @@ logging.debug('>>') logging.info('Checking database integrity') self.ddbb.checkDBIntegrity() - #logging.info('Checking configuration file integrity') - #self.profile.checkProfile() logging.info('Setting DB version to: ' + str(self.DB_version)) self.profile.setValue("pytraining","DB_version", str(self.DB_version)) logging.debug('<<') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-07-07 09:56:47
|
Revision: 606 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=606&view=rev Author: jblance Date: 2010-07-07 09:56:40 +0000 (Wed, 07 Jul 2010) Log Message: ----------- Some initial GUI work for displaying athlete data (e.g. weight) Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/lib/activity.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/glade/pytrainer.glade 2010-07-07 09:56:40 UTC (rev 606) @@ -135,6 +135,17 @@ </widget> </child> <child> + <widget class="GtkRadioMenuItem" id="athleteview_item"> + <property name="visible">True</property> + <property name="label" translatable="yes"> _Athlete Data</property> + <property name="use_underline">True</property> + <property name="draw_as_radio">True</property> + <property name="group">classicview_item</property> + <signal name="activate" handler="on_athleteview_activate"/> + <accelerator key="a" signal="activate" modifiers="GDK_CONTROL_MASK"/> + </widget> + </child> + <child> <widget class="GtkRadioMenuItem" id="waipointsview_item"> <property name="visible">True</property> <property name="label" translatable="yes"> _Waypoints Editor</property> @@ -5070,7 +5081,6 @@ <child> <widget class="GtkVBox" id="equipview"> <property name="visible">True</property> - <property name="sensitive">True</property> <child> <widget class="GtkHBox" id="hbox6"> <property name="visible">True</property> @@ -5090,7 +5100,6 @@ <child> <widget class="GtkComboBoxEntry" id="record_combovalue1"> <property name="visible">True</property> - <property name="sensitive">True</property> <property name="items" translatable="yes">Running shoes GPS watch T-shirts @@ -5162,12 +5171,8 @@ </widget> </child> <child> - <widget class="GtkLabel" id="label154"> - <property name="visible">True</property> - <property name="label">label154</property> - </widget> + <placeholder/> <packing> - <property name="tab_fill">False</property> <property name="type">tab</property> </packing> </child> @@ -5287,13 +5292,8 @@ </packing> </child> <child> - <widget class="GtkLabel" id="llllll"> - <property name="visible">True</property> - <property name="label">label155</property> - </widget> + <placeholder/> <packing> - <property name="position">1</property> - <property name="tab_fill">False</property> <property name="type">tab</property> </packing> </child> @@ -5570,13 +5570,227 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label-46"> + <placeholder/> + <packing> + <property name="type">tab</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="athletearea"> <property name="visible">True</property> - <property name="label">label-2147483648</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">4</property> + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Name:</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Date of birth:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Height:</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelName"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelDOB"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelHeight"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Athlete Details</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="padding">6</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame6"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment13"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + <child> + <widget class="GtkHBox" id="boxAthleteGraph"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Detail</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">5</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment12"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkVBox" id="boxAthleteHistory"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>History</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">5</property> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="position">0</property> + </packing> + </child> </widget> <packing> - <property name="position">2</property> - <property name="tab_fill">False</property> + <property name="position">3</property> + </packing> + </child> + <child> + <placeholder/> + <packing> <property name="type">tab</property> </packing> </child> @@ -5733,7 +5947,7 @@ <property name="use_stock">False</property> <signal name="activate" handler="on_multiple_merge_ToDo"/> <child internal-child="image"> - <widget class="GtkImage" id="image2"> + <widget class="GtkImage" id="image3"> <property name="visible">True</property> <property name="icon_name">document-properties</property> </widget> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-07-07 09:56:40 UTC (rev 606) @@ -44,6 +44,8 @@ from pytrainer.extensions.mapviewer import MapViewer from pytrainer.extensions.waypointeditor import WaypointEditor +from pytrainer.gui.drawGraph import DrawGraph + class Main(SimpleGladeApp): def __init__(self, data_path = None, parent = None, version = None, gpxDir = None): def url_hook(dialog, url): @@ -633,6 +635,23 @@ self.drawareayear.drawgraph(record_list) logging.debug("<<") + def actualize_athleteview(self, athletedata): + logging.debug(">>") + self.labelName.set_text(athletedata["prf_name"]) + self.labelDOB.set_text(athletedata["prf_age"]) + self.labelHeight.set_text(athletedata["prf_height"]+" cm") + #TODO + self.grapher = DrawGraph(self, self.pytrainer_main) + from pytrainer.lib.graphdata import GraphData + datalist = GraphData(title="Weight", xlabel="Date", ylabel="kg") + datalist.addPoints(x=1, y=67) + datalist.addPoints(x=2, y=92) + datalist.addPoints(x=3, y=90) + datalist.addPoints(x=4, y=76) + self.grapher.drawPlot(datalist=datalist, box=self.boxAthleteGraph) + #TODO + logging.debug("<<") + def actualize_listview(self,record_list): logging.debug(">>") #recod list tiene: @@ -851,7 +870,7 @@ #Hide options self.hpaned1.set_position(0) self.buttonShowOptions.set_tooltip_text(_('Show graph display options') ) - logging.debug('Position: %d' % self.hpaned1.get_position() ) + #logging.debug('Position: %d' % self.hpaned1.get_position() ) logging.debug('Position set: %s' % self.hpaned1.get_property('position-set') ) def on_buttonRedrawMap_clicked(self, widget): @@ -1013,19 +1032,29 @@ def on_classicview_activate(self,widget): self.waypointarea.hide() self.listarea.hide() + self.athletearea.hide() self.selected_view = "record" self.classicarea.show() def on_listview_activate(self,widget): self.waypointarea.hide() self.classicarea.hide() + self.athletearea.hide() self.selected_view = "listview" self.parent.refreshListView() self.listarea.show() + def on_athleteview_activate(self,widget): + self.waypointarea.hide() + self.classicarea.hide() + self.listarea.hide() + self.parent.refreshAthleteView() + self.athletearea.show() + def on_waypointsview_activate(self,widget): self.listarea.hide() self.classicarea.hide() + self.athletearea.hide() self.parent.refreshWaypointView() self.waypointarea.show() Modified: pytrainer/trunk/pytrainer/lib/activity.py =================================================================== --- pytrainer/trunk/pytrainer/lib/activity.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/lib/activity.py 2010-07-07 09:56:40 UTC (rev 606) @@ -245,6 +245,7 @@ for track in self.tracklist: try: pace = 60/track['velocity'] + #pace = 0 if pace > 90 else pace except: pace = 0 if self.us_system: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/main.py 2010-07-07 09:56:40 UTC (rev 606) @@ -49,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#603" + self.version ="1.7.2_svn#606" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -304,6 +304,15 @@ self.windowmain.actualize_calendar(record_list) logging.debug('<<') + def refreshAthleteView(self): + logging.debug('>>') + athletedata = {} + athletedata['prf_name'] = self.profile.getValue("pytraining","prf_name") + athletedata['prf_age'] = self.profile.getValue("pytraining","prf_age") + athletedata['prf_height'] = self.profile.getValue("pytraining","prf_height") + self.windowmain.actualize_athleteview(athletedata) + logging.debug('<<') + def refreshListView(self): logging.debug('>>') record_list = self.record.getAllRecordList() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-08-26 03:46:49
|
Revision: 609 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=609&view=rev Author: jblance Date: 2010-08-26 03:46:42 +0000 (Thu, 26 Aug 2010) Log Message: ----------- Some minor GUI mods for Athlete view Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/drawGraph.py pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/lib/graphdata.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-07-11 04:49:45 UTC (rev 608) +++ pytrainer/trunk/glade/pytrainer.glade 2010-08-26 03:46:42 UTC (rev 609) @@ -5711,7 +5711,205 @@ <widget class="GtkHBox" id="hbox7"> <property name="visible">True</property> <child> - <placeholder/> + <widget class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="n_rows">6</property> + <property name="n_columns">3</property> + <child> + <widget class="GtkLabel" id="labelAthleteDate"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Date:</property> + </widget> + <packing> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelAthleteWeight"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Weight:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="buttonAlthleteSave"> + <property name="label" translatable="yes">Save</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entryAthleteDate"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entryAthleteWeight"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelAthleteBF"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Body Fat:</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entryAthleteBF"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entryAthleteRestingHR"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelRestingHeartRate"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Resting Heart Rate:</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="entryAthleteMaxHR"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelMaxHeartRate"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Max Heart Rate:</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelAthleteIdx"> + <property name="visible">True</property> + </widget> + <packing> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> </child> <child> <widget class="GtkHBox" id="boxAthleteGraph"> @@ -5756,7 +5954,22 @@ <widget class="GtkVBox" id="boxAthleteHistory"> <property name="visible">True</property> <child> - <placeholder/> + <widget class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <child> + <widget class="GtkTreeView" id="athleteTreeView"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <signal name="button_press_event" handler="on_athleteTreeView_button_press_event"/> + </widget> + </child> + </widget> + <packing> + <property name="position">0</property> + </packing> </child> </widget> </child> Modified: pytrainer/trunk/pytrainer/gui/drawGraph.py =================================================================== --- pytrainer/trunk/pytrainer/gui/drawGraph.py 2010-07-11 04:49:45 UTC (rev 608) +++ pytrainer/trunk/pytrainer/gui/drawGraph.py 2010-08-26 03:46:42 UTC (rev 609) @@ -52,20 +52,20 @@ #Debug info - to remove print("drawPlot....") #print datalist - + #Set up drawing area figure = plt.figure() canvas = FigureCanvasGTK(figure) # a gtk.DrawingArea canvas.show() - + #Display title etc + plt.xlabel(datalist.xlabel) + plt.ylabel(datalist.ylabel) + plt.title(datalist.title) #Plot data - data = datalist - plt.plot(data.x_values, data.y_values, linewidth=data.linewidth, color=data.linecolor ) + plt.plot(datalist.x_values, datalist.y_values, linewidth=datalist.linewidth, color=datalist.linecolor ) #Set axis limits - plt.axis([0, data.max_x_value, data.min_y_value, data.max_y_value]) - #Display title etc - plt.xlabel(data.xlabel) - plt.ylabel(data.ylabel) + plt.axis([datalist.min_x_value, datalist.max_x_value, datalist.min_y_value, datalist.max_y_value]) + #axis.set_xlim(0, data.max_x_value) #axis.set_ylim(0, data.max_y_value) Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-07-11 04:49:45 UTC (rev 608) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-08-26 03:46:42 UTC (rev 609) @@ -92,6 +92,9 @@ #create the columns for the waypoints treeview column_names=[_("id"),_("Waypoint")] self.create_treeview(self.waypointTreeView,column_names) + #create the columns for the history treeview + column_names=[_("id"),_("Date"),_("Weight"),_("Body Fat %"),_("Resting HR"),_("Max HR")] + self.create_treeview(self.athleteTreeView,column_names) self.fileconf = self.pytrainer_main.profile.confdir+"/listviewmenu.xml" if not os.path.isfile(self.fileconf): self._createXmlListView(self.fileconf) @@ -640,16 +643,37 @@ self.labelName.set_text(athletedata["prf_name"]) self.labelDOB.set_text(athletedata["prf_age"]) self.labelHeight.set_text(athletedata["prf_height"]+" cm") - #TODO + #Setup graph self.grapher = DrawGraph(self, self.pytrainer_main) from pytrainer.lib.graphdata import GraphData datalist = GraphData(title="Weight", xlabel="Date", ylabel="kg") - datalist.addPoints(x=1, y=67) - datalist.addPoints(x=2, y=92) - datalist.addPoints(x=3, y=90) - datalist.addPoints(x=4, y=76) + #TODO + #Create history treeview + history_store = gtk.ListStore( + gobject.TYPE_INT, #index + gobject.TYPE_STRING, #date + gobject.TYPE_STRING, #weight + gobject.TYPE_STRING, #body fat % + gobject.TYPE_INT, #resting HR + gobject.TYPE_INT #max HR + ) + for data_index, data in enumerate(athletedata['history']): + weight = float(data['Weight']) + date = dateutil.parser.parse(data['Date']).date() + + iter = history_store.append() + history_store.set ( + iter, + 0, data_index, + 1, date, #TODO need to sort date graphing... + 2, "%0.2f" % weight, + 3, "%0.2f" % float(data['BF']), + 4, int(data['RestingHR']), + 5, int(data['MaxHR']), + ) + datalist.addPoints(x=date, y=weight) + self.athleteTreeView.set_model(history_store) self.grapher.drawPlot(datalist=datalist, box=self.boxAthleteGraph) - #TODO logging.debug("<<") def actualize_listview(self,record_list): @@ -850,10 +874,47 @@ logging.debug("Reseting graph Y axis with ylimits: %s" % str(y1limits) ) self.drawarearecord.drawgraph(self.record_list,self.laps, y1limits=y1limits, y1color=y1color, y1_linewidth=y1_linewidth) logging.debug("<<") + + def update_athlete_item(self, idx, date, weight, bf, restingHR, maxHR): + logging.debug(">>") + #Prepare vars + idx = str(idx) + date = str(date) + weight = str(weight) + bf = str(bf) + restingHR = str(restingHR) + maxHR = str(maxHR) + #Set vars + self.labelAthleteIdx.set_text(idx) + self.entryAthleteDate.set_text(date) + self.entryAthleteWeight.set_text(weight) + self.entryAthleteBF.set_text(bf) + self.entryAthleteRestingHR.set_text(restingHR) + self.entryAthleteMaxHR.set_text(maxHR) + logging.debug("<<") ###################### ## Lista de eventos ## ###################### + + def on_athleteTreeView_button_press_event(self, treeview, event): + x = int(event.x) + y = int(event.y) + time = event.time + pthinfo = treeview.get_path_at_pos(x, y) + if pthinfo is not None: + path, col, cellx, celly = pthinfo + treeview.grab_focus() + treeview.set_cursor(path, col, 0) + selected,iter = treeview.get_selection().get_selected() + idx = selected.get_value(iter,0) + date = selected.get_value(iter,1) + weight = selected.get_value(iter,2) + bf = selected.get_value(iter,3) + restingHR = selected.get_value(iter,4) + maxHR = selected.get_value(iter,5) + self.update_athlete_item(idx, date, weight, bf, restingHR, maxHR) + #print path, col, cellx, celly def on_window1_configure_event(self, widget, event): #print widget #window widget Modified: pytrainer/trunk/pytrainer/lib/graphdata.py =================================================================== --- pytrainer/trunk/pytrainer/lib/graphdata.py 2010-07-11 04:49:45 UTC (rev 608) +++ pytrainer/trunk/pytrainer/lib/graphdata.py 2010-08-26 03:46:42 UTC (rev 609) @@ -41,6 +41,27 @@ if self.x_values is None: return None return len(self.x_values) + + def __str__(self): + return ''' +Title: %s +ylabel: %s +xlabel: %s +linewidth: %d +linecolor: %s +x min max: %s %s +y min max: %s %s +x values: %s +y values: %s''' % (self.title, + self.ylabel, + self.xlabel, + self.linewidth, + self.linecolor, + str(self.min_x_value), str(self.max_x_value), + str(self.min_y_value), str(self.max_y_value), + str(self.x_values), + str(self.y_values) + ) def addPoints(self, x=None, y=None): if x is None or y is None: @@ -49,11 +70,11 @@ #print('Adding point: %s %s' % (str(x), str(y))) self.x_values.append(x) self.y_values.append(y) - if x > self.max_x_value: + if self.max_x_value is None or x > self.max_x_value: self.max_x_value = x if self.min_x_value is None or x < self.min_x_value: self.min_x_value = x - if y > self.max_y_value: + if self.max_y_value is None or y > self.max_y_value: self.max_y_value = y if self.min_y_value is None or y < self.min_y_value: self.min_y_value = y Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-07-11 04:49:45 UTC (rev 608) +++ pytrainer/trunk/pytrainer/main.py 2010-08-26 03:46:42 UTC (rev 609) @@ -49,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#606" + self.version ="1.7.2_svn#609" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -310,6 +310,14 @@ athletedata['prf_name'] = self.profile.getValue("pytraining","prf_name") athletedata['prf_age'] = self.profile.getValue("pytraining","prf_age") athletedata['prf_height'] = self.profile.getValue("pytraining","prf_height") + athletedata['history'] = ( + {'Date':'2010-01-01', 'Weight':88.8, 'BF':15.0, 'RestingHR':67, 'MaxHR':220}, + {'Date':'2010-02-01', 'Weight':89.8, 'BF':16.0, 'RestingHR':68, 'MaxHR':221}, + {'Date':'2010-03-01', 'Weight':99.1, 'BF':13.0, 'RestingHR':65, 'MaxHR':212}, + {'Date':'2010-04-01', 'Weight':79.5, 'BF':11.0, 'RestingHR':61, 'MaxHR':210}, + {'Date':'2010-05-01', 'Weight':67.2, 'BF':13.0, 'RestingHR':60, 'MaxHR':205}, + {'Date':'2010-06-01', 'Weight':83.8, 'BF':16.0, 'RestingHR':56, 'MaxHR':200}, + ) self.windowmain.actualize_athleteview(athletedata) logging.debug('<<') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-09-10 03:28:03
|
Revision: 611 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=611&view=rev Author: jblance Date: 2010-09-10 03:27:57 +0000 (Fri, 10 Sep 2010) Log Message: ----------- Initial check-in of OSM anonymising functionality from Arnd Modified Paths: -------------- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/extensions/openstreetmap/openstreetmap.py =================================================================== --- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-09-10 01:55:13 UTC (rev 610) +++ pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-09-10 03:27:57 UTC (rev 611) @@ -5,6 +5,9 @@ import logging import gtk +import string +from lxml import etree + import httplib, httplib2 import urllib2 import mimetools, mimetypes @@ -38,6 +41,7 @@ logging.debug("GPX file: %s found, size: %d" % (gpx_file, os.path.getsize(gpx_file))) f = open(gpx_file, 'r') file_contents = f.read() + #TODO Fix to use etree functionality..... if file_contents.find("<?xml version='1.0' encoding='ASCII'?>") != -1: logging.debug("GPX file: %s has ASCII encoding - updating to UTF-8 for OSM support" % gpx_file) f.close() #Close readonly file @@ -172,3 +176,100 @@ buffer += '\r\n' + fd.read() + '\r\n' buffer += '--%s--\r\n\r\n' % boundary return boundary, buffer + + def make_gpx_private(self, gpx_file=None): + ''' + wipes out private data from gpx files + converts laps to waypoints + ''' + + if gpx_file is None: + return None + + filen = os.path.basename(gpx_file) + tmpdir = self.pytrainer_main.profile.tmpdir + anon_gpx_file = "%s/%s" % (tmpdir, filen) + + # Filtered home area, example Berlin + # corners NorthEast and SouthWest + #TODO This needs to be a config item.... + NE_LAT = 52.518 + NE_LON = 13.408 + SW_LAT = 52.4 + SW_LON = 13.3 + + # Config parameters, not used yet + FILTER_BOX = True + ERASE_TIME = True + LAP_TO_WAYPOINT = True + + tree = etree.parse(gpx_file) + _xmlns = tree.getroot().nsmap[None] + _trkpt_path = '{%s}trk/{%s}trkseg/{%s}trkpt' % (_xmlns, _xmlns, _xmlns) + # namespace of gpx files + NS = dict(ns='http://www.topografix.com/GPX/1/1') + + myroot = tree.getroot() + gpxdataNS = string.Template(\ + ".//{http://www.cluetrust.com/XML/GPXDATA/1/0}$tag") + lapTag = gpxdataNS.substitute(tag="lap") + endPointTag = gpxdataNS.substitute(tag="endPoint") + triggerTag = gpxdataNS.substitute(tag="trigger") + laps = tree.findall(lapTag) + + #new_waypoints=[] + mygpx = tree.find('gpx') + + for lap in laps: + trigger = lap.find(triggerTag) + # Watch out for manually triggered laps + if trigger.text == 'manual': + endPoint = lap.find(endPointTag) + lat = endPoint.get("lat") + lon = endPoint.get("lon") + print lat,lon + #new_waypoints.append([lat,lon]) + #add waypoint + etree.SubElement(myroot, 'wpt', attrib= {'lat':lat, 'lon':lon}) + + etree.strip_attributes(myroot, 'creator') + + # Wipe out home box + for trkpt in tree.findall(_trkpt_path): + lat = float(trkpt.attrib['lat']) + lon = float(trkpt.attrib['lon']) + #print lat, lon + if (lat < NE_LAT) & (lon < NE_LON) & (lat > SW_LAT) & (lon > SW_LON): + #print lat,lon + par = trkpt.getparent() + par.remove(trkpt) + + + time = tree.xpath('//ns:trkpt/ns:time', namespaces=NS) + for i in time: + i.text = '1970-01-01T00:00:00+00:00' + # osm regards <time> as mandatory. gnaa. + + ext = tree.xpath('//ns:gpx/ns:extensions', namespaces=NS) + for i in ext: + par = i.getparent() + par.remove(i) + meta = tree.xpath('//ns:gpx/ns:metadata', namespaces=NS) + for i in meta: + par = i.getparent() + par.remove(i) + ele = tree.xpath('//ns:trkpt/ns:ele', namespaces=NS) + for i in ele: + par = i.getparent() + par.remove(i) + + # test schema on cleaned xml-tree + # gpx.xsd from http://www.topografix.com/gpx.asp + + #xmlschema = etree.XMLSchema(etree.parse('gpx.xsd')) + #xmlschema.validate(tree) + + # write new gpx file + write(anon_gpx_file, pretty_print=False, xml_declaration=True, encoding='UTF-8') + return anon_gpx_file + Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-09-10 01:55:13 UTC (rev 610) +++ pytrainer/trunk/pytrainer/main.py 2010-09-10 03:27:57 UTC (rev 611) @@ -49,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#610" + self.version ="1.7.2_svn#611" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2010-09-21 04:23:19
|
Revision: 613 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=613&view=rev Author: jblance Date: 2010-09-21 04:23:13 +0000 (Tue, 21 Sep 2010) Log Message: ----------- Add GUI option to anonymise GPX data in OSM extension Modified Paths: -------------- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/extensions/openstreetmap/openstreetmap.py =================================================================== --- pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-09-20 00:41:08 UTC (rev 612) +++ pytrainer/trunk/extensions/openstreetmap/openstreetmap.py 2010-09-21 04:23:13 UTC (rev 613) @@ -56,6 +56,11 @@ f.close() logging.debug("User abort") return + if self.makeanon: + logging.debug("User requested anonymising of GPX data") + f.close() #Close standard gpxfile + gpx_file = self.make_gpx_private(gpx_file) + f = open(gpx_file, 'r') #Open anonymous gpxfile in readonly mode fields = (("description",self.description), ("tags",self.tags), ("visibility",self.visibility)) logging.debug("Added fields: %s" % str(fields)) #Multipart encode the request @@ -131,6 +136,13 @@ table.attach(combobox,1,2,2,3) self.entryList.append(combobox) table.attach(label,0,1,2,3) + #Add anonymize GPX option + label = gtk.Label("<b>Anonymize GPX Data</b>") + label.set_use_markup(True) + table.attach(label,0,1,3,4) + checkbutton = gtk.CheckButton() + table.attach(checkbutton,1,2,3,4) + self.entryList.append(checkbutton) #Buld dialog and show self.prefwindow.vbox.pack_start(table) self.prefwindow.show_all() @@ -148,7 +160,8 @@ self.description = "Uploaded from pytrainer" self.tags = self.entryList[1].get_text() self.visibility = self.entryList[2].get_active_text() - logging.debug("Description: %s, tags: %s, visibility: %s" % ( self.description, self.tags, self.visibility) ) + self.makeanon = self.entryList[3].get_active() + logging.debug("Description: %s, tags: %s, visibility: %s, makeanon: %s" % ( self.description, self.tags, self.visibility, self.makeanon) ) def multipart_encode(self, fields, files, boundary = None, buffer = None): ''' @@ -182,7 +195,7 @@ wipes out private data from gpx files converts laps to waypoints ''' - + logging.debug(">>") if gpx_file is None: return None @@ -270,6 +283,7 @@ #xmlschema.validate(tree) # write new gpx file - write(anon_gpx_file, pretty_print=False, xml_declaration=True, encoding='UTF-8') + tree.write(anon_gpx_file, pretty_print=False, xml_declaration=True, encoding='UTF-8') + logging.debug("<<") return anon_gpx_file Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-09-20 00:41:08 UTC (rev 612) +++ pytrainer/trunk/pytrainer/main.py 2010-09-21 04:23:13 UTC (rev 613) @@ -49,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#612" + self.version ="1.7.2_svn#613" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |