-
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.
- Loading branch information
1 parent
3e028b9
commit 11b4092
Showing
1 changed file
with
29 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ============================================================================= | ||
# >> IMPORTS | ||
# ============================================================================= | ||
# Source.Python Imports | ||
from listeners.tick import GameThread | ||
from listeners import OnLevelInit | ||
|
||
# Core Imports | ||
import os | ||
|
||
# 3rd Party Imports | ||
pass | ||
|
||
TF_ROOT = "/home/tf/tf/" | ||
|
||
@OnLevelInit | ||
def on_level_init(name): | ||
global TF_ROOT | ||
for file_name in os.listdir(TF_ROOT): | ||
if file_name.endswith(".dem"): | ||
demo_info = file_name.split("-") | ||
map_name = demo_info[3] | ||
|
||
if not name == map_name: | ||
src = os.path.join(TF_ROOT, file_name) | ||
dest = os.path.join(TF_ROOT, "demos_finished", file_name) | ||
print(f"Moving {src} to {dest}") | ||
|
||
os.rename(src, dest) |