From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AB38A1381F3 for ; Thu, 13 Jun 2013 16:35:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DFF8E09C5; Thu, 13 Jun 2013 16:34:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CD53CE09C5 for ; Thu, 13 Jun 2013 16:34:37 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D1FE633DEE1 for ; Thu, 13 Jun 2013 16:34:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 718D2E5462 for ; Thu, 13 Jun 2013 16:34:25 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1371140880.c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/config/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/config/loader.py X-VCS-Directories: roverlay/config/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3 X-VCS-Branch: gsoc13/next Date: Thu, 13 Jun 2013 16:34:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4ab3fe0f-aadd-403a-8900-ed05f7302016 X-Archives-Hash: 4aa7a736e2cdb5afd03f188a83300579 commit: c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3 Author: André Erdmann mailerd de> AuthorDate: Thu Jun 13 16:28:00 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Thu Jun 13 16:28:00 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=c5c9eb0f roverlay/config/loader: support real types --- roverlay/config/loader.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roverlay/config/loader.py b/roverlay/config/loader.py index c96598b..182915a 100644 --- a/roverlay/config/loader.py +++ b/roverlay/config/loader.py @@ -433,8 +433,15 @@ class ConfigLoader ( object ): vtypes = value_type elif isinstance ( value_type, str ): vtypes = value_type.split ( ':' ) + elif type ( value_type ) is type: + try: + return value_type ( value ) + except ValueError: + return None else: - self.logger.error ( "Unknown data type for value type." ) + self.logger.error ( + "Unknown value type {!r}.".format ( value_type ) + ) return value # value_type -> function where function accepts one parameter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 86296138200 for ; Tue, 18 Jun 2013 14:13:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5747AE07FB; Tue, 18 Jun 2013 14:12:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E4E53E07FB for ; Tue, 18 Jun 2013 14:12:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ECF6933E5D6 for ; Tue, 18 Jun 2013 14:12:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8093BE468F for ; Tue, 18 Jun 2013 14:12:55 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1371140880.c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/config/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/config/loader.py X-VCS-Directories: roverlay/config/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3 X-VCS-Branch: master Date: Tue, 18 Jun 2013 14:12:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 508c658a-5202-4b5c-a6a8-e77418fd9857 X-Archives-Hash: 6cefc4630641ffd3e3d44ae905a5154a Message-ID: <20130618141255.Wm0tkpVlTZCPh_Y9fanbKyTyEMme9BwG1mhN6Pu2D-g@z> commit: c5c9eb0fe096b62e305f4e4ed0b6768a637dd9f3 Author: André Erdmann mailerd de> AuthorDate: Thu Jun 13 16:28:00 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Thu Jun 13 16:28:00 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=c5c9eb0f roverlay/config/loader: support real types --- roverlay/config/loader.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roverlay/config/loader.py b/roverlay/config/loader.py index c96598b..182915a 100644 --- a/roverlay/config/loader.py +++ b/roverlay/config/loader.py @@ -433,8 +433,15 @@ class ConfigLoader ( object ): vtypes = value_type elif isinstance ( value_type, str ): vtypes = value_type.split ( ':' ) + elif type ( value_type ) is type: + try: + return value_type ( value ) + except ValueError: + return None else: - self.logger.error ( "Unknown data type for value type." ) + self.logger.error ( + "Unknown value type {!r}.".format ( value_type ) + ) return value # value_type -> function where function accepts one parameter