##// END OF EJS Templates
cleanup: use modern @property/@foo.setter property specification...
Augie Fackler -
r27879:52a4ad62 default
parent child Browse files
Show More
@@ -851,13 +851,15 b' class bundlepart(object):'
851 851 self._advisoryparams, self._data, self.mandatory)
852 852
853 853 # methods used to defines the part content
854 def __setdata(self, data):
854 @property
855 def data(self):
856 return self._data
857
858 @data.setter
859 def data(self, data):
855 860 if self._generated is not None:
856 861 raise error.ReadOnlyPartError('part is being generated')
857 862 self._data = data
858 def __getdata(self):
859 return self._data
860 data = property(__getdata, __setdata)
861 863
862 864 @property
863 865 def mandatoryparams(self):
@@ -448,22 +448,22 b' class vfs(abstractvfs):'
448 448 if realpath:
449 449 base = os.path.realpath(base)
450 450 self.base = base
451 self._setmustaudit(audit)
451 self.mustaudit = audit
452 452 self.createmode = None
453 453 self._trustnlink = None
454 454
455 def _getmustaudit(self):
455 @property
456 def mustaudit(self):
456 457 return self._audit
457 458
458 def _setmustaudit(self, onoff):
459 @mustaudit.setter
460 def mustaudit(self, onoff):
459 461 self._audit = onoff
460 462 if onoff:
461 463 self.audit = pathutil.pathauditor(self.base)
462 464 else:
463 465 self.audit = util.always
464 466
465 mustaudit = property(_getmustaudit, _setmustaudit)
466
467 467 @util.propertycache
468 468 def _cansymlink(self):
469 469 return util.checklink(self.base)
@@ -561,14 +561,14 b' class auditvfs(object):'
561 561 def __init__(self, vfs):
562 562 self.vfs = vfs
563 563
564 def _getmustaudit(self):
564 @property
565 def mustaudit(self):
565 566 return self.vfs.mustaudit
566 567
567 def _setmustaudit(self, onoff):
568 @mustaudit.setter
569 def mustaudit(self, onoff):
568 570 self.vfs.mustaudit = onoff
569 571
570 mustaudit = property(_getmustaudit, _setmustaudit)
571
572 572 class filtervfs(abstractvfs, auditvfs):
573 573 '''Wrapper vfs for filtering filenames with a function.'''
574 574
General Comments 0
You need to be logged in to leave comments. Login now