1 |
commit: eecacfa624c9c07a6d5fab9b2867cf201599b869 |
2 |
Author: Andre Erdmann <dywi <AT> mailerd <DOT> de> |
3 |
AuthorDate: Wed May 30 16:07:34 2012 +0000 |
4 |
Commit: André Erdmann <dywi <AT> mailerd <DOT> de> |
5 |
CommitDate: Wed May 30 16:07:34 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=eecacfa6 |
7 |
|
8 |
remove @classmethod decorators |
9 |
modified: ebuild.py |
10 |
modified: ebuildcreator.py |
11 |
modified: ebuildjob.py |
12 |
|
13 |
--- |
14 |
roverlay/ebuild.py | 7 ------- |
15 |
roverlay/ebuildcreator.py | 15 ++++++--------- |
16 |
roverlay/ebuildjob.py | 14 ++++---------- |
17 |
3 files changed, 10 insertions(+), 26 deletions(-) |
18 |
|
19 |
diff --git a/roverlay/ebuild.py b/roverlay/ebuild.py |
20 |
index 6316495..df2d028 100644 |
21 |
--- a/roverlay/ebuild.py |
22 |
+++ b/roverlay/ebuild.py |
23 |
@@ -6,7 +6,6 @@ class Ebuild: |
24 |
# could move this to const |
25 |
EBUILD_INDENT = "\t" |
26 |
|
27 |
- @classmethod |
28 |
def __init__ ( self ): |
29 |
"""Initializes an Ebuild. |
30 |
This is an abstraction layer between the verified + calculated data |
31 |
@@ -20,7 +19,6 @@ class Ebuild: |
32 |
|
33 |
# --- end of __init__ (...) --- |
34 |
|
35 |
- @classmethod |
36 |
def cleanup ( self ): |
37 |
"""Removes stored data if ebuild_lines have already been calculated. |
38 |
This saves some memory but makes this Ebuild read-only. |
39 |
@@ -31,7 +29,6 @@ class Ebuild: |
40 |
|
41 |
# --- end of cleanup (...) --- |
42 |
|
43 |
- @classmethod |
44 |
def prepare ( self, force_update=False, cleanup_after=False ): |
45 |
"""Tells this Ebuild to create ebuild lines. |
46 |
|
47 |
@@ -59,7 +56,6 @@ class Ebuild: |
48 |
|
49 |
# --- end of prepare (...) --- |
50 |
|
51 |
- @classmethod |
52 |
def add ( self, key, value, append=True ): |
53 |
"""Adds data to this Ebuild. |
54 |
|
55 |
@@ -90,7 +86,6 @@ class Ebuild: |
56 |
|
57 |
# --- end of add (...) --- |
58 |
|
59 |
- @classmethod |
60 |
def write ( self, file_to_write ): |
61 |
"""Writes an ebuild file. |
62 |
|
63 |
@@ -115,7 +110,6 @@ class Ebuild: |
64 |
|
65 |
# --- end of write (...) --- |
66 |
|
67 |
- @classmethod |
68 |
def show ( self, file_handle ): |
69 |
"""Prints the ebuild content into a file_handle. |
70 |
|
71 |
@@ -154,7 +148,6 @@ class Ebuild: |
72 |
|
73 |
# --- end of suggest_name (...) --- |
74 |
|
75 |
- @classmethod |
76 |
def _make_ebuild_lines ( self ): |
77 |
"""Creates text lines for this Ebuild. |
78 |
It assumes that enough data to do this are available. Exceptions (KeyError, NameError, ...) |
79 |
|
80 |
diff --git a/roverlay/ebuildcreator.py b/roverlay/ebuildcreator.py |
81 |
index 54a1c6a..bc74490 100644 |
82 |
--- a/roverlay/ebuildcreator.py |
83 |
+++ b/roverlay/ebuildcreator.py |
84 |
@@ -6,9 +6,6 @@ from roverlay.ebuildjob import EbuildJob |
85 |
|
86 |
class EbuildCreator: |
87 |
|
88 |
- |
89 |
- |
90 |
- @classmethod |
91 |
def __init__ ( self ): |
92 |
"""Initializes an EbuildCreator. This is an Object that controls the |
93 |
R package -> ebuild creation. It continuously creates EbuildJobs for |
94 |
@@ -20,8 +17,6 @@ class EbuildCreator: |
95 |
|
96 |
# --- end of init (...) --- |
97 |
|
98 |
- |
99 |
- @classmethod |
100 |
def add_package ( self, package_file ): |
101 |
"""Adds an R package to the EbuildCreator, which means that an EbuildJob |
102 |
will be created for it. Returns the EbuildJob, which is also stored |
103 |
@@ -30,6 +25,7 @@ class EbuildCreator: |
104 |
arguments: |
105 |
* package_file -- path R package file |
106 |
""" |
107 |
+ |
108 |
new_job = EbuildJob ( package_file, self.get_resolver ( False ) ) |
109 |
|
110 |
self.ebuild_jobs.append ( new_job ) |
111 |
@@ -38,7 +34,6 @@ class EbuildCreator: |
112 |
|
113 |
# --- end of add_package (...) --- |
114 |
|
115 |
- @classmethod |
116 |
def get_resolver ( self, readonly=True ): |
117 |
"""Returns a communication channel to the dependency resolver. |
118 |
|
119 |
@@ -52,19 +47,21 @@ class EbuildCreator: |
120 |
|
121 |
# --- end of get_resolver (...) --- |
122 |
|
123 |
- @classmethod |
124 |
def run ( self ): |
125 |
"""Tells all EbuildJobs to run.""" |
126 |
for job in self.ebuild_jobs: |
127 |
job.run() |
128 |
|
129 |
- @classmethod |
130 |
+ # --- end of run (...) --- |
131 |
+ |
132 |
def collect_ebuilds ( self ): |
133 |
"""Returns all ebuilds. (They may not be ready / TODO)""" |
134 |
ebuilds = [ job.get_ebuild() for job in self.ebuild_jobs ] |
135 |
return [ ebuild for ebuild in ebuilds if (not ebuild is None) ] |
136 |
|
137 |
- @classmethod |
138 |
+ # --- end of collect_ebuilds (...) --- |
139 |
+ |
140 |
+ |
141 |
def get_ebuild_header ( self, ebuild_header_file=None ): |
142 |
"""Reads and returns the content of an ebuild header file. |
143 |
This is a normal file that can be included in ebuilds. |
144 |
|
145 |
diff --git a/roverlay/ebuildjob.py b/roverlay/ebuildjob.py |
146 |
index d45dfdf..2767497 100644 |
147 |
--- a/roverlay/ebuildjob.py |
148 |
+++ b/roverlay/ebuildjob.py |
149 |
@@ -28,7 +28,6 @@ class EbuildJob: |
150 |
FAIL = [], |
151 |
) |
152 |
|
153 |
- @classmethod |
154 |
def __init__ ( self, package_file, dep_resolver=None ): |
155 |
"""Initializes an EbuildJob, which creates an ebuild for an R package. |
156 |
|
157 |
@@ -53,7 +52,6 @@ class EbuildJob: |
158 |
|
159 |
# --- end of __init__ (...) --- |
160 |
|
161 |
- @classmethod |
162 |
def get_ebuild ( self ): |
163 |
"""Returns the Ebuild that is created by this object. Note that you should |
164 |
check the status with status ( $TODO::EBUILD_READY ) before trying to use |
165 |
@@ -64,7 +62,6 @@ class EbuildJob: |
166 |
|
167 |
# --- end of get_ebuild (...) --- |
168 |
|
169 |
- @classmethod |
170 |
def get_status ( self, expected_status=None ): |
171 |
"""Returns the current status of this job or a bool that indicates |
172 |
whether to current status matches the expected one. |
173 |
@@ -79,7 +76,6 @@ class EbuildJob: |
174 |
|
175 |
# --- end of get_status (...) --- |
176 |
|
177 |
- @classmethod |
178 |
def done_success ( self ): |
179 |
"""Returns True if this has been successfully finished.""" |
180 |
return get_status ( 'SUCCESS' ) |
181 |
@@ -87,7 +83,6 @@ class EbuildJob: |
182 |
# --- end of done_success (...) --- |
183 |
|
184 |
|
185 |
- @classmethod |
186 |
def run ( self ): |
187 |
"""Tells this EbuildJob to run. This means that it reads the package file, |
188 |
resolves dependencies using its resolver (TODO) and creates |
189 |
@@ -125,7 +120,8 @@ class EbuildJob: |
190 |
|
191 |
|
192 |
# origin is todo (sync module knows the package origin) |
193 |
- ebuild.add ( 'PKG_ORIGIN', 'CRAN' ) |
194 |
+ ebuild.add ( 'PKG_ORIGIN', 'CRAN/BIOC/... TODO!' ) |
195 |
+ ebuild.add ( 'SRC_URI', 'where? TODO!' ) |
196 |
|
197 |
ebuild.add ( 'PKG_FILE', fileinfo ['package_file'] ) |
198 |
|
199 |
@@ -206,9 +202,8 @@ class EbuildJob: |
200 |
## finalize self.ebuild: forced text creation + make it readonly |
201 |
if ebuild.prepare ( True, True ): |
202 |
self.ebuild = ebuild |
203 |
- return None |
204 |
- else: |
205 |
- return None |
206 |
+ |
207 |
+ return None |
208 |
|
209 |
except Exception as any_exception: |
210 |
# any exception means failure |
211 |
@@ -217,7 +212,6 @@ class EbuildJob: |
212 |
|
213 |
# --- end of run (...) --- |
214 |
|
215 |
- @classmethod |
216 |
def _set_status ( self, new_status, ignore_invalid=False ): |
217 |
"""Changes the status of this job. May refuse to do that if invalid change |
218 |
requested (e.g. 'FAIL' -> 'SUCCESS'). |