2121
2222
2323def setup (app ):
24- volatility_directory = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' , 'volatility ' ))
24+ volatility_directory = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' , 'volatility3 ' ))
2525
2626 source_dir = os .path .abspath (os .path .dirname (__file__ ))
2727 sphinx .ext .apidoc .main (argv = ['-e' , '-M' , '-f' , '-T' , '-o' , source_dir , volatility_directory ])
2828
29- # Go through the volatility .framework.plugins files and change them to volatility .plugins
29+ # Go through the volatility3 .framework.plugins files and change them to volatility3 .plugins
3030 for dir , _ , files in os .walk (os .path .dirname (__file__ )):
3131 for filename in files :
32- if filename .startswith ('volatility .framework.plugins' ) and filename != 'volatility .framework.plugins.rst' :
33- # Change all volatility .framework.plugins to volatility .plugins in the file
32+ if filename .startswith ('volatility3 .framework.plugins' ) and filename != 'volatility3 .framework.plugins.rst' :
33+ # Change all volatility3 .framework.plugins to volatility3 .plugins in the file
3434 # Rename the file
35- new_filename = filename .replace ('volatility .framework.plugins' , 'volatility .plugins' )
35+ new_filename = filename .replace ('volatility3 .framework.plugins' , 'volatility3 .plugins' )
3636
3737 replace_string = b"Submodules\n ----------\n \n .. toctree::\n \n "
3838 submodules = replace_string
@@ -48,25 +48,25 @@ def setup(app):
4848 with open (os .path .join (dir , new_filename ), 'wb' ) as newfile :
4949 with open (os .path .join (dir , filename ), "rb" ) as oldfile :
5050 line = oldfile .read ()
51- correct_plugins = line .replace (b'volatility .framework.plugins' , b'volatility .plugins' )
51+ correct_plugins = line .replace (b'volatility3 .framework.plugins' , b'volatility3 .plugins' )
5252 correct_submodules = correct_plugins .replace (replace_string , submodules )
5353 newfile .write (correct_submodules )
5454 os .remove (os .path .join (dir , filename ))
55- elif filename == 'volatility .framework.rst' :
55+ elif filename == 'volatility3 .framework.rst' :
5656 with open (os .path .join (dir , filename ), "rb" ) as contents :
5757 lines = contents .readlines ()
5858 plugins_seen = False
5959 with open (os .path .join (dir , filename ), "wb" ) as contents :
6060 for line in lines :
61- if b'volatility .framework.plugins' in line :
61+ if b'volatility3 .framework.plugins' in line :
6262 plugins_seen = True
6363 if plugins_seen and line == b'' :
64- contents .write (b' volatility .plugins' )
64+ contents .write (b' volatility3 .plugins' )
6565 contents .write (line )
66- elif filename == 'volatility .plugins.rst' :
66+ elif filename == 'volatility3 .plugins.rst' :
6767 with open (os .path .join (dir , filename ), "rb" ) as contents :
6868 lines = contents .readlines ()
69- with open (os .path .join (dir , 'volatility .framework.plugins.rst' ), "rb" ) as contents :
69+ with open (os .path .join (dir , 'volatility3 .framework.plugins.rst' ), "rb" ) as contents :
7070 real_lines = contents .readlines ()
7171
7272 # Process real_lines
@@ -82,15 +82,15 @@ def setup(app):
8282 for line in lines :
8383 contents .write (line )
8484 for line in submodule_lines :
85- contents .write (line .replace (b'volatility .framework.plugins' , b'volatility .plugins' ))
85+ contents .write (line .replace (b'volatility3 .framework.plugins' , b'volatility3 .plugins' ))
8686
8787
8888# If extensions (or modules to document with autodoc) are in another directory,
8989# add these directories to sys.path here. If the directory is relative to the
9090# documentation root, use os.path.abspath to make it absolute, like shown here.
9191sys .path .insert (0 , os .path .abspath ('../..' ))
9292
93- from volatility .framework import constants
93+ from volatility3 .framework import constants
9494
9595# -- General configuration ------------------------------------------------
9696
0 commit comments