560 if encoding : |
560 if encoding : |
561 return codecs.open(self.path, mode, encoding, errors, bufsize) |
561 return codecs.open(self.path, mode, encoding, errors, bufsize) |
562 |
562 |
563 else : |
563 else : |
564 return open(self.path, mode, *(arg for arg in (bufsize, ) if arg is not None)) |
564 return open(self.path, mode, *(arg for arg in (bufsize, ) if arg is not None)) |
|
565 |
|
566 def open_read (self, *args, **kwargs) : |
|
567 """ Open for read using open('r') """ |
|
568 |
|
569 return self.open('r', *args, **kwargs) |
565 |
570 |
566 def open_write (self, *args, **kwargs) : |
571 def open_write (self, *args, **kwargs) : |
567 """ |
572 """ Open for write using open('w') """ |
568 Open for write using open('w'). |
|
569 """ |
|
570 |
573 |
571 return self.open('w', *args, **kwargs) |
574 return self.open('w', *args, **kwargs) |
572 |
575 |
573 def copy_from (self, file) : |
576 def copy_from (self, file) : |
574 """ |
577 """ |
697 """ |
700 """ |
698 Construct the directory tree root at the given 'real' path, which must be a raw str |
701 Construct the directory tree root at the given 'real' path, which must be a raw str |
699 """ |
702 """ |
700 |
703 |
701 # abuse Node's concept of a "name" a bit |
704 # abuse Node's concept of a "name" a bit |
702 super(Root, self).__init__(None, fspath) |
705 super(Root, self).__init__(None, fspath, config=config) |
703 |
|
704 # store our config |
|
705 self.config = config |
|
706 |
706 |
707 def nodepath (self) : |
707 def nodepath (self) : |
708 """ |
708 """ |
709 Just return ourself |
709 Just return ourself |
710 """ |
710 """ |