-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete unnecessary files and update .gitignore
- Loading branch information
1 parent
0a9d44e
commit e442012
Showing
17 changed files
with
650 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/.quarto/ | ||
users.txt |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import shutil | ||
from pathlib import Path | ||
|
||
|
||
def create_user_folders() -> None: | ||
"""Creates user folders with module materials | ||
For all the names in the 'user.txt' file, creates a new folder in the user | ||
folder with the user's name. The modules folder is then copied across. If the | ||
users folder already exists, then no new folder is created or files / folders | ||
copied across. | ||
""" | ||
with open("users.txt", "r") as file: | ||
for line in file: | ||
username = line.strip() | ||
username = username.replace(" ", "_") | ||
folder_path = Path("users") / username | ||
if folder_path.exists(): | ||
print(f"The folder {folder_path} already exists.") | ||
else: | ||
folder_path.mkdir(parents=True) | ||
print(f"The folder {folder_path} has been created.") | ||
shutil.copytree( | ||
Path("modules"), folder_path, dirs_exist_ok=True | ||
) | ||
|
||
return | ||
|
||
|
||
if __name__ == "__main__": | ||
create_user_folders() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.