commit cee2e686dbfd9085ae2155f3f5f13a1246327b28
parent e31731e8bcb6b25602c95d9709eee026fe5b5264
Author: Kris Maglione <kris@suckless.org>
Date: Fri, 30 Oct 2009 04:10:53 -0400
Fix some pygmi bugs.
Diffstat:
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/alternative_wmiircs/python/pygmi/fs.py b/alternative_wmiircs/python/pygmi/fs.py
@@ -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=[])
diff --git a/alternative_wmiircs/python/wmiirc.py b/alternative_wmiircs/python/wmiirc.py
@@ -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: