-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathanonymize.py
More file actions
28 lines (23 loc) · 850 Bytes
/
anonymize.py
File metadata and controls
28 lines (23 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import argparse
import findreplace
import os
from pathlib import PurePath
# Initialize the arguments, all are required
def init_args():
parser = argparse.ArgumentParser(
description="Imports a scene collection file, doing a find and replace for this working directory and anonymizing it",
usage=r'python import.py "C:\Users\My Name\Downloads\scenecollection.json"'
)
parser.add_argument("infile", help="Input file path")
return parser
def main():
# Init and parse args
parser = init_args()
args = parser.parse_args()
# Get the current directory path
dirPath = os.path.dirname(os.path.realpath(__file__))
outfile = os.path.join(dirPath, "AnonymizedSceneCollection.json")
findText = PurePath(dirPath).as_posix()
findreplace.doReplace(args.infile, outfile, findText, "REPLACE_ME")
if __name__ == "__main__":
main()