Blog

Viewing posts for the category Migrated from old blog

Nevow basic container Page + Page/Element with Data

Here some small code - snippets where some form of data gets passed to a page / element. This could of course be changed to get more data or not a dict/axiom db but I prefer it this way (Pretty much every axiom/nevow app will need something like this afaik):

# -*- coding: utf8 -*-

from nevow.rend import Page
from nevow.page import Element, renderer
from nevow import loaders
from nevow import tags as T

class PageWithDB(Page):
    """
    Own Page class to save myself passing the db object to every sub-page
    """
    
    def __init__(self, db, original = None, docFactory = None):
        self.db = None
        if not db:
            raise ValueError("No Database given")
        self.db = db
        Page.__init__(self, original, docFactory)

class ElementWithData(Element):
    """
    Element with Data
    """
        
    def __init__(self, data, docFactory = None):
        self.data = None
        if data == None:
            raise ValueError("No Data")
        self.data = data
        Element.__init__(self, docFactory)

class ContainerPage(PageWithDB):
    """
    Container Page which just has title and content renderer and
    loads only skeleton page. To be used with Elements
    
    The render_title and render_content methods should be overridden
    """
    addSlash = True
    docFactory = loaders.xmlfile(u'templates/pageskel.xml')
    
    def render_title(self, ctx, data):
        return u'TITLE RENDER'
    
    def render_content(self, ctx, data):
        return u'CONTENT'

Beagle config for headless Server with Web - Frontend

Just remembered today, that I nearly forgot to blog about my beagle setup on a file server with web-frontend and headless config.

Here goes:

Xorg + ati drivers problem on my laptop

Still got problems with newest catalyst on my laptop ...
I'll attach the logs here since the great support page doesn't let me paste that much text ...

start X, run program (emacs, gnome,... ) -> crash
(for some reason WoW works through wine wiht some - quite severe- display errors)

gentoo, hal + xorg 7.4 (xinput, wacom, synaptics)

Finally figured out what was wrong with my input devices since the upgrade.
It seems that because of the new hal + xinput auto detect stuff things got messed up. I now got working fdi files for both my stylus and my synaptics touchpad :D
After some looking around i had figured out that i need to have my config stuff in .fdi files for hal instead of in my xorg.conf file which was something i should've read in some changelog .. i should really start reading those :D

so I have my wacom fdi file and i extended the default gentoo xinput one. I've attached both.
This does require that the input devices are *not* in /etc/X11/xorg.conf

The problem is that only the stylus works (neither eraser nor touchscreen do) but I mostly use the stylus so i don't really care at the moment. Besides it seems to be a limitation of the auto detection and/or hal which can't configure one device as multiple things or sth like that.
The only way to get that to work again would be to define all input devices manually and set

Section "ServerFlags"
       Option  "AutoAddDevices" "False"
EndSection

Xorg 7.4 and ati-drivers 5.561, touchpad (synaptics)

Upgraded to xorg 7.4 and new ati drivers in hope of them working better as it actually says my model but apparently that only means the desktop model not the laptop one .. still crashes most of the time.
since downgrading was a pita now too i left it and use vesa for now since it's too much of a pain ..

one other thing was that my touchpad stopped workign (and my touchscreen won't really work either - cry) after some google search and dmesg | grep -i touch i found i got asynaptics touchpad and that someone else used that driver for it so i enabled it and put those options.
the scroll area thing doens't work yet but don't really care atm. also need some tweaking in regards to clicking by touching the area. with this just the buttons work .. but better than no mouse ..

Section "InputDevice"
        Identifier  "Touchpad"
        Driver      "synaptics"
        Option      "Device" "/dev/input/event1"
        Option      "Protocol" "event"
        Option      "SpecialScrollAreaRight" "true"
        Option      "Emulate3Buttons"
EndSection

# worked fine in xorg 7.3 but buggered in 7.4 see above
#Section "Inputdevice"
#       Identifier  "Mouse1"
#       Driver      "mouse"
#       Option      "Protocol" "Auto"   # Auto detect
#       Option      "Device" "/dev/input/mouse0" #ice"
#       Option      "Device" "/dev/gpmdata"
# Mouse-speed setting for PS/2 mouse.
###     Option      "ZAxisMapping" "4 5 6 7"
# Emulate3Buttons is an option for 2-button mice
#       Option      "Emulate3Buttons"
#EndSection

Recent Posts

Archive

2023
2022
2021
2020
2019
2018
2014
2012
2011
2010
2009
2008
2007

Categories

Authors

Feeds

RSS / Atom