Changeset 747:3469bb236ef4 in hatta-dev


Ignore:
Timestamp:
01/24/10 15:36:26 (2 years ago)
Author:
sheep@…
Branch:
default
Message:

docstrings

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hatta.py

    r746 r747  
    686686 
    687687    def _title_to_file(self, title): 
    688         """Modified escaping to allow slashes and spaces.""" 
     688        """Modified escaping allowing (some) slashes and spaces.""" 
    689689 
    690690        title = unicode(title).strip() 
     
    696696 
    697697    def save_file(self, title, file_name, author=u'', comment=u'', parent=None): 
    698         """Make the subdirectories if needed.""" 
     698        """ 
     699        Save the file and make the subdirectories if needed. 
     700        """ 
    699701 
    700702        file_path = self._file_path(title) 
     
    709711 
    710712    def delete_page(self, title, author=u'', comment=u''): 
     713        """ 
     714        Remove empty directories after deleting a page. 
     715 
     716        Note that Mercurial doesn't track directories, so we don't have to 
     717        commit after removing empty directories. 
     718        """ 
     719 
    711720        super(WikiSubdirectoryStorage, self).delete_page(title, author, comment) 
    712721        file_path = self._file_path(title) 
     
    714723        dir_path = os.path.dirname(file_path) 
    715724        os.removedirs(dir_path) 
     725 
    716726 
    717727class WikiParser(object): 
  • tests/test_repo.py

    r746 r747  
    8080 
    8181    def test_title_to_file(self, subdir_repo): 
     82        """ 
     83        Test the modified filename escpaing. 
     84        """ 
     85 
    8286        for title, filename in self.title_encodings.iteritems(): 
    8387            escaped = subdir_repo._title_to_file(title) 
     
    97101 
    98102    def test_subdirectory_delete(self, subdir_repo): 
     103        """ 
     104        Check if empty subdirectories are removed on page delete. 
     105        """ 
     106 
    99107        title = u'foo/bar' 
    100108        filepath = os.path.join(subdir_repo.path, 'foo/bar') 
Note: See TracChangeset for help on using the changeset viewer.