Slight changes to $(CONFVERSION)

This commit is contained in:
Kris Maglione 2009-08-03 16:33:23 -04:00
parent 947f9f6dc9
commit 4302ec8f9c
6 changed files with 19 additions and 13 deletions

View File

@ -72,7 +72,10 @@ class Monitor(object):
def getlabel(self):
if self.action:
return self.action(self)
try:
return self.action(self)
except Exception:
pass
return None
_active = True

View File

@ -83,6 +83,8 @@ class Data(Int):
assert offset + n <= len(data), "String too long to unpack"
return self.size + n, data[offset:offset + n]
def marshall(self, val):
if isinstance(val, unicode):
val = val.encode('UTF-8')
return [self.encode(len(val)), val]
# Note: Py3K strings are Unicode by default. They can't store binary
@ -93,6 +95,7 @@ class String(Data):
return off, val.decode('UTF-8')
def marshall(self, val):
if isinstance(val, str):
# Check for valid UTF-8
str.decode('UTF-8')
else:
val = val.encode('UTF-8')

View File

@ -60,7 +60,7 @@ def unresponsive_client(client):
msg = 'The following client is not responding. What would you like to do?'
resp = call('wihack', '-transient', client.id,
'xmessage', '-nearmouse', '-buttons', 'Kill,Wait', '-print',
'%s\n %s' % (client, client.label))
'%s\n %s' % (msg, client.label))
if resp == 'Kill':
client.slay()

View File

@ -2,8 +2,8 @@
# start wmiirc
export home="$HOME"
lconf="$home/.wmii-CONFVERSION"
gconf="CONFPREFIX/wmii-CONFVERSION"
lconf="$home/.wmiiCONFVERSION"
gconf="CONFPREFIX/wmiiCONFVERSION"
export WMII_CONFPATH="$lconf:$gconf"
#export POSIXLY_CORRECT=gnu_hippies

View File

@ -3,5 +3,5 @@ VERS = hg$$(hg log -r $$(hg id 2>/dev/null | awk -F'[+ ]' '{print $$1}') --templ
VERSION = $(VERS)
VERSION := $(shell echo $(VERS))
VERSION != echo $(VERS)
CONFVERSION = hg
CONFVERSION = -hg

View File

@ -1,16 +1,16 @@
ROOT=..
include ${ROOT}/mk/hdr.mk
include ${ROOT}/mk/wmii.mk
include $(ROOT)/mk/hdr.mk
include $(ROOT)/mk/wmii.mk
BIN = ${ETC}/wmii-${CONFVERSION}
BIN = $(ETC)/wmii$(CONFVERSION)
TARG = rc.wmii \
wmiirc \
welcome
FILTER = sed "s|CONFPREFIX|${ETC}|g; \
s|CONFVERSION|${CONFVERSION}|g; \
s|P9PATHS|${P9PATHS}|g; \
FILTER = sed "s|CONFPREFIX|$(ETC)|g; \
s|CONFVERSION|$(CONFVERSION)|g; \
s|P9PATHS|$(P9PATHS)|g; \
s|BINSH|$(BINSH)|g; \
s|AWKPATH|${AWKPATH}|g"
s|AWKPATH|$(AWKPATH)|g"
include ${ROOT}/mk/many.mk
include $(ROOT)/mk/many.mk