Changeset 740:119f013c8e27 in hatta-dev
- Timestamp:
- 01/24/10 13:28:09 (2 years ago)
- Branch:
- default
- Files:
-
- 2 edited
-
hatta.py (modified) (3 diffs)
-
tests/test_repo.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hatta.py
r739 r740 185 185 help='Use the STYLE pygments style for highlighting', 186 186 metavar='STYLE') 187 add('-D', '--subdirectories', dest='subdirectories', 188 action="store_true", 189 help='Store subpages as subdirectories in the filesystem') 187 190 188 191 options, args = parser.parse_args() … … 662 665 if filename.startswith(self.repo_prefix): 663 666 yield self._file_to_title(filename) 667 668 669 class WikiSubdirectoryStorage(WikiStorage): 670 """ 671 A version of WikiStorage that keeps the subpages in real subdirectories in 672 the filesystem. 673 674 """ 675 676 # XXX Override required methods here. 677 664 678 665 679 class WikiParser(object): … … 2446 2460 self.icon_page = self.config.get('icon_page', None) 2447 2461 self.pygments_style = self.config.get('pygments_style', 'tango') 2448 2449 self.storage = self.storage_class(self.path, self.page_charset) 2462 self.subdirectories = self.config.get_bool('subdirectories', False) 2463 if self.subdirectories: 2464 self.storage = WikiSubdirectoryStorage(self.path, self.page_charset) 2465 else: 2466 self.storage = self.storage_class(self.path, self.page_charset) 2450 2467 if not os.path.isdir(self.cache): 2451 2468 os.makedirs(self.cache) -
tests/test_repo.py
r739 r740 48 48 return hatta.WikiStorage(repo_path) 49 49 50 def pytest_funcarg__subdir_repo(request): 51 """ 52 This function is executed whenever a test needs a "repo" parameter. 53 It creates a new WikiSubdirectoryStorage object with Hatta repository in a 54 temporary directory. 55 """ 56 57 repo_path = str(request.config.ensuretemp('repo')) 58 request.addfinalizer(lambda: clear_directory(repo_path)) 59 return hatta.WikiSubdirectoryStorage(repo_path) 60 61 class TestSubdirectoryStorage(object): 62 """ 63 Tests for the WikiSubdirectoryStorage. 64 """ 65 66 # XXX Put your tests here. 67 68 50 69 class TestMercurialStorage(object): 51 70 """
Note: See TracChangeset
for help on using the changeset viewer.
