From 2e5af657abac76f03472808235552939ef1a57af Mon Sep 17 00:00:00 2001 From: rodrigomelo9 Date: Sat, 29 Jun 2024 18:25:57 +0000 Subject: [PATCH] deploy: 47cb94286a5f6189ddcf71d876cdeb41e9fd3371 --- _modules/pyfpga/project.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_modules/pyfpga/project.html b/_modules/pyfpga/project.html index 027b16d8..2b18610d 100644 --- a/_modules/pyfpga/project.html +++ b/_modules/pyfpga/project.html @@ -342,7 +342,7 @@

Source code for pyfpga.project

             message = steps[first]
         self.logger.info('Running %s', message)
         selected = [step.upper() for step in keys[index[0]:index[1]+1]]
-        self._run(self._make_prepare(selected))
+ self._run(self._make_prepare(selected), 'make.log')
@@ -361,7 +361,7 @@

Source code for pyfpga.project

         if position not in range(1, 9):
             raise ValueError('Invalid position.')
         self.logger.info('Programming')
-        self._run(self._prog_prepare(bitstream, position))
+ self._run(self._prog_prepare(bitstream, position), 'prog.log')
def _make_prepare(self, steps): @@ -382,7 +382,7 @@

Source code for pyfpga.project

         with open(directory / filename, 'w', encoding='utf-8') as file:
             file.write(content)
 
-    def _run(self, command):
+    def _run(self, command, logname):
         num = 20
         error = 0
         old_dir = Path.cwd()
@@ -390,13 +390,13 @@ 

Source code for pyfpga.project

         start = time()
         try:
             os.chdir(new_dir)
-            with open('run.log', 'w', encoding='utf-8') as file:
+            with open(logname, 'w', encoding='utf-8') as file:
                 subprocess.run(
                     command, shell=True, check=True, text=True,
                     stdout=file, stderr=subprocess.STDOUT
                 )
         except subprocess.CalledProcessError:
-            with open('run.log', 'r', encoding='utf-8') as file:
+            with open(logname, 'r', encoding='utf-8') as file:
                 lines = file.readlines()
                 last_lines = lines[-num:] if len(lines) >= num else lines
                 for line in last_lines: