You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check an example for a pageTitle with a "/" or other directory separating characters depending on os
make sure the two methods:
cmdline.py:
@staticmethoddefgetPageTitlesForWikiTextPath(backup_path:str)->list:
''' get the page titles for the given backupPath Args: backup_path(str): the path to the WikiText Files (e.g. created by wikibackup) Returns: list: a list of PageTitles '''page_titles= []
ifbackup_path:
forpath, _subdirs, filesinos.walk(backup_path):
fornameinfiles:
filename=os.path.join(path, name)[len(backup_path) +1:]
iffilename.endswith(".wiki"):
page_titles.append(filename[:-len(".wiki")])
returnpage_titles;
wikiFileManager.py
defgetAllWikiFiles(self,wikiTextPath:str=None):
''' get all wiki Files for the given wikiTextPath Args: wikiTextPath(str): the root of the wikiText directory (e.g. a wikiBackup target or staging area for generating or fixing/restoring wikiMarkup) Returns: dict: a lookup for WikiFiles by pageTitle '''allWikiFiles= {}
ifwikiTextPathisNone:
wikiTextPath=self.wikiTextPathforroot, _dirnames, filenamesinos.walk(wikiTextPath):
forfilenameinfilenames:
iffilename.endswith('.wiki'):
wikiFile=WikiFile(filename, wikiFileManager=self)
allWikiFiles[wikiFile.getPageTitle()]=wikiFilereturnallWikiFiles
are integrated
The text was updated successfully, but these errors were encountered:
WolfgangFahl
changed the title
remove redudant use of os.walk and check pagetTitles are actually created properly
remove redudant use of os.walk and check pageTitles are actually created properly
Aug 3, 2021
check an example for a pageTitle with a "/" or other directory separating characters depending on os
make sure the two methods:
cmdline.py:
wikiFileManager.py
are integrated
The text was updated successfully, but these errors were encountered: