Changeset da4f72c38ed31111d447c64efd78cf500beabf73

Show
Ignore:
Timestamp:
06/07/08 00:13:03 (7 months ago)
Author:
Sebastien Martini <ookoi@…>
Parents:
c36bdd432b56f0d9a329c918c0a3a0110d59f5c4
Children:
6253a716008486c1864f4416916bb2fe1387498c
git-committer:
Sebastien Martini <ookoi@mars.(none)> / 2008-06-07T00:13:03Z+0200
Message:

* Fix segmentation fault reported by dougfort@…, but not

sure if the way it is fixed doesn't introduce limitations on encodings.

* event.pathname represents now an absolute path.

* Fix display of events.

Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • pyinotify.py

    rc36bdd4 rda4f72c  
    5656__author__ = "seb@dbzteam.org (Sebastien Martini)" 
    5757 
    58 __version__ = "0.8.0q" 
     58__version__ = "0.8.0r" 
    5959 
    6060__metaclass__ = type  # Use new-style classes by default 
     
    363363# all 'normal' events 
    364364ALL_EVENTS = reduce(lambda x, y: x | y, EventsCodes.OP_FLAGS.itervalues()) 
     365EventsCodes.ALL_FLAGS['ALL_EVENTS'] = ALL_EVENTS 
     366EventsCodes.ALL_VALUES[ALL_EVENTS] = 'ALL_EVENTS' 
    365367 
    366368 
     
    391393            elif isinstance(value, str) and not value: 
    392394                value ="''" 
    393             if attr == 'pathname' and value and self.dir: 
    394                 value += os.sep 
    395395            s += ' %s%s%s' % (color_theme.field_name(attr), 
    396396                              color_theme.punct('='), 
     
    462462        try: 
    463463            if self.name: 
    464                 self.pathname = os.path.join(self.path, self.name) 
     464                self.pathname = os.path.abspath(os.path.join(self.path,  
     465                                                             self.name)) 
    465466            else: 
    466                 self.pathname = self.path 
     467                self.pathname = os.path.abspath(self.path) 
    467468        except AttributeError: 
    468469            pass 
     
    12651266        watch manager dictionary. Return the wd value. 
    12661267        """ 
    1267         wd_ = LIBC.inotify_add_watch(self._fd, path, mask) 
     1268        wd_ = LIBC.inotify_add_watch(self._fd, 
     1269                                     ctypes.create_string_buffer(path), 
     1270                                     mask) 
    12681271        if wd_ < 0: 
    12691272            return wd_ 
     
    14091412 
    14101413            if mask: 
    1411                 wd_ = LIBC.inotify_add_watch(self._fd, apath, mask) 
     1414                addw = LIBC.inotify_add_watch 
     1415                wd_ = addw(self._fd, 
     1416                           ctypes.create_string_buffer(apath), 
     1417                           mask) 
    14121418                if wd_ < 0: 
    14131419                    ret_[awd] = False