Hello
I'm planning to optimize var packages for performance reasons also for saving hard drive space & speed up loading.
1st I'm trying to find out what's the most referenced package so I can set my priorities based on that.
I have wrote a Python script that scans directory of your VARs, (with refs) and EXPORT LIST OF DEPENDECIES into TXT file for futher analysys.
If you want to test it youself.. grab it here:
I'm planning to optimize var packages for performance reasons also for saving hard drive space & speed up loading.
1st I'm trying to find out what's the most referenced package so I can set my priorities based on that.
I have wrote a Python script that scans directory of your VARs, (with refs) and EXPORT LIST OF DEPENDECIES into TXT file for futher analysys.
If you want to test it youself.. grab it here:
Python:
#!/bin/python3
import json
import os
import zipfile
import zipfile
import json
metaFilename='meta.json'
outputFileName='debuglist.txt'
print('Enter pull path to source directory of VARs, without trailing slash')
print('Scan include subdirectories.')
print('i.e: d:/mygame/assetsvars')
scanPath = input("FullPath to vars:")
of = open(outputFileName, 'a+')
varfiles = []
for root, dirs, files in os.walk(scanPath):
for file in files:
if file.endswith(".var"):
varfiles.append(root+'\\'+file)
for varfile in varfiles:
with zipfile.ZipFile(varfile, 'r') as zip_ref:
zip_ref.extract(metaFilename)
with open(metaFilename,'r') as file:
jsondata = {}
try:
jsondata = json.loads(file.read())
except:
print('error parsing json:'+varfile+"\n")
else:
for i in jsondata['dependencies']:
of.write(i+"\n")
of.close()
os.remove(metaFilename)