Fix some pygmi bugs.

This commit is contained in:
Kris Maglione 2009-10-30 04:10:53 -04:00
parent e31731e8bc
commit cee2e686db
2 changed files with 12 additions and 5 deletions

View File

@ -35,6 +35,11 @@ class Ctl(object):
ctl_types = {}
ctl_hasid = False
def __eq__(self, other):
if self.ctl_hasid and isinstance(other, Ctl) and other.ctl_hasid:
return self.id == other.id
return False
def __init__(self):
self.cache = {}
@ -126,6 +131,8 @@ class Dir(Ctl):
object.
"""
super(Dir, self).__init__()
if isinstance(id, Dir):
id = id.id
if id != 'sel':
self._id = id
@ -358,11 +365,11 @@ class Tag(Dir):
for l in client.readlines('%s/index' % self.path)
if l]:
if l[0] == '#':
if l[1] == '~':
area = Area(tag=self, ord=l[1], width=l[2], height=l[3],
frames=[])
m = re.match(r'(?:(\d+):)?(\d+|~)', l[1])
if m.group(2) == '~':
area = Area(tag=self, screen=m.group(1), ord=l[1], width=l[2],
height=l[3], frames=[])
else:
m = re.match(l[1], '(?:(\d+):)?(\d+)')
area = Area(tag=self, screen=m.group(1) or 0,
ord=m.group(2), offset=l[2], width=l[3],
frames=[])

View File

@ -297,7 +297,7 @@ Actions.rehash()
if not os.environ.get('WMII_NOPLUGINS', ''):
dirs = filter(curry(os.access, _, os.R_OK),
('%s/plugins' % dir for dir in confpath))
files = filter(re.compile(r'\.py$').match,
files = filter(re.compile(r'\.py$').search,
reduce(operator.add, map(os.listdir, dirs), []))
for f in ['wmiirc_local'] + ['plugins.%s' % file[:-3] for file in files]:
try: