-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1637 from UlrichB22/cli_checks
Add wiki index checks in CLI.
- Loading branch information
Showing
4 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright: 2002 Juergen Hermann <[email protected]> | ||
# Copyright: 2006-2010 MoinMoin:ThomasWaldmann | ||
# Copyright: 2024 MoinMoin:UlrichB | ||
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details. | ||
|
||
""" | ||
|
@@ -12,8 +13,9 @@ | |
import shutil | ||
import time | ||
import errno | ||
from stat import S_ISDIR, ST_MODE, S_IMODE | ||
|
||
from glob import glob | ||
from stat import S_ISDIR, ST_MODE, S_IMODE | ||
from os import replace as rename | ||
|
||
from moin import log | ||
|
@@ -181,3 +183,9 @@ def copytree(src, dst, symlinks=False): | |
errors.append((srcname, dstname, why)) | ||
if errors: | ||
raise EnvironmentError(str(errors)) | ||
|
||
|
||
def wiki_index_exists(): | ||
"""Return true if a wiki index exists.""" | ||
logging.debug('CWD: %s', os.getcwd()) | ||
return bool(glob('wiki/index/_all_revs_*.toc')) |