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 1B7CD138202 for ; Tue, 3 Sep 2013 08:35:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C760E0E6D; Tue, 3 Sep 2013 08:35:33 +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 C20EFE0E6D for ; Tue, 3 Sep 2013 08:35:32 +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 CC16733E725 for ; Tue, 3 Sep 2013 08:35:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7F2F8E545E for ; Tue, 3 Sep 2013 08:35:30 +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: <1378197065.631ca545be9c7471542f8e993850b7495f544348.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/remote/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/remote/basicrepo.py X-VCS-Directories: roverlay/remote/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 631ca545be9c7471542f8e993850b7495f544348 X-VCS-Branch: master Date: Tue, 3 Sep 2013 08:35:30 +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: 1955020a-4376-47dc-a3fc-87facd3f9147 X-Archives-Hash: 73f97128a7a0a471bdc0e890f194b441 commit: 631ca545be9c7471542f8e993850b7495f544348 Author: André Erdmann mailerd de> AuthorDate: Tue Sep 3 08:31:05 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Tue Sep 3 08:31:05 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=631ca545 roverlay/remote/basicrepo: use counter as ident this allows to sort repos based on their ids (where lower number means that the repo has been read earlier from the repo config file(s)). --- roverlay/remote/basicrepo.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/roverlay/remote/basicrepo.py b/roverlay/remote/basicrepo.py index 9aebfac..5ca9f51 100644 --- a/roverlay/remote/basicrepo.py +++ b/roverlay/remote/basicrepo.py @@ -11,6 +11,8 @@ __all__ = [ 'BasicRepo', ] import os.path import logging +import roverlay.util.counter + from roverlay.packageinfo import PackageInfo from . import status @@ -55,6 +57,8 @@ class BasicRepo ( object ): It's the base class for remote repos. """ + ID_GENERATOR = roverlay.util.counter.IDGenerator() + def __init__ ( self, name, distroot, directory=None, src_uri=None, is_remote=False, remote_uri=None @@ -66,8 +70,11 @@ class BasicRepo ( object ): * directory -- distfiles dir, defaults to / * src_uri -- SRC_URI, defaults to http://localhost/R-Packages/ """ - self.name = name - self.logger = logging.getLogger ( + super ( BasicRepo, self ).__init__() + + self._identifier = next ( self.__class__.ID_GENERATOR ) + self.name = name + self.logger = logging.getLogger ( self.__class__.__name__ + ':' + self.name ) @@ -98,7 +105,7 @@ class BasicRepo ( object ): # --- end of __init__ (...) --- def get_identifier ( self ): - return id ( self ) + return self._identifier # --- end of get_identifier (...) --- def reset ( self ):