From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/stats/
Date: Thu, 5 Sep 2013 10:24:33 +0000 (UTC) [thread overview]
Message-ID: <1378376031.01bcf594038714fcd576a9ef2357d16e40ac2e3d.dywi@gentoo> (raw)
commit: 01bcf594038714fcd576a9ef2357d16e40ac2e3d
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Sep 5 10:13:51 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Sep 5 10:13:51 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=01bcf594
dbcollector: fix as_dict
---
roverlay/stats/dbcollector.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/roverlay/stats/dbcollector.py b/roverlay/stats/dbcollector.py
index 788110d..2b30aec 100644
--- a/roverlay/stats/dbcollector.py
+++ b/roverlay/stats/dbcollector.py
@@ -9,6 +9,16 @@ import weakref
from . import rating
+def get_dict ( k ):
+ if k:
+ try:
+ return k._asdict()
+ except AttributeError:
+ return dict ( k )
+ else:
+ return dict()
+# --- end of get_dict (...) ---
+
class StatsDBCollector ( object ):
VERSION = 0
@@ -65,11 +75,12 @@ class StatsDBCollector ( object ):
# --- end of make_timestats (...) ---
def get_numstats ( self, as_dict=False ):
- return self._numstats._as_dict() if as_dict else self._numstats
+ #dict(zip(<rating~>.keys(),<>))
+ return get_dict ( self._numstats ) if as_dict else self._numstats
# --- end of get_numstats (...) ---
def get_timestats ( self, as_dict=False ):
- return self._timestats._as_dict() if as_dict else self._timestats
+ return get_dict ( self._timestats ) if as_dict else self._timestats
# --- end of get_timestats (...) ---
def get_all ( self ):
next reply other threads:[~2013-09-05 10:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 10:24 André Erdmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-02-21 17:36 [gentoo-commits] proj/R_overlay:master commit in: roverlay/stats/ André Erdmann
2013-09-05 9:25 André Erdmann
2013-09-05 9:25 André Erdmann
2013-08-16 12:42 André Erdmann
2013-08-16 10:43 André Erdmann
2013-08-15 9:18 André Erdmann
2013-08-02 10:34 André Erdmann
2013-07-29 14:56 André Erdmann
2013-07-29 8:55 André Erdmann
2013-07-26 13:02 André Erdmann
2013-07-25 15:20 André Erdmann
2013-07-25 14:28 André Erdmann
2013-07-24 16:52 André Erdmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378376031.01bcf594038714fcd576a9ef2357d16e40ac2e3d.dywi@gentoo \
--to=dywi@mailerd.de \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox