From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SZlTP-0005mD-9d for garchives@archives.gentoo.org; Wed, 30 May 2012 16:10:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5F5A3E079E; Wed, 30 May 2012 16:09:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 21A17E079E for ; Wed, 30 May 2012 16:09:59 +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 54D641B402C for ; Wed, 30 May 2012 16:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 2F445E5437 for ; Wed, 30 May 2012 16:09:56 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1338394054.eecacfa624c9c07a6d5fab9b2867cf201599b869.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/ebuild.py roverlay/ebuildcreator.py roverlay/ebuildjob.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: eecacfa624c9c07a6d5fab9b2867cf201599b869 X-VCS-Branch: master Date: Wed, 30 May 2012 16:09:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: f0d5d33b-5af1-45c8-9010-05713caea919 X-Archives-Hash: 84bfb8d3fb919a84cb744a163acc2617 commit: eecacfa624c9c07a6d5fab9b2867cf201599b869 Author: Andre Erdmann mailerd de> AuthorDate: Wed May 30 16:07:34 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Wed May 30 16:07:34 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3Deecacfa6 remove @classmethod decorators modified: ebuild.py modified: ebuildcreator.py modified: ebuildjob.py --- roverlay/ebuild.py | 7 ------- roverlay/ebuildcreator.py | 15 ++++++--------- roverlay/ebuildjob.py | 14 ++++---------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/roverlay/ebuild.py b/roverlay/ebuild.py index 6316495..df2d028 100644 --- a/roverlay/ebuild.py +++ b/roverlay/ebuild.py @@ -6,7 +6,6 @@ class Ebuild: # could move this to const EBUILD_INDENT =3D "\t" =20 - @classmethod def __init__ ( self ): """Initializes an Ebuild. This is an abstraction layer between the verified + calculated data @@ -20,7 +19,6 @@ class Ebuild: =20 # --- end of __init__ (...) --- =20 - @classmethod def cleanup ( self ): """Removes stored data if ebuild_lines have already been calculated. This saves some memory but makes this Ebuild read-only. @@ -31,7 +29,6 @@ class Ebuild: =20 # --- end of cleanup (...) --- =20 - @classmethod def prepare ( self, force_update=3DFalse, cleanup_after=3DFalse ): """Tells this Ebuild to create ebuild lines. =20 @@ -59,7 +56,6 @@ class Ebuild: =20 # --- end of prepare (...) --- =20 - @classmethod def add ( self, key, value, append=3DTrue ): """Adds data to this Ebuild. =20 @@ -90,7 +86,6 @@ class Ebuild: =20 # --- end of add (...) --- =20 - @classmethod def write ( self, file_to_write ): """Writes an ebuild file. =20 @@ -115,7 +110,6 @@ class Ebuild: =20 # --- end of write (...) --- =20 - @classmethod def show ( self, file_handle ): """Prints the ebuild content into a file_handle. =20 @@ -154,7 +148,6 @@ class Ebuild: =20 # --- end of suggest_name (...) --- =20 - @classmethod def _make_ebuild_lines ( self ): """Creates text lines for this Ebuild. It assumes that enough data to do this are available. Exceptions (KeyE= rror, NameError, ...) diff --git a/roverlay/ebuildcreator.py b/roverlay/ebuildcreator.py index 54a1c6a..bc74490 100644 --- a/roverlay/ebuildcreator.py +++ b/roverlay/ebuildcreator.py @@ -6,9 +6,6 @@ from roverlay.ebuildjob import EbuildJob =20 class EbuildCreator: =20 - - - @classmethod def __init__ ( self ): """Initializes an EbuildCreator. This is an Object that controls the R package -> ebuild creation. It continuously creates EbuildJobs for @@ -20,8 +17,6 @@ class EbuildCreator: =20 # --- end of init (...) --- =20 - - @classmethod def add_package ( self, package_file ): """Adds an R package to the EbuildCreator, which means that an EbuildJ= ob will be created for it. Returns the EbuildJob, which is also stored @@ -30,6 +25,7 @@ class EbuildCreator: arguments: * package_file -- path R package file """ + new_job =3D EbuildJob ( package_file, self.get_resolver ( False ) ) =20 self.ebuild_jobs.append ( new_job ) @@ -38,7 +34,6 @@ class EbuildCreator: =20 # --- end of add_package (...) --- =20 - @classmethod def get_resolver ( self, readonly=3DTrue ): """Returns a communication channel to the dependency resolver. =20 @@ -52,19 +47,21 @@ class EbuildCreator: =20 # --- end of get_resolver (...) --- =20 - @classmethod def run ( self ): """Tells all EbuildJobs to run.""" for job in self.ebuild_jobs: job.run() =20 - @classmethod + # --- end of run (...) --- + def collect_ebuilds ( self ): """Returns all ebuilds. (They may not be ready / TODO)""" ebuilds =3D [ job.get_ebuild() for job in self.ebuild_jobs ] return [ ebuild for ebuild in ebuilds if (not ebuild is None) ] =20 - @classmethod + # --- end of collect_ebuilds (...) --- + + def get_ebuild_header ( self, ebuild_header_file=3DNone ): """Reads and returns the content of an ebuild header file. This is a normal file that can be included in ebuilds. diff --git a/roverlay/ebuildjob.py b/roverlay/ebuildjob.py index d45dfdf..2767497 100644 --- a/roverlay/ebuildjob.py +++ b/roverlay/ebuildjob.py @@ -28,7 +28,6 @@ class EbuildJob: FAIL =3D [], ) =20 - @classmethod def __init__ ( self, package_file, dep_resolver=3DNone ): """Initializes an EbuildJob, which creates an ebuild for an R package. =20 @@ -53,7 +52,6 @@ class EbuildJob: =20 # --- end of __init__ (...) --- =20 - @classmethod def get_ebuild ( self ): """Returns the Ebuild that is created by this object. Note that you sh= ould check the status with status ( $TODO::EBUILD_READY ) before trying to = use @@ -64,7 +62,6 @@ class EbuildJob: =20 # --- end of get_ebuild (...) --- =20 - @classmethod def get_status ( self, expected_status=3DNone ): """Returns the current status of this job or a bool that indicates whether to current status matches the expected one. @@ -79,7 +76,6 @@ class EbuildJob: =20 # --- end of get_status (...) --- =20 - @classmethod def done_success ( self ): """Returns True if this has been successfully finished.""" return get_status ( 'SUCCESS' ) @@ -87,7 +83,6 @@ class EbuildJob: # --- end of done_success (...) --- =20 =20 - @classmethod def run ( self ): """Tells this EbuildJob to run. This means that it reads the package f= ile, resolves dependencies using its resolver (TODO) and creates @@ -125,7 +120,8 @@ class EbuildJob: =20 =20 # origin is todo (sync module knows the package origin) - ebuild.add ( 'PKG_ORIGIN', 'CRAN' ) + ebuild.add ( 'PKG_ORIGIN', 'CRAN/BIOC/... TODO!' ) + ebuild.add ( 'SRC_URI', 'where? TODO!' ) =20 ebuild.add ( 'PKG_FILE', fileinfo ['package_file'] ) =20 @@ -206,9 +202,8 @@ class EbuildJob: ## finalize self.ebuild: forced text creation + make it readonly if ebuild.prepare ( True, True ): self.ebuild =3D ebuild - return None - else: - return None + + return None =20 except Exception as any_exception: # any exception means failure @@ -217,7 +212,6 @@ class EbuildJob: =20 # --- end of run (...) --- =20 - @classmethod def _set_status ( self, new_status, ignore_invalid=3DFalse ): """Changes the status of this job. May refuse to do that if invalid ch= ange requested (e.g. 'FAIL' -> 'SUCCESS').