Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/, sci-electronics/gresistor/files/, sci-electronics/gresistor/
Date: Thu, 26 Mar 2020 23:37:07
Message-Id: 1585265626.0eebbcdbdd7b3c7f36d3d8c739341256c578b735.asturm@gentoo
1 commit: 0eebbcdbdd7b3c7f36d3d8c739341256c578b735
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 26 23:27:40 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 26 23:33:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0eebbcdb
7
8 sci-electronics/gresistor: Remove last-rited package
9
10 Closes: https://bugs.gentoo.org/710164
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 profiles/package.mask | 5 -
14 sci-electronics/gresistor/Manifest | 1 -
15 sci-electronics/gresistor/files/SimpleGladeApp.py | 341 ---------------------
16 .../gresistor/gresistor-0.0.2-r1.ebuild | 37 ---
17 sci-electronics/gresistor/metadata.xml | 8 -
18 5 files changed, 392 deletions(-)
19
20 diff --git a/profiles/package.mask b/profiles/package.mask
21 index ee240453986..b1466d7b358 100644
22 --- a/profiles/package.mask
23 +++ b/profiles/package.mask
24 @@ -476,11 +476,6 @@ x11-misc/tintwizard
25 # Last activity in 2013, bug #710162, masked for removal in 30 days.
26 sci-misc/pythoncad
27
28 -# Andreas Sturmlechner <asturm@g.o> (2020-02-26)
29 -# Unmaintained revdep on dev-python/pygtk blocking its removal, py2-only
30 -# Last release in 2013, bug #710164, masked for removal in 30 days.
31 -sci-electronics/gresistor
32 -
33 # Michał Górny <mgorny@g.o> (2020-02-24)
34 # app-admin/packagekit-base is Python 2 only and behind upstream.
35 # The Portage backend is unmaintained. Other packages are its reverse
36
37 diff --git a/sci-electronics/gresistor/Manifest b/sci-electronics/gresistor/Manifest
38 deleted file mode 100644
39 index acf51df338b..00000000000
40 --- a/sci-electronics/gresistor/Manifest
41 +++ /dev/null
42 @@ -1 +0,0 @@
43 -DIST gresistor-0.0.2.tar.gz 10240 BLAKE2B d3b624c7e7abdbbe40d978b507f0b66d464aa6836e96d1b1c78a37b8365dfda451cf5051192fd2f3fd15a75d092c4bfb81fe0e6c0f087dc4a175603da6df47a3 SHA512 263483f5712a48f2095bddf620520233e2843c64c1a03a7924cecb856de8fdcac601100cda4dc9f1943ff7753ffaaab04e25032416dd9438fe3f17d7d6681072
44
45 diff --git a/sci-electronics/gresistor/files/SimpleGladeApp.py b/sci-electronics/gresistor/files/SimpleGladeApp.py
46 deleted file mode 100644
47 index 90c598cc4ff..00000000000
48 --- a/sci-electronics/gresistor/files/SimpleGladeApp.py
49 +++ /dev/null
50 @@ -1,341 +0,0 @@
51 -"""
52 - SimpleGladeApp.py
53 - Module that provides an object oriented abstraction to pygtk and libglade.
54 - Copyright (C) 2004 Sandino Flores Moreno
55 -"""
56 -
57 -# This library is free software; you can redistribute it and/or
58 -# modify it under the terms of the GNU Lesser General Public
59 -# License as published by the Free Software Foundation; either
60 -# version 2.1 of the License, or (at your option) any later version.
61 -#
62 -# This library is distributed in the hope that it will be useful,
63 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
64 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
65 -# Lesser General Public License for more details.
66 -#
67 -# You should have received a copy of the GNU Lesser General Public
68 -# License along with this library; if not, write to the Free Software
69 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
70 -# USA
71 -
72 -import os
73 -import sys
74 -import re
75 -
76 -import tokenize
77 -import gtk
78 -import gtk.glade
79 -import weakref
80 -import inspect
81 -
82 -__version__ = "1.0"
83 -__author__ = 'Sandino "tigrux" Flores-Moreno'
84 -
85 -def bindtextdomain(app_name, locale_dir=None):
86 - """
87 - Bind the domain represented by app_name to the locale directory locale_dir.
88 - It has the effect of loading translations, enabling applications for different
89 - languages.
90 -
91 - app_name:
92 - a domain to look for translations, tipically the name of an application.
93 -
94 - locale_dir:
95 - a directory with locales like locale_dir/lang_isocode/LC_MESSAGES/app_name.mo
96 - If omitted or None, then the current binding for app_name is used.
97 - """
98 - try:
99 - import locale
100 - import gettext
101 - locale.setlocale(locale.LC_ALL, "")
102 - gtk.glade.bindtextdomain(app_name, locale_dir)
103 - gettext.install(app_name, locale_dir, unicode=1)
104 - except (IOError,locale.Error), e:
105 - print "Warning", app_name, e
106 - __builtins__.__dict__["_"] = lambda x : x
107 -
108 -
109 -class SimpleGladeApp:
110 -
111 - def __init__(self, path, root=None, domain=None, **kwargs):
112 - """
113 - Load a glade file specified by glade_filename, using root as
114 - root widget and domain as the domain for translations.
115 -
116 - If it receives extra named arguments (argname=value), then they are used
117 - as attributes of the instance.
118 -
119 - path:
120 - path to a glade filename.
121 - If glade_filename cannot be found, then it will be searched in the
122 - same directory of the program (sys.argv[0])
123 -
124 - root:
125 - the name of the widget that is the root of the user interface,
126 - usually a window or dialog (a top level widget).
127 - If None or ommited, the full user interface is loaded.
128 -
129 - domain:
130 - A domain to use for loading translations.
131 - If None or ommited, no translation is loaded.
132 -
133 - **kwargs:
134 - a dictionary representing the named extra arguments.
135 - It is useful to set attributes of new instances, for example:
136 - glade_app = SimpleGladeApp("ui.glade", foo="some value", bar="another value")
137 - sets two attributes (foo and bar) to glade_app.
138 - """
139 - if os.path.isfile(path):
140 - self.glade_path = path
141 - else:
142 - glade_dir = os.path.dirname( sys.argv[0] )
143 - self.glade_path = os.path.join(glade_dir, path)
144 - for key, value in kwargs.items():
145 - try:
146 - setattr(self, key, weakref.proxy(value) )
147 - except TypeError:
148 - setattr(self, key, value)
149 - self.glade = None
150 - self.install_custom_handler(self.custom_handler)
151 - self.glade = self.create_glade(self.glade_path, root, domain)
152 - if root:
153 - self.main_widget = self.get_widget(root)
154 - else:
155 - self.main_widget = None
156 - self.normalize_names()
157 - self.add_callbacks(self)
158 - self.new()
159 -
160 - def __repr__(self):
161 - class_name = self.__class__.__name__
162 - if self.main_widget:
163 - root = gtk.Widget.get_name(self.main_widget)
164 - repr = '%s(path="%s", root="%s")' % (class_name, self.glade_path, root)
165 - else:
166 - repr = '%s(path="%s")' % (class_name, self.glade_path)
167 - return repr
168 -
169 - def new(self):
170 - """
171 - Method called when the user interface is loaded and ready to be used.
172 - At this moment, the widgets are loaded and can be refered as self.widget_name
173 - """
174 - pass
175 -
176 - def add_callbacks(self, callbacks_proxy):
177 - """
178 - It uses the methods of callbacks_proxy as callbacks.
179 - The callbacks are specified by using:
180 - Properties window -> Signals tab
181 - in glade-2 (or any other gui designer like gazpacho).
182 -
183 - Methods of classes inheriting from SimpleGladeApp are used as
184 - callbacks automatically.
185 -
186 - callbacks_proxy:
187 - an instance with methods as code of callbacks.
188 - It means it has methods like on_button1_clicked, on_entry1_activate, etc.
189 - """
190 - self.glade.signal_autoconnect(callbacks_proxy)
191 -
192 - def normalize_names(self):
193 - """
194 - It is internally used to normalize the name of the widgets.
195 - It means a widget named foo:vbox-dialog in glade
196 - is refered self.vbox_dialog in the code.
197 -
198 - It also sets a data "prefixes" with the list of
199 - prefixes a widget has for each widget.
200 - """
201 - for widget in self.get_widgets():
202 - widget_name = gtk.Widget.get_name(widget)
203 - prefixes_name_l = widget_name.split(":")
204 - prefixes = prefixes_name_l[ : -1]
205 - widget_api_name = prefixes_name_l[-1]
206 - widget_api_name = "_".join( re.findall(tokenize.Name, widget_api_name) )
207 - gtk.Widget.set_name(widget, widget_api_name)
208 - if hasattr(self, widget_api_name):
209 - raise AttributeError("instance %s already has an attribute %s" % (self,widget_api_name))
210 - else:
211 - setattr(self, widget_api_name, widget)
212 - if prefixes:
213 - gtk.Widget.set_data(widget, "prefixes", prefixes)
214 -
215 - def add_prefix_actions(self, prefix_actions_proxy):
216 - """
217 - By using a gui designer (glade-2, gazpacho, etc)
218 - widgets can have a prefix in theirs names
219 - like foo:entry1 or foo:label3
220 - It means entry1 and label3 has a prefix action named foo.
221 -
222 - Then, prefix_actions_proxy must have a method named prefix_foo which
223 - is called everytime a widget with prefix foo is found, using the found widget
224 - as argument.
225 -
226 - prefix_actions_proxy:
227 - An instance with methods as prefix actions.
228 - It means it has methods like prefix_foo, prefix_bar, etc.
229 - """
230 - prefix_s = "prefix_"
231 - prefix_pos = len(prefix_s)
232 -
233 - is_method = lambda t : callable( t[1] )
234 - is_prefix_action = lambda t : t[0].startswith(prefix_s)
235 - drop_prefix = lambda (k,w): (k[prefix_pos:],w)
236 -
237 - members_t = inspect.getmembers(prefix_actions_proxy)
238 - methods_t = filter(is_method, members_t)
239 - prefix_actions_t = filter(is_prefix_action, methods_t)
240 - prefix_actions_d = dict( map(drop_prefix, prefix_actions_t) )
241 -
242 - for widget in self.get_widgets():
243 - prefixes = gtk.Widget.get_data(widget, "prefixes")
244 - if prefixes:
245 - for prefix in prefixes:
246 - if prefix in prefix_actions_d:
247 - prefix_action = prefix_actions_d[prefix]
248 - prefix_action(widget)
249 -
250 - def custom_handler(self,
251 - glade, function_name, widget_name,
252 - str1, str2, int1, int2):
253 - """
254 - Generic handler for creating custom widgets, internally used to
255 - enable custom widgets (custom widgets of glade).
256 -
257 - The custom widgets have a creation function specified in design time.
258 - Those creation functions are always called with str1,str2,int1,int2 as
259 - arguments, that are values specified in design time.
260 -
261 - Methods of classes inheriting from SimpleGladeApp are used as
262 - creation functions automatically.
263 -
264 - If a custom widget has create_foo as creation function, then the
265 - method named create_foo is called with str1,str2,int1,int2 as arguments.
266 - """
267 - try:
268 - handler = getattr(self, function_name)
269 - return handler(str1, str2, int1, int2)
270 - except AttributeError:
271 - return None
272 -
273 - def gtk_widget_show(self, widget, *args):
274 - """
275 - Predefined callback.
276 - The widget is showed.
277 - Equivalent to widget.show()
278 - """
279 - widget.show()
280 -
281 - def gtk_widget_hide(self, widget, *args):
282 - """
283 - Predefined callback.
284 - The widget is hidden.
285 - Equivalent to widget.hide()
286 - """
287 - widget.hide()
288 -
289 - def gtk_widget_grab_focus(self, widget, *args):
290 - """
291 - Predefined callback.
292 - The widget grabs the focus.
293 - Equivalent to widget.grab_focus()
294 - """
295 - widget.grab_focus()
296 -
297 - def gtk_widget_destroy(self, widget, *args):
298 - """
299 - Predefined callback.
300 - The widget is destroyed.
301 - Equivalent to widget.destroy()
302 - """
303 - widget.destroy()
304 -
305 - def gtk_window_activate_default(self, window, *args):
306 - """
307 - Predefined callback.
308 - The default widget of the window is activated.
309 - Equivalent to window.activate_default()
310 - """
311 - widget.activate_default()
312 -
313 - def gtk_true(self, *args):
314 - """
315 - Predefined callback.
316 - Equivalent to return True in a callback.
317 - Useful for stopping propagation of signals.
318 - """
319 - return True
320 -
321 - def gtk_false(self, *args):
322 - """
323 - Predefined callback.
324 - Equivalent to return False in a callback.
325 - """
326 - return False
327 -
328 - def gtk_main_quit(self, *args):
329 - """
330 - Predefined callback.
331 - Equivalent to self.quit()
332 - """
333 - self.quit()
334 -
335 - def main(self):
336 - """
337 - Starts the main loop of processing events.
338 - The default implementation calls gtk.main()
339 -
340 - Useful for applications that needs a non gtk main loop.
341 - For example, applications based on gstreamer needs to override
342 - this method with gst.main()
343 -
344 - Do not directly call this method in your programs.
345 - Use the method run() instead.
346 - """
347 - gtk.main()
348 -
349 - def quit(self):
350 - """
351 - Quit processing events.
352 - The default implementation calls gtk.main_quit()
353 -
354 - Useful for applications that needs a non gtk main loop.
355 - For example, applications based on gstreamer needs to override
356 - this method with gst.main_quit()
357 - """
358 - gtk.main_quit()
359 -
360 - def run(self):
361 - """
362 - Starts the main loop of processing events checking for Control-C.
363 -
364 - The default implementation checks wheter a Control-C is pressed,
365 - then calls on_keyboard_interrupt().
366 -
367 - Use this method for starting programs.
368 - """
369 - try:
370 - self.main()
371 - except KeyboardInterrupt:
372 - self.on_keyboard_interrupt()
373 -
374 - def on_keyboard_interrupt(self):
375 - """
376 - This method is called by the default implementation of run()
377 - after a program is finished by pressing Control-C.
378 - """
379 - pass
380 -
381 - def install_custom_handler(self, custom_handler):
382 - gtk.glade.set_custom_handler(custom_handler)
383 -
384 - def create_glade(self, glade_path, root, domain):
385 - return gtk.glade.XML(self.glade_path, root, domain)
386 -
387 - def get_widget(self, widget_name):
388 - return self.glade.get_widget(widget_name)
389 -
390 - def get_widgets(self):
391 - return self.glade.get_widget_prefix("")
392
393 diff --git a/sci-electronics/gresistor/gresistor-0.0.2-r1.ebuild b/sci-electronics/gresistor/gresistor-0.0.2-r1.ebuild
394 deleted file mode 100644
395 index 1a626f02b10..00000000000
396 --- a/sci-electronics/gresistor/gresistor-0.0.2-r1.ebuild
397 +++ /dev/null
398 @@ -1,37 +0,0 @@
399 -# Copyright 1999-2020 Gentoo Authors
400 -# Distributed under the terms of the GNU General Public License v2
401 -
402 -EAPI=6
403 -
404 -PYTHON_COMPAT=( python2_7 )
405 -DISTUTILS_SINGLE_IMPL=1
406 -
407 -inherit distutils-r1 eutils
408 -
409 -DESCRIPTION="Translate a resistor color codes into a readable value"
410 -HOMEPAGE="https://sourceforge.net/projects/gresistor/"
411 -SRC_URI="mirror://sourceforge/gresistor/${P}.tar.gz"
412 -
413 -LICENSE="|| ( GPL-3 LGPL-3 )"
414 -SLOT="0"
415 -KEYWORDS="amd64 x86"
416 -IUSE=""
417 -
418 -DEPEND="
419 - $(python_gen_cond_dep '
420 - dev-python/pygtk:2[${PYTHON_MULTI_USEDEP}]
421 - ')
422 - gnome-base/libglade:2.0[${PYTHON_SINGLE_USEDEP}]
423 - x11-libs/gtk+:2"
424 -RDEPEND="${DEPEND}"
425 -
426 -src_prepare() {
427 - sed -i -e 's/Version=0.0.2/Version=1.0/g' ${PN}.desktop || die
428 - distutils-r1_src_prepare
429 -}
430 -
431 -src_install() {
432 - distutils-r1_src_install
433 - python_domodule "${FILESDIR}/SimpleGladeApp.py"
434 - domenu ${PN}.desktop
435 -}
436
437 diff --git a/sci-electronics/gresistor/metadata.xml b/sci-electronics/gresistor/metadata.xml
438 deleted file mode 100644
439 index 7361a73ad6e..00000000000
440 --- a/sci-electronics/gresistor/metadata.xml
441 +++ /dev/null
442 @@ -1,8 +0,0 @@
443 -<?xml version="1.0" encoding="UTF-8"?>
444 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
445 -<pkgmetadata>
446 - <!-- maintainer-needed -->
447 - <upstream>
448 - <remote-id type="sourceforge">gresistor</remote-id>
449 - </upstream>
450 -</pkgmetadata>