|
15 | 15 | from os import system |
16 | 16 |
|
17 | 17 | __author__ = "help@castellanidavide.it" |
18 | | -__version__ = "08.01 2021-04-15" |
| 18 | +__version__ = "08.03 2021-04-24" |
19 | 19 |
|
20 | 20 | class createstructure: |
21 | 21 | def __init__ (self, token=None, organization_name="", IGNORE=[], verbose=False, template=False, answers=None): |
@@ -238,17 +238,17 @@ def scan_and_elaborate(self, loc=""): |
238 | 238 | contents = self.template.get_contents(f"{loc}") |
239 | 239 | for content_file in sorted(contents, reverse=True, key=createstructure.name_of_path): # Put .folders at the end |
240 | 240 | if not content_file.path in [".createstructure", ""] + self.IGNORE: |
241 | | - if content_file.path == ".github/workflows": # Wait the end of others before do workflows |
242 | | - start_waiting = dt.now().timestamp() |
243 | | - while (active_count() != 2 and dt.now().timestamp() - start_waiting < 60): pass # Wait the end of processes or 60 seconds (a minute) |
| 241 | + if content_file.path == ".github/workflows": # Wait the end of all others before push workflows folder |
| 242 | + while active_count() != 2: |
| 243 | + pass |
244 | 244 |
|
245 | 245 | if content_file.type == "file": |
246 | 246 | try: |
247 | 247 | Thread(target = self.create_file, args = (self.change(content_file.path), self.change(self.g.get_repo(self.template_name).get_contents(content_file.path).decoded_content.decode()))).start() |
248 | 248 | except: # If it's not a text file (eg. is an image) |
249 | 249 | Thread(target = self.create_file, args = (self.change(content_file.path), self.g.get_repo(self.template_name).get_contents(content_file.path).decoded_content)).start() |
250 | 250 | else: |
251 | | - Thread(target = self.scan_and_elaborate, args = (content_file.path, )).start() |
| 251 | + Thread(target = self.scan_and_elaborate, args = (content_file.path, )).start() |
252 | 252 |
|
253 | 253 | def name_of_path(item): |
254 | 254 | """For sorting the folders, gives the path attributes |
|
0 commit comments