diff options
Diffstat (limited to 'Lib/plat-mac/macostools.py')
-rw-r--r-- | Lib/plat-mac/macostools.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/Lib/plat-mac/macostools.py b/Lib/plat-mac/macostools.py index 2adc8aa..27d2f83 100644 --- a/Lib/plat-mac/macostools.py +++ b/Lib/plat-mac/macostools.py @@ -65,21 +65,9 @@ def mkdirs(dst): def touched(dst): """Tell the finder a file has changed. No-op on MacOSX.""" - if sys.platform != 'mac': return import warnings - warnings.filterwarnings("ignore", "macfs.*", DeprecationWarning, __name__) - import macfs - file_fss = macfs.FSSpec(dst) - vRefNum, dirID, name = file_fss.as_tuple() - dir_fss = macfs.FSSpec((vRefNum, dirID, '')) - crdate, moddate, bkdate = dir_fss.GetDates() - now = time.time() - if now == moddate: - now = now + 1 - try: - dir_fss.SetDates(crdate, now, bkdate) - except macfs.error: - pass + warnings.warn("macostools.touched() has been deprecated", + DeprecationWarning, 2) def touched_ae(dst): """Tell the finder a file has changed""" @@ -129,7 +117,6 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None): dstfsr = File.FSRef(dst) catinfo, _, _, _ = srcfsr.FSGetCatalogInfo(Files.kFSCatInfoAllDates) dstfsr.FSSetCatalogInfo(Files.kFSCatInfoAllDates, catinfo) - touched(dstfss) def copytree(src, dst, copydates=1): """Copy a complete file tree to a new destination""" |