[hackers] [wmii] Fix some pygmi bugs. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Fri, 30 Oct 2009 08:12:08 +0000 (UTC)

changeset: 2582:d4d5136dc985
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Fri Oct 30 04:10:53 2009 -0400
files: alternative_wmiircs/python/pygmi/fs.py alternative_wmiircs/python/wmiirc.py
description:
Fix some pygmi bugs.

diff -r 7a4ba9226bc7 -r d4d5136dc985 alternative_wmiircs/python/pygmi/fs.py
--- a/alternative_wmiircs/python/pygmi/fs.py Fri Oct 30 03:06:14 2009 -0400
+++ b/alternative_wmiircs/python/pygmi/fs.py Fri Oct 30 04:10:53 2009 -0400
@@ -35,6 +35,11 @@
     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 @@
                 object.
         """
         super(Dir, self).__init__()
+ if isinstance(id, Dir):
+ id = id.id
         if id != 'sel':
             self._id = id
 
@@ -358,11 +365,11 @@
                   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 -r 7a4ba9226bc7 -r d4d5136dc985 alternative_wmiircs/python/wmiirc.py
--- a/alternative_wmiircs/python/wmiirc.py Fri Oct 30 03:06:14 2009 -0400
+++ b/alternative_wmiircs/python/wmiirc.py Fri Oct 30 04:10:53 2009 -0400
@@ -297,7 +297,7 @@
 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:
Received on Fri Oct 30 2009 - 08:12:08 UTC

This archive was generated by hypermail 2.2.0 : Fri Oct 30 2009 - 08:24:05 UTC