[hamster-applet] first iteration of stats. let's live with this for a while now!



commit 4c22e05c10243b02c1d29b329683bc52596f4329
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sun Jun 14 18:43:58 2009 +0100

    first iteration of stats. let's live with this for a while now!

 data/stats.ui    |  268 ++++++++++++++++++++------------------
 hamster/stats.py |  181 +++++++++++++++++++++-----
 po/lv.po         |  383 ++++++++++++++++++++++++++++++++++++++----------------
 3 files changed, 562 insertions(+), 270 deletions(-)
---
diff --git a/data/stats.ui b/data/stats.ui
index d56559e..daac346 100644
--- a/data/stats.ui
+++ b/data/stats.ui
@@ -22,11 +22,12 @@
         <property name="left_padding">12</property>
         <property name="right_padding">12</property>
         <child>
-          <object class="GtkNotebook" id="notebook1">
+          <object class="GtkNotebook" id="pages">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="tab_hborder">8</property>
             <property name="tab_vborder">4</property>
+            <signal name="switch_page" handler="on_pages_switch_page"/>
             <child>
               <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
@@ -396,7 +397,7 @@
                     <property name="visible">True</property>
                     <property name="yscale">0</property>
                     <child>
-                      <object class="GtkTable" id="table1">
+                      <object class="GtkTable" id="explore_controls">
                         <property name="visible">True</property>
                         <property name="n_columns">2</property>
                         <property name="column_spacing">4</property>
@@ -421,27 +422,10 @@
                               <object class="GtkHBox" id="year_box">
                                 <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkToggleButton" id="togglebutton2">
-                                    <property name="label" translatable="yes">All</property>
-                                    <property name="width_request">60</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="position">0</property>
-                                  </packing>
+                                  <placeholder/>
                                 </child>
                                 <child>
-                                  <object class="GtkToggleButton" id="togglebutton1">
-                                    <property name="label" translatable="yes">2009</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="position">1</property>
-                                  </packing>
+                                  <placeholder/>
                                 </child>
                                 <child>
                                   <placeholder/>
@@ -480,132 +464,168 @@
                             <property name="left_padding">12</property>
                             <property name="right_padding">12</property>
                             <child>
-                              <object class="GtkVBox" id="vbox66">
+                              <object class="GtkVBox" id="vbox3">
                                 <property name="visible">True</property>
                                 <property name="orientation">vertical</property>
-                                <property name="spacing">12</property>
                                 <child>
-                                  <object class="GtkAlignment" id="explore_everything">
-                                    <property name="height_request">50</property>
+                                  <object class="GtkVBox" id="statistics_box">
                                     <property name="visible">True</property>
+                                    <property name="orientation">vertical</property>
+                                    <property name="spacing">12</property>
                                     <child>
-                                      <placeholder/>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkTable" id="table2">
-                                    <property name="visible">True</property>
-                                    <property name="n_rows">4</property>
-                                    <property name="n_columns">3</property>
-                                    <child>
-                                      <object class="GtkLabel" id="label7">
-                                        <property name="visible">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">&lt;b&gt;Starts and ends&lt;/b&gt;</property>
-                                        <property name="use_markup">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="y_options">GTK_FILL</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkLabel" id="label8">
-                                        <property name="visible">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">&lt;b&gt;Totals&lt;/b&gt;</property>
-                                        <property name="use_markup">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="right_attach">2</property>
-                                        <property name="y_options">GTK_FILL</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkLabel" id="label6">
-                                        <property name="visible">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">&lt;b&gt;Averages&lt;/b&gt;</property>
-                                        <property name="use_markup">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">2</property>
-                                        <property name="right_attach">3</property>
-                                        <property name="y_options">GTK_FILL</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkAlignment" id="explore_weekday_starts_ends">
-                                        <property name="visible">True</property>
-                                        <child>
-                                          <placeholder/>
-                                        </child>
-                                      </object>
-                                      <packing>
-                                        <property name="top_attach">1</property>
-                                        <property name="bottom_attach">2</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkAlignment" id="explore_category_starts_ends">
+                                      <object class="GtkAlignment" id="explore_everything">
+                                        <property name="height_request">50</property>
                                         <property name="visible">True</property>
                                         <child>
                                           <placeholder/>
                                         </child>
                                       </object>
                                       <packing>
-                                        <property name="top_attach">2</property>
-                                        <property name="bottom_attach">3</property>
+                                        <property name="expand">False</property>
+                                        <property name="position">0</property>
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkAlignment" id="explore_weekday_totals">
+                                      <object class="GtkHBox" id="vbox77">
                                         <property name="visible">True</property>
                                         <child>
