marquesafonso commited on
Commit
f6ee872
·
1 Parent(s): 2a6a104

fix archiver date padding. improve landing page html

Browse files
Files changed (2) hide show
  1. static/landing_page.html +1 -1
  2. utils/archiver.py +2 -2
static/landing_page.html CHANGED
@@ -111,7 +111,7 @@
111
  <body>
112
  <div class="container">
113
  <h1>Multilang-ASR-Captioner</h1>
114
- <p>A multilingual automatic speech recognition and video captioning CLI tool using faster whisper on cpu.</p>
115
  <a href="/submit_video" class="button submit">Submit Video</a>
116
  <a href="/docs" class="button docs">Documentation</a>
117
  </div>
 
111
  <body>
112
  <div class="container">
113
  <h1>Multilang-ASR-Captioner</h1>
114
+ <p>A multilingual automatic speech recognition and video captioning tool using faster whisper on cpu.</p>
115
  <a href="/submit_video" class="button submit">Submit Video</a>
116
  <a href="/docs" class="button docs">Documentation</a>
117
  </div>
utils/archiver.py CHANGED
@@ -2,14 +2,14 @@ import shutil, os
2
  from datetime import datetime
3
 
4
  def archiver(timestamp:datetime):
5
- ARCHIVE = os.path.abspath(f"archive/{timestamp.year:4d}-{timestamp.month:2d}-{timestamp.day:2d}/")
6
  TEMP_DIR = os.path.abspath("temp/")
7
  LOG_FILE = os.path.abspath("main.log")
8
  if os.path.exists(TEMP_DIR):
9
  shutil.make_archive(os.path.join(ARCHIVE, "files"), 'zip', TEMP_DIR)
10
  shutil.rmtree(TEMP_DIR)
11
  if os.path.exists(LOG_FILE):
12
- shutil.copy(LOG_FILE, os.path.join(ARCHIVE, f"{timestamp.year:4d}-{timestamp.month:2d}-{timestamp.day:2d}.log"))
13
  os.remove(LOG_FILE)
14
 
15
  if __name__ == '__main__':
 
2
  from datetime import datetime
3
 
4
  def archiver(timestamp:datetime):
5
+ ARCHIVE = os.path.abspath(f"archive/{timestamp.year:4d}-{timestamp.month:02d}-{timestamp.day:02d}/")
6
  TEMP_DIR = os.path.abspath("temp/")
7
  LOG_FILE = os.path.abspath("main.log")
8
  if os.path.exists(TEMP_DIR):
9
  shutil.make_archive(os.path.join(ARCHIVE, "files"), 'zip', TEMP_DIR)
10
  shutil.rmtree(TEMP_DIR)
11
  if os.path.exists(LOG_FILE):
12
+ shutil.copy(LOG_FILE, os.path.join(ARCHIVE, f"{timestamp.year:4d}-{timestamp.month:02d}-{timestamp.day:02d}.log"))
13
  os.remove(LOG_FILE)
14
 
15
  if __name__ == '__main__':