Skip to content

Commit

Permalink
undeprecate stat_info
Browse files Browse the repository at this point in the history
  • Loading branch information
tamland committed Feb 22, 2014
1 parent a59f58d commit 2af868a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/watchdog/utils/dirsnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,21 @@ def isdir(self, path):
def mtime(self, path):
return self._stat_info[path].st_mtime

def stat_info(self, path):
"""
Returns a stat information object for the specified path from
the snapshot.
Attached information is subject to change. Do not use unless
you specify `stat` in constructor. Use :func:`inode`, :func:`mtime`,
:func:`isdir` instead.
:param path:
The path for which stat information should be obtained
from a snapshot.
"""
return self._stat_info[path]

def __sub__(self, previous_dirsnap):
"""Allow subtracting a DirectorySnapshot object instance from
another.
Expand All @@ -285,26 +300,12 @@ def __repr__(self):
def stat_snapshot(self):
"""
.. deprecated:: 0.7.2
Use :func:`inode`, :func:`isdir` and :func:`mtime` instead.
Use :func:`stat_info` or :func:`inode`/:func:`mtime`/:func:`isdir`
Returns a dictionary of stat information with file paths being keys.
"""
return self._stat_info

def stat_info(self, path):
"""
.. deprecated:: 0.7.2
Use :func:`inode`, :func:`isdir` and :func:`mtime` instead.
Returns a stat information object for the specified path from
the snapshot.
:param path:
The path for which stat information should be obtained
from a snapshot.
"""
return self._stat_info[path]

def path_for_inode(self, inode):
"""
.. deprecated:: 0.7.2
Expand Down

0 comments on commit 2af868a

Please sign in to comment.