View previous topic :: View next topic |
Author |
Message |
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Mon Apr 16, 2007 11:32 pm Post subject: |
|
|
etc-proposals new home:
http://developer.berlios.de/projects/etc-proposals/
ebuild and tarball are downloadable there. The fixed ebuild is commited to gentoo-sunrise and will probably soon be available in the overlay. |
|
Back to top |
|
|
dol-sen Retired Dev
Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
Posted: Tue Apr 17, 2007 3:48 am Post subject: |
|
|
Cool, Thank you...
I look forward to getting an update _________________ Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch... |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
|
Back to top |
|
|
dol-sen Retired Dev
Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
Posted: Tue Apr 17, 2007 9:24 am Post subject: |
|
|
Yes, that is it. I had not had a chance to update to 1.1 before your server died. I didn't feel like feeding the spammer lists to get it from your alternative download locations.
The only change will be the command assignment on line 36 to add the --gtk --fastexit options for -1.1. From the brief look I did at your code it looks like your code needs to run as root in order to save the files. This limits the ability for porthole to import your code to run it in it's gtk session. If you separate the actual file saving/deletion code from the rest of the interface, it would allow the gui portion to run as a user and only the save/delete portion needs to run as root. It would require you to open an additional dialog to get an su/sudo password or use an external one like you see I do in the plug-in code. The advantage would be for porthole or others to import your code, initiate a refresh and get feedback about status, update needs, etc..
I seldom run porthole as root anymore. usually only from time to time to check it still works and I didn't break anything. Take a look at porthole's backend/set_config.py and db/user_configs.py for how I do it. Also to make the plug-in more version adaptable, if you have a separate version file, it could be easily imported and automatically set the correct command options to run it without having to release a new plug-in version when things change.
example
Code: | #!/usr/bin/env python
""" file etc-proposals/version.py"""
version = "1.1"
|
Code: | #!/usr/bin/env python
""" file etc-proposals/plugin.py"""
from version import version
# list the basic command to run as an external app
plugin_command = "etc-proposals"
# a dictionary of selectable runtime options and explanations
options_dict = {
"gtk": "runs it with the gtk frontend",
"curses": "runs it with the curses frontend",
"qt": "runs it with the qt frontend"
"fastexit": "tells it to automatically exit if no files were found that need updating"
}
options_commands = {
"gtk": " --gtk",
"curses": " --curses",
"qt": " --qt",
"fastexit": " --fastexit"
}
su_required = True
|
Then in a porthole's plugin it could be imported and add the options to it's configuration dialog for a user to configure their preferences. As your program evolves, the plug-in is automatically updated and ready to go without needing updating. That would allow porthole/portato, etc. to run with whichever interface and options the user desires. Yes, porthole does have kde/qt users that would prefer to run it in their native environment. _________________ Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch... |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Tue Apr 17, 2007 9:45 am Post subject: |
|
|
dol-sen wrote: | The only change will be the command assignment on line 36 to add the --gtk --fastexit options for -1.1. From the brief look I did at your code it looks like your code needs to run as root in order to save the files. This limits the ability for porthole to import your code to run it in it's gtk session. If you separate the actual file saving/deletion code from the rest of the interface, it would allow the gui portion to run as a user and only the save/delete portion needs to run as root. It would require you to open an additional dialog to get an su/sudo password or use an external one like you see I do in the plug-in code. The advantage would be for porthole or others to import your code, initiate a refresh and get feedback about status, update needs, etc.. |
Yes, I was pondering about that already as I saw the run_as_root/run_as_user functions.
As for the automatic configuration from the plugin: sounds good. |
|
Back to top |
|
|
Necoro Veteran
Joined: 18 Dec 2005 Posts: 1912 Location: Germany
|
Posted: Thu Apr 26, 2007 12:25 am Post subject: |
|
|
Hi,
i removed the berkley-db support out of python (disabled berkdb-flag) - and now etc-proposals fails to start, if there are config files to update
Code: | Traceback (most recent call last):
File "/usr/sbin/etc-proposals", line 59, in ?
etcproposals.etcproposals_gtk.run_frontend()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 565, in run_frontend
controller = EtcProposalsController(model)
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 528, in __init__
self.proposals.warmup_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 47, in warmup_cache
self.get_whitespace_changes()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 405, in get_whitespace_changes
self._refresh_whitespace_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 473, in _refresh_whitespace_changes_cache
self._whitespace_changes = [change for change in self.get_all_changes() if change.is_whitespace_only()]
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 400, in get_all_changes
self._refresh_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 469, in _refresh_changes_cache
self._changes = [change for proposal in self for change in proposal.get_changes()]
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 222, in get_changes
self._refresh_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 251, in _refresh_changes_cache
state = EtcProposalsState()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 541, in __init__
shelve.Shelf.__init__(self, anydbm.open(STATEFILE, 'c'))
File "/usr/lib/python2.4/anydbm.py", line 82, in open
mod = __import__(result)
File "/usr/lib/python2.4/dbhash.py", line 5, in ?
import bsddb
ImportError: No module named bsddb
Exception exceptions.AttributeError: "EtcProposalsState instance has no attribute 'writeback'" in ignored |
I don't know, whether this is a python bug - or if etc-proposals should state that it needs python to be built with berkdb-support enabled _________________ Inter Deum Et Diabolum Semper Musica Est. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Thu Apr 26, 2007 9:23 am Post subject: |
|
|
Necoro wrote: | Hi,
i removed the berkley-db support out of python (disabled berkdb-flag) - and now etc-proposals fails to start, if there are config files to update
Code: | Traceback (most recent call last):
File "/usr/sbin/etc-proposals", line 59, in ?
etcproposals.etcproposals_gtk.run_frontend()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 565, in run_frontend
controller = EtcProposalsController(model)
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 528, in __init__
self.proposals.warmup_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_gtk.py", line 47, in warmup_cache
self.get_whitespace_changes()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 405, in get_whitespace_changes
self._refresh_whitespace_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 473, in _refresh_whitespace_changes_cache
self._whitespace_changes = [change for change in self.get_all_changes() if change.is_whitespace_only()]
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 400, in get_all_changes
self._refresh_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 469, in _refresh_changes_cache
self._changes = [change for proposal in self for change in proposal.get_changes()]
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 222, in get_changes
self._refresh_changes_cache()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 251, in _refresh_changes_cache
state = EtcProposalsState()
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_lib.py", line 541, in __init__
shelve.Shelf.__init__(self, anydbm.open(STATEFILE, 'c'))
File "/usr/lib/python2.4/anydbm.py", line 82, in open
mod = __import__(result)
File "/usr/lib/python2.4/dbhash.py", line 5, in ?
import bsddb
ImportError: No module named bsddb
Exception exceptions.AttributeError: "EtcProposalsState instance has no attribute 'writeback'" in ignored |
I don't know, whether this is a python bug - or if etc-proposals should state that it needs python to be built with berkdb-support enabled |
Does this still happens if you move/rename /var/state/etcproposals.state?
anydb uses the best DB-engine it finds, thus your old statefile was created with bsddb as it was available. When you have a statefile created after you removed bsddb-support should use another db-engine and work as expected. If all else fails it will use the dumpdbm engine.
So as long as you dont _change_ USE-Flags it will work. |
|
Back to top |
|
|
Necoro Veteran
Joined: 18 Dec 2005 Posts: 1912 Location: Germany
|
Posted: Thu Apr 26, 2007 10:04 pm Post subject: |
|
|
Ok - this works _________________ Inter Deum Et Diabolum Semper Musica Est. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Mon Apr 30, 2007 11:40 am Post subject: |
|
|
dol-sen,
Running as non-root is not that simple to implement in a secure way. I added the boolean etcproposals.etcproposals_info.MUST_RUN_AS_ROOT which will be true until I find a secure way to implement it.
Best Regards,
Björn |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Tue May 01, 2007 12:14 pm Post subject: |
|
|
Ok, Qt4 Testers wanted!
If you are interested, please test the current version in svn:
- assure you have this in your /etc/make.conf (you usually have):
Code: | PORTDIR_OVERLAY="/usr/local/portage"
DISTDIR=/usr/portage/distfiles
|
- assure you have this in /etc/portage/package.keywords:
Code: | app-portage/etcproposals
dev-python/PyQt4
dev-python/sip
|
all you need to do then is:
Code: | mkdir etcproposals-checkout
cd etcproposals-checkout
svn co https://svn.berlios.de/svnroot/repos/etc-proposals/trunk .
sudo bash install.sh |
Last edited by bmichaelsen on Wed May 02, 2007 11:19 am; edited 1 time in total |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed May 02, 2007 11:01 am Post subject: |
|
|
It's worth pointing out you also need:
Code: | sudo echo dev-python/PyQt4 >> /etc/portage/package.keywords
sudo echo dev-python/sip >> /etc/portage/package.keywords |
I'm emerging it now, and thanks again :) |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed May 02, 2007 11:20 am Post subject: |
|
|
steveL wrote: | It's worth pointing out you also need:
Code: | sudo echo dev-python/PyQt4 >> /etc/portage/package.keywords
sudo echo dev-python/sip >> /etc/portage/package.keywords |
I'm emerging it now, and thanks again |
True, I just fixed my post. Thanks for pointing out! |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed May 02, 2007 12:07 pm Post subject: |
|
|
Code: | !!! Couldn't download 'etcproposals-1.1.9999.tar.gz'. Aborting. |
Something in the src-uri? |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed May 02, 2007 12:28 pm Post subject: |
|
|
steveL wrote: |
Something in the src-uri? |
Not really. There is no file to download yet (it will soon be realeased as etcproposals-1.2), but the install.sh generates the tarball and copies it to /usr/portage/distfiles, so portage shouldnt try to download anything. do you have the tarball in DISTDIR? Do you have it in etcproposals-checkout/etcproposals-1.1.9999.tar.gz ? |
|
Back to top |
|
|
boniek Guru
Joined: 26 Mar 2005 Posts: 373
|
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed May 02, 2007 4:47 pm Post subject: |
|
|
boniek wrote: | OK, how is this different from dispatch-conf (I don't care about GUI stuff)? |
A few things that are better with the etc-proposals commandline:
- you dont have to use/zap a whole file, but you can use/zap changes on a change-by-change-basis (e.g. "use the new comment in lines 50-55, but dont change my custom settings on line 2-3")
- colored diffs with hints
- you can use/zap all files in a dir (even recursive)
- etc-proposals recognizes cvs-header changes, whitespace only changes. Dispatch-conf does this too, but only if the file has _only_ cvs-header/whitespace changes. With etc-proposals you can use all updated cvs-headers automatically and independant from that decide what to do with the other changes in the file.
- etc-proposals recognises config files that are unmodified by the user. Those can be updated with one simple command or even automatically.
- when you make a decision, its not immediatly merged to the filesystem. No more "Upps, I didnt mean to wipe _that_ file". You first decide want to do with each change and merge everything in one step at the end.
- you can review all decisions, changes and files at any time
(btw, if you dont care about the GUI its really easy because 1.1 is already in sunrise and the svn version has most of its improvements in the GUI parts only) |
|
Back to top |
|
|
boniek Guru
Joined: 26 Mar 2005 Posts: 373
|
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu May 03, 2007 5:14 am Post subject: |
|
|
Code: | !!! Couldn't download 'etcproposals-1.1.9999.tar.gz'. Aborting. |
Turns out I needed to run ebuild .. digest. I'd originally run manifest when I first got an error (something about the manifest files.)
But it's working now, and the new frontend looks great. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Sat May 05, 2007 3:15 pm Post subject: etc-proposals 1.2 released (etc-update with Gtk2/Qt4) |
|
|
etc-proposals 1.2 is released!
http://etc-proposals.berlios.de/
The ebuild is already commited to sunrise and will find its ways to your local overlay soon |
|
Back to top |
|
|
Necoro Veteran
Joined: 18 Dec 2005 Posts: 1912 Location: Germany
|
Posted: Wed May 09, 2007 4:49 pm Post subject: |
|
|
Code: | Traceback (most recent call last):
File "/usr/sbin/etc-proposals", line 13, in ?
from etcproposals.etcproposals_info import *
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_info.py", line 70, in ?
from etcproposals_qt4 import __version__ as qt4feversion
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 45, in ?
class KdelibsUtils(object):
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 46, in KdelibsUtils
ICONDIR_PATHS = get_command_output_iterator(['kde-config','--path', 'icon']).next().split(':')
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_tools.py", line 11, in get_command_output_iterator
outpipe = subprocess.Popen(command_and_args, shell=False, stdout=subprocess.PIPE).stdout
File "/usr/lib/python2.4/subprocess.py", line 542, in __init__
errread, errwrite)
File "/usr/lib/python2.4/subprocess.py", line 975, in _execute_child
raise child_exception
OSError: [Errno 2] Datei oder Verzeichnis nicht gefunden |
This comes when I start etc-proposals. It does not matter, which useflags I have installed and it also does not matter, which Frontends I activated in /etc/etc-proposals.conf. _________________ Inter Deum Et Diabolum Semper Musica Est. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed May 09, 2007 5:26 pm Post subject: |
|
|
Yuck! My bad.
Fixed in version 1.2.1 (already released and submitted to sunrise).
If you want a fast fix, substitute "FrontendFailedException" with "Exception" in etcproposals_info.py. |
|
Back to top |
|
|
Necoro Veteran
Joined: 18 Dec 2005 Posts: 1912 Location: Germany
|
Posted: Wed May 09, 2007 5:49 pm Post subject: |
|
|
Hmm ... okay - now it runs at least with "gtk2" as frontend ... but with qt4 i get
Code: | Traceback (most recent call last):
File "/usr/sbin/etc-proposals", line 70, in ?
import etcproposals.etcproposals_qt4
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 45, in ?
class KdelibsUtils(object):
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 46, in KdelibsUtils
ICONDIR_PATHS = get_command_output_iterator(['kde-config','--path', 'icon']).next().split(':')
File "/usr/lib/python2.4/site-packages/etcproposals/etcproposals_tools.py", line 17, in get_command_output_iterator
raise e
OSError: [Errno 2] Datei oder Verzeichnis nicht gefunden |
I think, there is a) a dependency missing or b) I have to enable a useflag somewhere (or c) a small bug in your code )...
Code: | kde-base/kdelibs-3.5.5-r10 USE="alsa cups fam kdehiddenvisibility ssl -acl -arts -avahi -debug -doc -jpeg2k -kdeenablefinal -kerberos -legacyssl -lua -openexr -spell -tiff -utempter -xinerama -zeroconf" LINGUAS="-he"
x11-libs/qt-4.2.3-r1 USE="cups dbus doc examples gif jpeg mysql opengl png qt3support zlib -accessibility -debug -firebird -glib -mng -nas -nis -odbc -pch -postgres -sqlite -sqlite3 -xinerama" INPUT_DEVICES="-wacom" |
(And the about dialog states "1.1.9999" as the version ) _________________ Inter Deum Et Diabolum Semper Musica Est. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed May 09, 2007 6:03 pm Post subject: |
|
|
kde-config does not seem to be in you $PATH, but since you have kde installed it should.
Quote: | (And the about dialog states "1.1.9999" as the version ) |
Well, maybe I rushed the release |
|
Back to top |
|
|
Necoro Veteran
Joined: 18 Dec 2005 Posts: 1912 Location: Germany
|
Posted: Wed May 09, 2007 6:21 pm Post subject: |
|
|
bmichaelsen wrote: | kde-config does not seem to be in you $PATH, but since you have kde installed it should. |
I dont have kde installed (only kdelibs) ... and kde-config is really not in my path Oo ... at least not as root. ... Hmm ... fixed this by taking "su -" instead of "su" _________________ Inter Deum Et Diabolum Semper Musica Est. |
|
Back to top |
|
|
Beinii n00b
Joined: 21 Sep 2006 Posts: 46 Location: Salo, Finland
|
Posted: Sat May 12, 2007 11:09 am Post subject: |
|
|
QT4 frontend:
Code: | Traceback (most recent call last):
File "/usr/sbin/etc-proposals", line 71, in ?
etcproposals.etcproposals_qt4.run_frontend()
File "/usr/lib64/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 646, in run_frontend
controller = EtcProposalsController(model)
File "/usr/lib64/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 608, in __init__
self.view = EtcProposalsView(proposals, self)
File "/usr/lib64/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 463, in __init__
self.initActions()
File "/usr/lib64/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 477, in initActions
self.exitAct.setIcon(qt.QIcon(KdelibsUtils.get_iconpath('actions', 'exit')))
File "/usr/lib64/python2.4/site-packages/etcproposals/etcproposals_qt4.py", line 58, in get_iconpath
raise LookupError, 'Icon %s not found.' % iconname
LookupError: Icon exit not found.
|
GTK frontend works but gtk is ugly _________________ Make love, not Warcraft... |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|