-                                          <placeholder/>
+                                          <object class="GtkVBox" id="vbox5">
+                                            <property name="visible">True</property>
+                                            <property name="orientation">vertical</property>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox2">
+                                                <property name="visible">True</property>
+                                                <property name="homogeneous">True</property>
+                                                <child>
+                                                  <object class="GtkLabel" id="label7">
+                                                    <property name="visible">True</property>
+                                                    <property name="xalign">0</property>
+                                                    <property name="ypad">8</property>
+                                                    <property name="label" translatable="yes">&lt;b&gt;Starts and ends&lt;/b&gt;</property>
+                                                    <property name="use_markup">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkLabel" id="label8">
+                                                    <property name="visible">True</property>
+                                                    <property name="xalign">0</property>
+                                                    <property name="label" translatable="yes">&lt;b&gt;Totals&lt;/b&gt;</property>
+                                                    <property name="use_markup">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox3">
+                                                <property name="height_request">160</property>
+                                                <property name="visible">True</property>
+                                                <property name="homogeneous">True</property>
+                                                <child>
+                                                  <object class="GtkAlignment" id="explore_weekday_starts_ends">
+                                                    <property name="visible">True</property>
+                                                    <child>
+                                                      <placeholder/>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkAlignment" id="explore_weekday_totals">
+                                                    <property name="visible">True</property>
+                                                    <child>
+                                                      <placeholder/>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkHBox" id="hbox4">
+                                                <property name="height_request">100</property>
+                                                <property name="visible">True</property>
+                                                <property name="homogeneous">True</property>
+                                                <child>
+                                                  <object class="GtkAlignment" id="explore_category_starts_ends">
+                                                    <property name="visible">True</property>
+                                                    <child>
+                                                      <placeholder/>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkAlignment" id="explore_category_totals">
+                                                    <property name="visible">True</property>
+                                                    <child>
+                                                      <placeholder/>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">2</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
                                         </child>
-                                      </object>
-                                      <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>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkAlignment" id="explore_category_totals">
-                                        <property name="visible">True</property>
                                         <child>
-                                          <placeholder/>
+                                          <object class="GtkAlignment" id="explore_summary">
+                                            <property name="width_request">200</property>
+                                            <property name="visible">True</property>
+                                            <property name="xalign">0</property>
+                                            <property name="yalign">0</property>
+                                            <property name="top_padding">32</property>
+                                            <property name="left_padding">30</property>
+                                            <child>
+                                              <placeholder/>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
                                         </child>
                                       </object>
                                       <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="position">1</property>
                                       </packing>
                                     </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="not_enough_records_label">
+                                    <property name="label">Text we say when there is not enough data</property>
+                                    <property name="wrap">True</property>
                                   </object>
                                   <packing>
                                     <property name="position">1</property>
diff --git a/hamster/stats.py b/hamster/stats.py
index 448a729..6a7d7f0 100644
--- a/hamster/stats.py
+++ b/hamster/stats.py
@@ -29,7 +29,7 @@ from hamster import dispatcher, storage, SHARED_DATA_DIR, stuff
 from hamster import charting
 
 from hamster.edit_activity import CustomFactController
-from hamster import reports, widgets
+from hamster import reports, widgets, graphics
 import webbrowser
 
 from itertools import groupby
@@ -143,7 +143,6 @@ class ReportChooserDialog(gtk.Dialog):
         for button in self.category_box.get_children():
             if button.get_active():
                 category = button.value
-        print category
         
         # format, path, start_date, end_date
         self.emit("report-chosen", format, path,
@@ -286,14 +285,12 @@ class StatsViewer(object):
                                        bars_beveled = False,
                                        animate = False,
                                        background = self.background,
-                                       max_bar_width = 35,
                                        show_labels = False)
         self.get_widget("explore_everything").add(self.chart_everything)
 
 
         self.chart_category_totals = charting.HorizontalBarChart(value_format = "%.1f",
                                                             bars_beveled = False,
-                                                            animate = False,
                                                             background = self.background,
                                                             max_bar_width = 20,
                                                             legend_width = 70)
@@ -302,7 +299,6 @@ class StatsViewer(object):
 
         self.chart_weekday_totals = charting.HorizontalBarChart(value_format = "%.1f",
                                                             bars_beveled = False,
-                                                            animate = False,
                                                             background = self.background,
                                                             max_bar_width = 20,
                                                             legend_width = 70)
@@ -322,11 +318,53 @@ class StatsViewer(object):
                                                                 legend_width = 70)
         self.get_widget("explore_category_starts_ends").add(self.chart_category_starts_ends)
 
-        self.stats(self.stat_facts)
-    
+
+        #ah, just want summary look just like all the other text on the page
+        class CairoText(graphics.Area):
+            def __init__(self, background = None, fontsize = 10):
+                graphics.Area.__init__(self)
+                self.background = background
+                self.text = ""
+                self.fontsize = fontsize
+                
+            def set_text(self, text):
+                self.text = text
+                self.redraw_canvas()
+                
+            def _render(self):
+                if self.background:
+                    self.fill_area(0, 0, self.width, self.height, self.background)
+
+                default_font = pango.FontDescription(gtk.Style().font_desc.to_string())
+                default_font.set_size(self.fontsize * pango.SCALE)
+                self.layout.set_font_description(default_font)
+                
+                #self.context.set_source_rgb(0,0,0)
+                self.layout.set_markup(self.text)
+
+                self.layout.set_width((self.width) * pango.SCALE)
+                self.context.move_to(0,0)
+                charting.set_color(self.context, charting.dark[8])
+                
+                self.context.show_layout(self.layout)
+
+
+        self.explore_summary = CairoText(self.background)
+        self.get_widget("explore_summary").add(self.explore_summary)
+        self.get_widget("explore_summary").show_all()
+
+    def on_pages_switch_page(self, notebook, page, pagenum):
+        if pagenum == 1:
+            year = None
+            for child in self.get_widget("year_box").get_children():
+                if child.get_active():
+                    year = child.year
+            
+            self.stats(year)
+        
+        
     def on_year_changed(self, button):
-        if self.bubbling:
-            return
+        if self.bubbling: return
         
         for child in button.parent.get_children():
             if child != button and child.get_active():
@@ -334,14 +372,32 @@ class StatsViewer(object):
                 child.set_active(False)
                 self.bubbling = False
         
+        self.stats(button.year)
+        
+    def stats(self, year = None):
         facts = self.stat_facts
-        if button.year:
-            facts = filter(lambda fact: fact["start_time"].year == button.year,
+        if year:
+            facts = filter(lambda fact: fact["start_time"].year == year,
                            facts)
-        
-        self.stats(facts)
-        
-    def stats(self, facts):
+
+        if not facts or (facts[-1]["start_time"] - facts[0]["start_time"]) < dt.timedelta(days=6):
+            self.get_widget("statistics_box").hide()
+            self.get_widget("explore_controls").hide()
+            label = self.get_widget("not_enough_records_label")
+
+            if not facts:
+                label.set_text(_("""There is no data to generate statistics yet.
+A week of usage would be nice!"""))
+            else:
+                label.set_text(_("Still collecting data - check back after a week has passed!"))
+
+            label.show()
+            return
+        else:
+            self.get_widget("statistics_box").show()
+            self.get_widget("explore_controls").show()
+            self.get_widget("not_enough_records_label").hide()
+
         # All dates in the scope
         just_totals = self._totals(facts,
                                    lambda fact: fact["start_time"].date(),
@@ -455,29 +511,85 @@ class StatsViewer(object):
         max_hour = max([max_weekday, max_category])
         max_hour = dt.time((max_hour.hour * 60 + max_hour.minute) / (3 * 60) * (3 * 60) / 60 + 3, 0) 
 
-
         self.chart_weekday_starts_ends.plot_day(weekday_keys, weekdays, min_hour, max_hour)
-
         self.chart_category_starts_ends.plot_day(category_keys, categories, min_hour, max_hour)
 
+
+        #now the factoids!
+        summary = ""
+
+        # first record        
+        if not year:
+            #date format for case when year has not been selected
+            first_date = _("%(first_b)s %(first_d)s, %(first_Y)s") % \
+                               stuff.dateDict(facts[0]["start_time"], "first_")
+        else:
+            #date format when year has been selected
+            first_date = _("%(first_b)s %(first_d)s") % \
+                               stuff.dateDict(facts[0]["start_time"], "first_")
+
+        summary += _("First activity was recorded on %s.") % \
+                                                     ("<b>%s</b>" % first_date)
+        
+        # total time tracked
+        total_delta = dt.timedelta(days=0)
+        for fact in facts:
+            total_delta += fact["delta"]
+        
+        if total_delta.days > 1:
+            summary += " " + _("""Time tracked so far is %(human_days)s human days \
+(%(human_years)s years) or %(working_days)s working days \
+(%(working_years)s years).""") % \
+            ({"human_days": ("<b>%d</b>" % total_delta.days),
+              "human_years": ("<b>%.2f</b>" % (total_delta.days / 365.0)),
+              "working_days": ("<b>%d</b>" % (total_delta.days * 3)), # 8 should be pretty much an average working day
+              "working_years": ("<b>%.2f</b>" % (total_delta.days * 3 / 365.0))})
         
-        """
-        cat_activities = self._totals(facts,
-                                  lambda fact: "%s-%s" % (fact["name"], fact["category"]),
-                                  lambda fact: fact['delta'].seconds / 60)
 
-        weekdays = self._totals(facts,
-                                  lambda fact: fact["start_time"].weekday,
-                                  lambda fact: fact['delta'].seconds / 60)
+        # longest fact
+        max_fact = None
+        for fact in facts:
+            if not max_fact or fact["delta"] > max_fact["delta"]:
+                max_fact = fact
+
+        datedict = stuff.dateDict(max_fact["start_time"], "max_")
+        datedict["hours"] = "<b>%.1f</b>" % (max_fact["delta"].seconds / 60 / 60.0
+                                                  + max_fact["delta"].days * 24)
+
+        summary += "\n" + _("Longest continuous work happened on \
+%(max_b)s %(max_d)s, %(max_Y)s and was %(hours)s hours.") % datedict
+
+        # total records (in selected scope)
+        summary += " " + _("There are %s records.") % ("<b>%d</b>" % len(facts))
+
+
+        early_start, early_end = dt.time(5,0), dt.time(9,0)
+        late_start, late_end = dt.time(20,0), dt.time(5,0)
         
-        dates = self._totals(facts,
-                                  lambda fact: fact["start_time"].day,
-                                  lambda fact: fact['delta'].seconds / 60)
         
-        months = self._totals(facts,
-                                  lambda fact: fact["start_time"].month,
-                                  lambda fact: fact['delta'].seconds / 60)
-        """
+        fact_count = len(facts)
+        def percent(condition):
+            matches = [fact for fact in facts if condition(fact)]
+            return round(len(matches) / float(fact_count) * 100)
+        
+        
+        early_percent = percent(lambda fact: early_start < fact["start_time"].time() < early_end)
+        late_percent = percent(lambda fact: fact["start_time"].time() > late_start or fact["start_time"].time() < late_end)
+        short_percent = percent(lambda fact: fact["delta"] <= dt.timedelta(seconds = 60 * 15))
+
+        if fact_count < 100:
+            summary += "\n\n" + _("Hamster would like to observe you some more!")
+        elif early_percent >= 20:
+            summary += "\n\n" + _("With %s percent of all facts starting before \
+9am you seem to be an early bird." % ("<b>%d</b>" % early_percent))
+        elif late_percent >= 20:
+            summary += "\n\n" + _("With %s percent of all facts starting after \
+11pm you seem to be a night owl." % ("<b>%d</b>" % late_percent))
+        elif short_percent >= 20:
+            summary += "\n\n" + _("With %s percent of all tasks being shorter \
+than 15 minutes you seem to be a busy bee." % ("<b>%d</b>" % short_percent))
+
+        self.explore_summary.set_text(summary)
 
 
     
@@ -1003,8 +1115,13 @@ class StatsViewer(object):
         self.do_graph()
     
     def after_fact_update(self, event, date):
+        self.stat_facts = storage.get_facts(dt.date(1970, 1, 1), dt.date.today())
         self.popular_categories = [cat[0] for cat in storage.get_popular_categories()]
-        self.do_graph()
+        
+        if self.get_widget("pages").get_current_page() == 0:
+            self.do_graph()
+        else:
+            self.stats()
         
     def on_close(self, widget, event):
         dispatcher.del_handler('activity_updated', self.after_activity_update)
diff --git a/po/lv.po b/po/lv.po
index 3444898..f59c9e3 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: lv\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-04-21 01:29+0100\n"
+"POT-Creation-Date: 2009-06-14 18:40+0100\n"
 "PO-Revision-Date: 2008-03-30 00:51+0000\n"
 "Last-Translator: Toms Baugis <toms baugis gmail com>\n"
 "Language-Team: Latvian <locale laka lv>\n"
@@ -21,9 +21,9 @@ msgstr ""
 msgid "Project Hamster - track your time"
 msgstr "Projekts Hamster - seko līdzi laikam"
 
-#. Title of reminder baloon
+#. Title of reminder notification
 #: ../data/Hamster_Applet.server.in.in.h:2 ../hamster/about.py:40
-#: ../hamster/about.py:41 ../hamster/applet.py:67
+#: ../hamster/about.py:41 ../hamster/applet.py:66
 msgid "Time Tracker"
 msgstr "Laika uzskaites programma"
 
@@ -55,7 +55,7 @@ msgstr "<b>Uzskaite</b>"
 msgid "Activity list"
 msgstr "Nodarbe"
 
-#: ../data/preferences.ui.h:5 ../data/stats.ui.h:5
+#: ../data/preferences.ui.h:5
 msgid "Add activity"
 msgstr "Pievienot notikumu"
 
@@ -67,7 +67,7 @@ msgstr "Jauna kategorija"
 msgid "Category list"
 msgstr "Kategorija"
 
-#: ../data/preferences.ui.h:8 ../data/stats.ui.h:7
+#: ../data/preferences.ui.h:8
 msgid "Edit activity"
 msgstr "Labot notikumu"
 
@@ -95,7 +95,7 @@ msgstr "DzÄ?st darbÄ«bu"
 msgid "Remove category"
 msgstr "DzÄ?st kategorija"
 
-#: ../data/preferences.ui.h:15 ../data/hamster-applet.schemas.in.h:8
+#: ../data/preferences.ui.h:15 ../data/hamster-applet.schemas.in.h:10
 msgid "Stop tracking on shutdown"
 msgstr "PÄ?rtraukt uzskaiti pie datora izslÄ?gÅ¡anas"
 
@@ -115,6 +115,10 @@ msgstr "_Darbības"
 msgid "_Categories"
 msgstr "_Kategorijas"
 
+#: ../data/preferences.ui.h:20
+msgid "remind also when no activity is set"
+msgstr "atgÄ?dinÄ?t arÄ« ja patlaban nekas netiek atsekots"
+
 #: ../data/edit_activity.ui.h:1
 msgid "Activity:"
 msgstr "Nodarbe:"
@@ -136,18 +140,10 @@ msgid "Time:"
 msgstr "Laiks:"
 
 #: ../data/edit_activity.ui.h:6
-msgid "gtk-cancel"
-msgstr "gtk-cancel"
-
-#: ../data/edit_activity.ui.h:7
-msgid "gtk-save"
-msgstr "gtk-save"
-
-#: ../data/edit_activity.ui.h:8
 msgid "in progress"
 msgstr "darbÄ«ba turpinÄ?s"
 
-#: ../data/edit_activity.ui.h:9
+#: ../data/edit_activity.ui.h:7 ../data/stats.ui.h:18
 msgid "to"
 msgstr "līdz"
 
@@ -156,6 +152,17 @@ msgid "Keyboard shortcut for showing the Time Tracker window."
 msgstr "Karstais taustiÅ?Å¡ laika uzskaites sÄ«klietotnes parÄ?dÄ«Å¡anai"
 
 #: ../data/hamster-applet.schemas.in.h:2
+msgid "Remind also when no activity is set"
+msgstr "AtgÄ?dinÄ?t arÄ« ja patlaban nekas netiek atsekots"
+
+#: ../data/hamster-applet.schemas.in.h:3
+msgid ""
+"Remind every notify_interval minutes also if no activity has been started."
+msgstr ""
+"AtgÄ?dinÄ?t katras notify_interval minÅ«tes arÄ« ja patlaban nekas netiek "
+"atsekots."
+
+#: ../data/hamster-applet.schemas.in.h:4
 msgid ""
 "Remind of current task every specified amount of minutes. Set to 0 or bigger "
 "than 120 to disable reminder."
@@ -163,29 +170,29 @@ msgstr ""
 "AtgÄ?dinÄ?t par paÅ¡reizÄ?jo darbÄ«bu ik pÄ?c norÄ?dÄ«tÄ?m minÅ«tÄ?m. IzslÄ?gt "
 "atgÄ?dinÄ?jumus var Å¡eit ierakstot 0 vai skaitli lielÄ?ku par 120"
 
-#: ../data/hamster-applet.schemas.in.h:3
+#: ../data/hamster-applet.schemas.in.h:5
 msgid "Remind of current task every x minutes"
 msgstr "AtgÄ?dinÄ?t par paÅ¡reizÄ?jo darbÄ«bu ik pÄ?c x minÅ«tÄ?m"
 
-#: ../data/hamster-applet.schemas.in.h:4
+#: ../data/hamster-applet.schemas.in.h:6
 msgid "Show window"
 msgstr "ParÄ?dÄ«t logu"
 
-#: ../data/hamster-applet.schemas.in.h:5
+#: ../data/hamster-applet.schemas.in.h:7
 msgid "Stop tracking current activity on shutdown"
 msgstr "PÄ?rtraukt uzskaiti pie datora izslÄ?gÅ¡anas"
 
-#: ../data/hamster-applet.schemas.in.h:6
+#: ../data/hamster-applet.schemas.in.h:8
 msgid "Stop tracking current activity, when computer becomes idle"
 msgstr "PÄ?rtraukt uzskaiti kad dators netiek lietots"
 
-#: ../data/hamster-applet.schemas.in.h:7
+#: ../data/hamster-applet.schemas.in.h:9
 msgid "Stop tracking on idle"
 msgstr "PÄ?rtraukt uzskaiti ja dators netiek lietots"
 
 #: ../data/applet.ui.h:1
 msgid ""
-"<span size=\"small\" >Type in activity and hit Enter to start tracking!</"
+"<span size=\"small\" >Type in an activity and hit Enter to start tracking!</"
 "span>"
 msgstr ""
 "<span size=\"small\" >Ievadiet darbÄ«bu un nospiediet Enter lai sÄ?ktu "
@@ -207,7 +214,7 @@ msgstr "_Pievienot AgrÄ?ku Notikumu"
 msgid "Hamster"
 msgstr "Hamster"
 
-#: ../data/applet.ui.h:6 ../hamster/applet.py:525
+#: ../data/applet.ui.h:6 ../hamster/applet.py:624
 msgid "No records today"
 msgstr "Å odien ierakstu nav"
 
@@ -239,42 +246,62 @@ msgstr "_NedÄ?ļa"
 msgid "<b>Overview</b>"
 msgstr "<b>PÄ?rskats</b>"
 
-#: ../data/stats.ui.h:4 ../hamster/reports.py:105 ../hamster/reports.py:173
+#: ../data/stats.ui.h:4
+msgid "<b>Starts and ends</b>"
+msgstr "<b>SÄ?kumi un beigas</b>"
+
+#: ../data/stats.ui.h:5
+msgid "<b>Totals</b>"
+msgstr "<b>Kopsummas</b>"
+
+#: ../data/stats.ui.h:6 ../hamster/reports.py:220 ../hamster/reports.py:277
 msgid "Activity"
 msgstr "Nodarbe"
 
-#: ../data/stats.ui.h:6
-msgid "Delete activity"
-msgstr "DzÄ?st notikumu"
+#: ../data/stats.ui.h:7
+msgid "Categories:"
+msgstr "Kategorijas"
 
 #: ../data/stats.ui.h:8
-msgid "Newer activities"
-msgstr "JaunÄ?ki notikumi"
+msgid "Date interval:"
+msgstr "Datuma intervÄ?ls:"
 
 #: ../data/stats.ui.h:9
 msgid "No data for this interval"
 msgstr "Å ajÄ? intervÄ?lÄ? nav datu"
 
 #: ../data/stats.ui.h:10
+msgid "Overview"
+msgstr "PÄ?rskats"
+
+#: ../data/stats.ui.h:11
 msgid "Overview - Hamster"
 msgstr "PÄ?rskats - laika uzskaite"
 
-#: ../data/stats.ui.h:11
+#: ../data/stats.ui.h:12
 msgid "Save as HTML"
 msgstr "SaglabÄ?t HTML formÄ?tÄ?"
 
-#: ../data/stats.ui.h:12
-msgid "Show month"
-msgstr "RÄ?dÄ«t mÄ?nesi"
-
 #: ../data/stats.ui.h:13
-msgid "Show week"
-msgstr "RÄ?dÄ«t nedÄ?ļu"
+msgid "Save report - Time Tracker"
+msgstr "SaglabÄ?t atskaiti"
+
+#: ../data/stats.ui.h:14
+msgid "Statistics"
+msgstr "Statistika"
 
-#: ../data/stats.ui.h:14 ../hamster/stats.py:364
+#: ../data/stats.ui.h:15
+msgid "Today"
+msgstr "Å odiena"
+
+#: ../data/stats.ui.h:16 ../hamster/stats.py:842
 msgid "Week"
 msgstr "NedÄ?ļa"
 
+#: ../data/stats.ui.h:17
+msgid "Year:"
+msgstr "Gads:"
+
 #: ../hamster/about.py:44
 msgid "Copyright © 2007-2009 Toms Bauģis and others"
 msgstr "Autortiesības © 2007-2009 Toms Bauģis un citi"
@@ -291,61 +318,21 @@ msgstr "Par laika uzskaites programmu"
 msgid "translator-credits"
 msgstr "Toms Bauģis toms baugis gmail com"
 
-#. try yesterday if there is nothing today
-#: ../hamster/preferences.py:56 ../hamster/edit_activity.py:336
-#: ../hamster/applet.py:631 ../hamster/db.py:189 ../hamster/db.py:206
-#: ../hamster/db.py:209 ../hamster/db.py:372 ../hamster/db.py:476
-#: ../hamster/db.py:490 ../hamster/reports.py:129 ../hamster/stuff.py:73
-msgid "Unsorted"
-msgstr "Nešķirotie"
-
-#: ../hamster/preferences.py:104
-msgid "Name"
-msgstr "Nosaukums"
-
-#: ../hamster/preferences.py:124 ../hamster/reports.py:106
-#: ../hamster/reports.py:172
-msgid "Category"
-msgstr "Kategorija"
-
-#: ../hamster/preferences.py:554
-msgid "New category"
-msgstr "Jauna kategorija"
-
-#: ../hamster/preferences.py:567
-msgid "New activity"
-msgstr "Jauna darbība"
-
-#. notify interval slider value label
-#: ../hamster/preferences.py:624
-#, python-format
-msgid "%(interval_minutes)d minutes"
-msgstr "%(interval_minutes)d minÅ«tÄ?m"
-
-#. notify interval slider value label
-#: ../hamster/preferences.py:627
-msgid "Never"
-msgstr "Nekad"
-
-#: ../hamster/edit_activity.py:351
-msgid "Update activity"
-msgstr "Labot notikumu"
-
 #. translators: this is edit activity action in the notifier bubble
-#: ../hamster/applet.py:77
+#: ../hamster/applet.py:76
 msgid "Edit"
 msgstr "Labot"
 
 #. translators: this is switch activity action in the notifier bubble
-#: ../hamster/applet.py:79
+#: ../hamster/applet.py:78
 msgid "Switch"
 msgstr "PÄ?rslÄ?gt darbÄ«bu"
 
-#: ../hamster/applet.py:292
+#: ../hamster/applet.py:313
 msgid "What to type in the activity box?"
 msgstr "Ko rakstÄ«t darbÄ«bas ievalaukÄ??"
 
-#: ../hamster/applet.py:295
+#: ../hamster/applet.py:316
 msgid ""
 "There is simple syntax that enables you to add details to your activities:\n"
 "        \n"
@@ -377,73 +364,138 @@ msgstr ""
 "\n"
 "Un tagad - sÄ?c uzskaiti!"
 
-#: ../hamster/applet.py:324 ../hamster/reports.py:109
-#: ../hamster/reports.py:174
+#: ../hamster/applet.py:345 ../hamster/reports.py:224
+#: ../hamster/reports.py:278
 msgid "Duration"
 msgstr "Ilgums"
 
-#: ../hamster/applet.py:451 ../hamster/applet.py:598
+#: ../hamster/applet.py:544 ../hamster/applet.py:565
 msgid "No activity"
 msgstr "Nekas nenotiek"
 
 #. activity reminder
-#: ../hamster/applet.py:465
+#: ../hamster/applet.py:560
 #, python-format
 msgid "Working on <b>%s</b>"
 msgstr "Darbojies ar <b>%s</b>"
 
 #. listing of today's categories and time spent in them
-#: ../hamster/applet.py:532
+#: ../hamster/applet.py:631
 #, python-format
 msgid "%(category)s: %(duration)s"
 msgstr "%(category)s: %(duration)s"
 
-#: ../hamster/applet.py:534
+#: ../hamster/applet.py:633
 #, python-format
 msgid "%.1fh"
 msgstr "%.1fh"
 
+#. try yesterday if there is nothing today
+#: ../hamster/applet.py:713 ../hamster/db.py:190 ../hamster/db.py:207
+#: ../hamster/db.py:210 ../hamster/db.py:376 ../hamster/db.py:449
+#: ../hamster/db.py:463 ../hamster/edit_activity.py:336
+#: ../hamster/preferences.py:56 ../hamster/reports.py:53
+#: ../hamster/reports.py:90 ../hamster/reports.py:237 ../hamster/stuff.py:74
+msgid "Unsorted"
+msgstr "Nešķirotie"
+
 #. defaults
-#: ../hamster/db.py:671
+#: ../hamster/db.py:644
 msgid "Work"
 msgstr "Darbi"
 
-#: ../hamster/db.py:672
+#: ../hamster/db.py:645
 msgid "Reading news"
 msgstr "ZiÅ?u lasÄ«Å¡ana"
 
-#: ../hamster/db.py:673
+#: ../hamster/db.py:646
 msgid "Checking stocks"
 msgstr "Biržas akciju pÄ?rskats"
 
-#: ../hamster/db.py:674
+#: ../hamster/db.py:647
 msgid "Super secret project X"
 msgstr "Super slepenais projekts X"
 
-#: ../hamster/db.py:675
+#: ../hamster/db.py:648
 msgid "World domination"
 msgstr "Pasaules pÄ?rÅ?emÅ¡ana"
 
-#: ../hamster/db.py:677
+#: ../hamster/db.py:650
 msgid "Day to day"
 msgstr "Ikdiena"
 
-#: ../hamster/db.py:678
+#: ../hamster/db.py:651
 msgid "Lunch"
 msgstr "Pusdienas"
 
-#: ../hamster/db.py:679
+#: ../hamster/db.py:652
 msgid "Watering flowers"
 msgstr "Puķu laistīšana"
 
-#: ../hamster/db.py:680
+#: ../hamster/db.py:653
 msgid "Doing handstands"
 msgstr "StÄ?vÄ?Å¡ana uz rokÄ?m"
 
+#: ../hamster/edit_activity.py:353
+msgid "Update activity"
+msgstr "Labot notikumu"
+
+#: ../hamster/preferences.py:104
+msgid "Name"
+msgstr "Nosaukums"
+
+#: ../hamster/preferences.py:124 ../hamster/reports.py:221
+#: ../hamster/reports.py:276
+msgid "Category"
+msgstr "Kategorija"
+
+#: ../hamster/preferences.py:559
+msgid "New category"
+msgstr "Jauna kategorija"
+
+#: ../hamster/preferences.py:572
+msgid "New activity"
+msgstr "Jauna darbība"
+
+#. notify interval slider value label
+#: ../hamster/preferences.py:632
+#, python-format
+msgid "%(interval_minutes)d minutes"
+msgstr "%(interval_minutes)d minÅ«tÄ?m"
+
+#. notify interval slider value label
+#: ../hamster/preferences.py:635
+msgid "Never"
+msgstr "Nekad"
+
+#: ../hamster/reports.py:110
+msgid "activity"
+msgstr "nodarbe"
+
+#: ../hamster/reports.py:110
+msgid "start time"
+msgstr "sÄ?kuma laiks"
+
+#: ../hamster/reports.py:110
+msgid "end time"
+msgstr "beigu laiks"
+
+#: ../hamster/reports.py:111
+msgid "duration minutes"
+msgstr "ilgums minÅ«tÄ?s"
+
+#: ../hamster/reports.py:111
+msgid "category"
+msgstr "kategorija"
+
+#: ../hamster/reports.py:111
+msgid "description"
+msgstr "apraksts"
+
 #. overview label if start and end years don't match
 #. letter after prefixes (start_, end_) is the one of
 #. standard python date formatting ones- you can use all of them
-#: ../hamster/reports.py:32 ../hamster/stats.py:351
+#: ../hamster/reports.py:149 ../hamster/stats.py:829
 #, python-format
 msgid ""
 "Overview for %(start_B)s %(start_d)s, %(start_Y)s â?? %(end_B)s %(end_d)s, %"
@@ -454,7 +506,7 @@ msgstr ""
 #. overview label if start and end month do not match
 #. letter after prefixes (start_, end_) is the one of
 #. standard python date formatting ones- you can use all of them
-#: ../hamster/reports.py:34 ../hamster/stats.py:356
+#: ../hamster/reports.py:151 ../hamster/stats.py:834
 #, python-format
 msgid "Overview for %(start_B)s %(start_d)s â?? %(end_B)s %(end_d)s, %(end_Y)s"
 msgstr "%(start_B)s %(start_d)s â?? %(end_B)s %(end_d)s, %(end_Y)s"
@@ -462,81 +514,184 @@ msgstr "%(start_B)s %(start_d)s â?? %(end_B)s %(end_d)s, %(end_Y)s"
 #. overview label for interval in same month
 #. letter after prefixes (start_, end_) is the one of
 #. standard python date formatting ones- you can use all of them
-#: ../hamster/reports.py:36 ../hamster/stats.py:361
+#: ../hamster/reports.py:153 ../hamster/stats.py:839
 #, python-format
 msgid "Overview for %(start_B)s %(start_d)s â?? %(end_d)s, %(end_Y)s"
 msgstr "%(start_d)s. %(start_B)s  â?? %(end_d)s. %(start_B)s, %(end_Y)s"
 
-#: ../hamster/reports.py:39
+#: ../hamster/reports.py:156
 #, python-format
 msgid "Overview for %(start_B)s %(start_d)s, %(start_Y)s"
 msgstr "%(start_d)s. %(start_B)s, %(start_Y)s"
 
-#: ../hamster/reports.py:104
+#: ../hamster/reports.py:219
 msgid "Date"
 msgstr "Datums"
 
-#: ../hamster/reports.py:107
+#: ../hamster/reports.py:222
 msgid "Start"
 msgstr "SÄ?kums"
 
-#: ../hamster/reports.py:108
+#: ../hamster/reports.py:223
 msgid "End"
 msgstr "Beigas"
 
-#: ../hamster/reports.py:110
+#: ../hamster/reports.py:225
 msgid "Description"
 msgstr "Apraksts"
 
-#. fact date column in HTML report
-#: ../hamster/reports.py:144
+#: ../hamster/reports.py:253
 #, python-format
 msgid "%(report_b)s %(report_d)s, %(report_Y)s"
 msgstr "%(report_b)s %(report_d)s, %(report_Y)s"
 
 #. summary table
-#: ../hamster/reports.py:169
+#: ../hamster/reports.py:273
 msgid "Totals"
 msgstr "KopÄ?"
 
-#: ../hamster/reports.py:186
+#: ../hamster/reports.py:288
 msgid "Total Time"
 msgstr "Laiks pavisam"
 
+#: ../hamster/stats.py:61 ../hamster/stats.py:1050
+msgid "HTML Report"
+msgstr "HTML Atskaite"
+
+#: ../hamster/stats.py:69 ../hamster/stats.py:1058
+msgid "Tab Separated Values (TSV)"
+msgstr "Ar tabulatoru atdalÄ«tas vÄ?rtÄ«bas (TSV)"
+
+#: ../hamster/stats.py:77 ../hamster/stats.py:1066
+msgid "XML"
+msgstr "XML"
+
+#: ../hamster/stats.py:84 ../hamster/stats.py:1073
+msgid "iCal"
+msgstr "iCal"
+
+#. add unsorted category
+#: ../hamster/stats.py:117 ../hamster/stats.py:269
+msgid "All"
+msgstr "Visi"
+
+#: ../hamster/stats.py:389
+msgid ""
+"There is no data to generate statistics yet.\n"
+"A week of usage would be nice!"
+msgstr ""
+"Patlaban pietrÅ«kst datu lai varÄ?tu uzÄ£enerÄ?t statistiku.\n"
+"PienÄ?ciet pÄ?c nedÄ?ļas!"
+
+#: ../hamster/stats.py:392
+msgid "Still collecting data - check back after a week has passed!"
+msgstr "VÄ?ljoprojÄ?m tiek vÄ?kti dati - pienÄ?ciet kad nedÄ?ļa bÅ«s pagÄ?jusi!"
+
+#. date format for case when year has not been selected
+#: ../hamster/stats.py:524
+#, python-format
+msgid "%(first_b)s %(first_d)s, %(first_Y)s"
+msgstr "%(first_b)s %(first_d)s, %(first_Y)s"
+
+#. date format when year has been selected
+#: ../hamster/stats.py:528
+#, python-format
+msgid "%(first_b)s %(first_d)s"
+msgstr "%(first_b)s %(first_d)s"
+
+#: ../hamster/stats.py:531
+#, python-format
+msgid "First activity was recorded on %s."
+msgstr "Pirmais ieraksts tika saglabÄ?ts %s."
+
+#: ../hamster/stats.py:540
+#, python-format
+msgid ""
+"Time tracked so far is %(human_days)s human days (%(human_years)s years) or %"
+"(working_days)s working days (%(working_years)s years)."
+msgstr ""
+"TiktÄ?l uzskaitÄ«tas %(human_days)s cilvÄ?kdienas (%(human_years)s gadi) jeb %"
+"(working_days)s darba dienas (%(working_years)s gadi)."
+
+#: ../hamster/stats.py:559
+#, python-format
+msgid ""
+"Longest continuous work happened on %(max_b)s %(max_d)s, %(max_Y)s and was %"
+"(hours)s hours."
+msgstr ""
+"GarÄ?kais piefiksÄ?tais nÄ?pÄ?rtrauktais darbs ir %(hours)s stundas un tika "
+"reÄ£istrÄ?ts %(max_b)s %(max_d)s, %(max_Y)s."
+
+#. total records (in selected scope)
+#: ../hamster/stats.py:563
+#, python-format
+msgid "There are %s records."
+msgstr "DatubÄ?zÄ? ir %s ieraksti"
+
+#: ../hamster/stats.py:581
+msgid "Hamster would like to observe you some more!"
+msgstr "KÄ?mis vÄ?lÄ?tos jÅ«s pavÄ?rot vÄ?l kÄ?du laiku!"
+
+#: ../hamster/stats.py:583
+#, python-format
+msgid ""
+"With %s percent of all facts starting before 9am you seem to be an early "
+"bird."
+msgstr ""
+"%s procenti visu faktu sÄ?kÄ?s pirms deviÅ?iem rÄ«tÄ?. IzskatÄ?s ka esi agrais "
+"putns."
+
+#: ../hamster/stats.py:586
+#, python-format
+msgid ""
+"With %s percent of all facts starting after 11pm you seem to be a night owl."
+msgstr ""
+"%s procenti no visiem ierakstiem ir reÄ£istrÄ?ti pÄ?c vienpadsmitiem vakarÄ?. "
+"IzskatÄ?s, ka esi pÅ«ce."
+
+#: ../hamster/stats.py:589
+#, python-format
+msgid ""
+"With %s percent of all tasks being shorter than 15 minutes you seem to be a "
+"busy bee."
+msgstr ""
+"%s procenti no visiem darbiem ir isÄ?ki par piecpadsmit minÅ«tÄ?m. IzskatÄ?s ka "
+"esi Ä?akla bite."
+
 #. date format in overview window fact listing
 #. prefix is "o_",letter after prefix is regular python format. you can use all of them
-#: ../hamster/stats.py:237
+#: ../hamster/stats.py:715
 #, python-format
 msgid "%(o_A)s, %(o_b)s %(o_d)s"
 msgstr "%(o_A)s, %(o_b)s %(o_d)s"
 
-#: ../hamster/stats.py:366
+#: ../hamster/stats.py:844
 msgid "Month"
 msgstr "MÄ?nesis"
 
-#: ../hamster/stats.py:404
+#: ../hamster/stats.py:882
 #, python-format
 msgid "%(m_b)s %(m_d)s"
 msgstr "%(m_b)s %(m_d)s"
 
-#: ../hamster/stats.py:417
+#: ../hamster/stats.py:895
 msgid "Total"
 msgstr "KopÄ?"
 
 #. duration in round hours
-#: ../hamster/stuff.py:120
+#: ../hamster/stuff.py:121
 #, python-format
 msgid "%dh"
 msgstr "%dh"
 
 #. duration less than hour
-#: ../hamster/stuff.py:123
+#: ../hamster/stuff.py:124
 #, python-format
 msgid "%dmin"
 msgstr "%dmin"
 
 #. x hours, y minutes
-#: ../hamster/stuff.py:126
+#: ../hamster/stuff.py:127
 #, python-format
 msgid "%dh %dmin"
 msgstr "%dh %dmin"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]