@@ -36,6 +36,7 @@ def __init__(
3636 self .readme_url = "https://raw.githubusercontent.com/egeakman/python-docs-bootstrapper/master/bootstrapper/data/README.md"
3737 self .gitignore_url = "https://raw.githubusercontent.com/egeakman/python-docs-bootstrapper/master/bootstrapper/data/.gitignore"
3838 self .makefile_url = "https://raw.githubusercontent.com/egeakman/python-docs-bootstrapper/master/bootstrapper/data/Makefile"
39+ self .data_dir = f"{ os .path .dirname (__file__ )} /../python-docs-bootstrapper-data"
3940
4041 def _request (self , url : str ) -> str :
4142 with urllib .request .urlopen (url ) as response :
@@ -126,9 +127,7 @@ def create_readme(self) -> None:
126127 self .logger .warning (
127128 "\n ⚠️ Failed to fetch README.md from GitHub, using local copy..."
128129 )
129- readme = Path (f"{ os .path .dirname (__file__ )} /data/README.md" ).read_text (
130- encoding = "utf-8"
131- )
130+ readme = Path (f"{ self .data_dir } /README.md" ).read_text (encoding = "utf-8" )
132131 readme = readme .replace ("{{translation.language}}" , self .language )
133132 with open (f"{ self .translation_repo } /README.md" , "w" , encoding = "utf-8" ) as f :
134133 f .write (readme )
@@ -142,9 +141,7 @@ def create_gitignore(self) -> None:
142141 self .logger .warning (
143142 "\n ⚠️ Failed to fetch .gitignore from GitHub, using local copy..."
144143 )
145- gitignore = Path (f"{ os .path .dirname (__file__ )} /data/.gitignore" ).read_text (
146- encoding = "utf-8"
147- )
144+ gitignore = Path (f"{ self .data_dir } /.gitignore" ).read_text (encoding = "utf-8" )
148145 with open (f"{ self .translation_repo } /.gitignore" , "w" , encoding = "utf-8" ) as f :
149146 f .write (gitignore )
150147 self .logger .info ("✅\n " )
@@ -157,9 +154,7 @@ def create_makefile(self) -> None:
157154 self .logger .warning (
158155 "\n ⚠️ Failed to fetch Makefile from GitHub, using local copy..."
159156 )
160- makefile = Path (f"{ os .path .dirname (__file__ )} /data/Makefile" ).read_text (
161- encoding = "utf-8"
162- )
157+ makefile = Path (f"{ self .data_dir } /Makefile" ).read_text (encoding = "utf-8" )
163158 head = (
164159 subprocess .run (
165160 ["git" , "-C" , self .cpython_repo , "rev-parse" , "HEAD" ],
0 commit comments