Viewing posts for the category Migrated from old blog
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
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)
Element with Data
def __init__(self, data, docFactory = None):
self.data = None
if data == None:
raise ValueError("No Data")
self.data = data
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):
Just remembered today, that I nearly forgot to blog about my beagle setup on a file server with web-frontend and headless config.
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)
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
Option "AutoAddDevices" "False"
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 ..
Option "Device" "/dev/input/event1"
Option "Protocol" "event"
Option "SpecialScrollAreaRight" "true"
# worked fine in xorg 7.3 but buggered in 7.4 see above
# 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"