Skip to content

Template Gen Branch Parity (TODO) #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: template-gen
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ dmypy.json
*.png
*.blend1
*.avi
actions-runner/**
22 changes: 22 additions & 0 deletions scripts/compare_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import filecmp
import yaml
import json

config = {}
sandbox_header_dir = 'sandbox/'

with open ('template_files.yaml', 'r') as template_files:
config['template_files'] = yaml.load(template_files)

for file in config['template_files']:
if 'blend' in file:
continue

print('checking for differences in {}{}'.format(sandbox_header_dir, file))
areEqual = filecmp.cmp(file, '{}{}'.format(sandbox_header_dir, file))
if areEqual:
print(' -- good')
else:
print(' -- not equal')


24 changes: 24 additions & 0 deletions scripts/generate_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import yaml
import json
import os
import shutil

config = {}
sandbox_header_dir = 'sandbox/'

with open ('template_files.yaml', 'r') as template_files:
config['template_files'] = yaml.load(template_files)

print(json.dumps(config, indent=3))

print('refreshing sandbox/')
shutil.rmtree(sandbox_header_dir)
os.mkdir(sandbox_header_dir)
os.mkdir(sandbox_header_dir + 'blender/')
os.mkdir(sandbox_header_dir + 'scripts/')
os.mkdir(sandbox_header_dir + 'logs/')

for file in config['template_files']:
shutil.copy(file, '{}{}'.format(sandbox_header_dir, file))
print('file created in sandbox: {}{}'.format(sandbox_header_dir, file))

4 changes: 4 additions & 0 deletions template_files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Makefile
- blender/scene.blend
- scripts/render.py
- config.yaml