HoneyTian commited on
Commit
cca10a3
1 Parent(s): 1385879
Files changed (1) hide show
  1. main.py +7 -7
main.py CHANGED
@@ -10,7 +10,7 @@ from pathlib import Path
10
  import platform
11
  import time
12
  import tempfile
13
- # import uuid
14
 
15
  from project_settings import project_path, log_directory
16
  import log
@@ -104,16 +104,16 @@ def process(
104
  repo_id: Path = Path(repo_id)
105
  if len(repo_id.parts) == 1:
106
  repo_name = repo_id.parts[-1]
107
- # if len(repo_name) > 40:
108
- # repo_name = str(uuid.uuid4())
109
- repo_name = repo_name[:40]
110
  folder = repo_name
111
  elif len(repo_id.parts) == 2:
112
  repo_supplier = repo_id.parts[-2]
113
  repo_name = repo_id.parts[-1]
114
- # if len(repo_name) > 40:
115
- # repo_name = str(uuid.uuid4())
116
- repo_name = repo_name[:40]
117
  folder = "{}/{}".format(repo_supplier, repo_name)
118
  else:
119
  raise AssertionError("repo_id parts count invalid: {}".format(len(repo_id.parts)))
 
10
  import platform
11
  import time
12
  import tempfile
13
+ import uuid
14
 
15
  from project_settings import project_path, log_directory
16
  import log
 
104
  repo_id: Path = Path(repo_id)
105
  if len(repo_id.parts) == 1:
106
  repo_name = repo_id.parts[-1]
107
+ if len(repo_name) > 40:
108
+ repo_name = str(uuid.uuid4())
109
+ # repo_name = repo_name[:40]
110
  folder = repo_name
111
  elif len(repo_id.parts) == 2:
112
  repo_supplier = repo_id.parts[-2]
113
  repo_name = repo_id.parts[-1]
114
+ if len(repo_name) > 40:
115
+ repo_name = str(uuid.uuid4())
116
+ # repo_name = repo_name[:40]
117
  folder = "{}/{}".format(repo_supplier, repo_name)
118
  else:
119
  raise AssertionError("repo_id parts count invalid: {}".format(len(repo_id.parts)))