Home Home > 2009
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for 2009

Rebooting icecream

May 6th, 2009 by

Our icecream scheduler is moved to another room, so I thought I share the statistics
(just telnet <scheduler> 8766)

200-ICECC 0.8.0-make-it-cool: 5261077s uptime, 61 hosts, 0 jobs in queue (53255934 total).

So this is still the pre-0.9 code and it served in 60 days over 10 jobs per second on average.

openSUSE-GNOME BugDay!

May 5th, 2009 by

Roll up those sleeves and mark your calendars, because here comes another BugDay!

During Community Week (http://en.opensuse.org/CommunityWeek), I’ll be hosting another openSUSE-GNOME BugDay on Fri, 15 MAY 2009. We’ll start promptly at 1000 CDT and will continue until 1600 CDT. I will be around very early in the day to start prep for the meeting should you have any questions.

We’ll conduct business in #opensuse-gnome on Freenode (irc.freenode.net). I will establish a Gobby session as I’ve done in the past, and we’ll work off of that.

Can’t wait to see you there!

OpenOffice_org 3.1 beta7 available

May 5th, 2009 by

I’m happy to announce that OpenOffice.org 3.1 beta7 packages are available in the Build Service OpenOffice:org:UNSTABLE project. They include many upstream and Go-oo fixes. Please, look for more details about the openSUSE OOo build on the wiki page.

The packages are beta versions and might include even serious bugs. Therefore they are not intended for data-critical usage. A good practice is to archive any important data before an use, …

We kindly ask any interested beta testers to try the package and report bugs.

This build includes an alpha version of OpenXML export filters (DOCX, XLSX, PPTX). We also added many fixes to the OpenXML import filters. They should be able to import and export simple documents now.  These changes affected also the import and export filters of the old binary file formats (DOC, XLS, PPT). So we kindly ask anyone to try this functionality and report bugs especially in the import and export of the old binary file formats.

Other information and plans:

I would like to provide rc1 build the following week. I am sorry to say but we are delayed after the upstream release by two weeks. We did too many extra changes last weeks and they need more testing before we mark the Go-oo based release as the final.

GSoC introduction – openSUSE@ARM

May 4th, 2009 by

Hi openSUSE community!

I’m glad my proposal was accepted and today I want to introduce myself and my GSoC project.

/me , thats Jan-Simon Möller and I’m just finishing my Diploma in electrical engineering at the Leibniz Universität Hannover. I’m coordinator of the openSUSE Weekly Newsletter and contribute also to the hamradio repository, the iFolder project and the openSUSE Build Service. See also my “People of openSUSE” interview.

My Project in short:  openSUSE@ARM
My aim during GSoC 2009 is to port first the base to the ARM platform. Then KIWI needs also some attention when it comes to imaging and after that the tools, Kernel and X11.

I’ll heavily use the capabilities of the openSUSE Build Service, which is now ready for ARM.

During the last few days, I’ve done many little preparations to get it all flying when GSoC coding period starts.

Stay tuned !

Factory USB Images

May 4th, 2009 by

If you’re interested in USB images, I’m publishing factory USB images built in the build service. They are completely fresh and see no testing at all, so if you find a problem, send me a patch 🙂

They are compressed .bz2, so the download is roughly the same as a CD ISO, but they are actually .raw images. So you can deploy them on a USB stick and carry around your personal linux hard drive. But you will need something > 3G. Installing them is pretty easy.

Put your USB stick in your computer, then check /dev/disk/by-id/usb* for the name of your stick. Mine is named /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0. You can double check by looking if it points to the same sdX that you see last in dmesg. Like this:

sd 29:0:0:0: [sde] Assuming drive cache: write through
sde: sde2
sd 29:0:0:0: [sde] Attached SCSI removable disk


desdemona:~ # ls -l /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0
lrwxrwxrwx 1 root root 9 4. Mai 15:47 /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0 -> ../../sde

Bot are sde – fine. What partitions are on it, doesn’t matter – all data will be erased by this.

Now the command (for gnome.x86_64 – there are 3 other choices):

wget -O - http://download.opensuse.org/repositories/openSUSE:/Factory:/Live/images/openSUSE-11.2-usb-gnome.x86_64-2.8.0-Build18.1.raw.bz2 | bzcat | dd of=/dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0 bs=4M

Depending on the speed of your USB stick, this can take a while, but the good thing is that this command doesn’t require any temporary space. My stick is a very fast one and it takes around 10 minutes to download and “burn”. After that, either reboot or put the stick in the computer you like to boot. On first boot, it will expand to the size of your USB stick, creating another partition.

Note that this images come without live installer, but you can of course zypper in yast2-live-installer and xdg-su -c /sbin/yast2 live-installer.

Suppressing KeyboardInterrupt traceback in Python

May 4th, 2009 by

If you have a running program in Python and press Ctrl+C, you’ll get a traceback like this:

$ scout java foo
^CTraceback (most recent call last):
  File "/usr/bin/scout", line 11, in 
    ret = scout.ScoutCore.run()
  File "/usr/lib64/python2.6/site-packages/scout/__init__.py", line 945, in run
    result = module.ScoutModule().main(clp.module_args)
  File "/usr/lib64/python2.6/site-packages/scout/__init__.py", line 873, in main
    return self.do_query(args.query, repos, args.inversesearch)
  File "/usr/lib64/python2.6/site-packages/scout/__init__.py", line 890, in do_query
    result.add_rows(self._query(repo, query, inversesearch))
  File "/usr/lib64/python2.6/site-packages/scout/__init__.py", line 896, in _query
    r = db.query(self._sql, '%%%s%%' % term)
  File "/usr/lib64/python2.6/site-packages/scout/__init__.py", line 485, in query
    if len(row) == 1:           #(2)
KeyboardInterrupt

It is useful suppress it, because user knows he breaks the program and this output should be considered as a bug. Possible solution is wrap a main function by one big try: except KeyboardInterrupt:

try:
  main() # the main function
except KeyboardInterrupt:
  pass # KeyboardInterrupt supressed

But it makes a new level of indentation which should be uncomfortable – especially in Python. Or when you have multiple entry-points, or just don’t well structured program (which is common when you write your private helper script :)), you maybe prefer another solution.

Python has a sys.excepthook, which is called for traceback printing, so we could define our own and suppress unnecessary output here. And it would be nice suppress only one exception and handle other ones using existing function. And this function make it:

def suppress_keyboard_interrupt_message():
    old_excepthook = sys.excepthook

    def new_hook(type, value, traceback):
        if type != exceptions.KeyboardInterrupt:
            old_excepthook(type, value, traceback)
        else:
            pass

    sys.excepthook = new_hook

Function suppress_keyboard_interrupt_message (it is really nice name, don’t it ;-)) stores an existing hook and register an inner function new_hook as a new one. Advantage is that old_excepthook exists only in a scope of this function, so you don’t need use global variables for it.

Update: typos fixed

Modified Versions out

May 2nd, 2009 by

The following Packages are modified and released in hamradio Repository:

* libatlas3
* necpp
* qantenna

Swine Flu

April 30th, 2009 by

ungamaskswineflu

Ruby style method injection in Python

April 29th, 2009 by

Ruby has a nice, but very dangerous feature called open classes. That means you can extend any class definition if you want it.

This example shows it

#!/usr/bin/ruby
class Foo
    def do_foo
        return "foo"
    end
end

aFoo = Foo.new()

puts aFoo.do_foo()

class Foo
    def do_bar
        return "bar"
    end
end

puts aFoo.do_bar()

That means you dynamically extend the definition of Foo class, so the last line prints “bar”.

Python behavior is different, because it does not allows this extending. Python just redefines a class Foo, so new instance of Foo will have a do_bar method only. But this not affected an existing ones, like Ruby does.

class Foo:

    def do_foo(self):
        return "foo"

aFoo1 = Foo()

class Bar(Foo):

    def do_nothing(self):
        pass

print issubclass(Bar, Foo)
print isinstance(aFoo1, Foo)

class Foo:
    
    def do_bar(self):
        return "bar"

aFoo2 = Foo()
aBar  = Bar()

print issubclass(Bar, Foo)
print isinstance(aFoo1, Foo)
print isinstance(aFoo2, Foo)

print dir(aFoo1)
print dir(aFoo2)
print dir(aBar)

But what about method injection? My solution is based on ideas of Recipe 81732: Dynamically added methods to a class.

import types

def funcToMethod(func, instance, method_name=None):
    cls = instance.__class__ if type(instance) != types.TypeType else instance
    setattr(cls, \
            method_name or func.__name__, \
            types.MethodType(func, instance, cls))

And that’s all. The funcToMethod bounds func to instances’s class and allows under method_name (default name is a same as a function one). So lets do some testing.

class Foo(object):

    def list(self):

        return [meth for meth in dir(self) if meth[:3] == 'do_' and type(getattr(self, meth)) == types.MethodType]

    def do_bar(self):
        
        return "bar"

def do_foo(inst):

    return "foo"

class Bar(Foo):

    def do_nothing(self):
        pass

aBar = Bar()

aFoo1 = Foo()
print aFoo1.list()
# calling it with class instead of instance is also possible and is equivalent
#funcToMethod(do_foo, Foo, "do_foo")
funcToMethod(do_foo, aFoo1, "do_foo")

aFoo2 = Foo()
print aFoo1.list()
print aFoo2.list()

print aFoo1.do_foo()
print aFoo2.do_foo()

print aBar.list()
print aBar.do_foo()

When you run the code, you will see that funcToMethod adds a new method to Foo class and this changes both existing and new instances as Ruby does too. And subclassing is not a problem, they are be affected too.

OpenOffice_org 3.1 beta6 and missing localizations

April 29th, 2009 by

Urgh, the OpenOffice_org 3.1 beta6 packages are currently available only for 5 localizations: English(American), German, Japanese, Czech, Hungarian. I forgot to enable all localizations in the final build (bnc#498906). I have just triggered the full rebuild but it will take one or two days until the packages are available.

I am really sorry for the inconvenience.