'Hi ! I have create a small python application for create LMMS projects package :
→ List all files from project
→ Compact all imported files into ZIP file (in data directory)
→ Update all import directory from projects
Usage : lmmspackager.py project.mmp [projectoutput.zip]
→ List all files from project
→ Compact all imported files into ZIP file (in data directory)
→ Update all import directory from projects
Usage : lmmspackager.py project.mmp [projectoutput.zip]
[code]
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import xml.etree.ElementTree as ET
import os
import zipfile
import sys
print("""LazyOne Software LMMS Project Packager
Code is under GPLV3 license. \
\
""")
if len(sys.argv) < 2:
print("""
USAGE : %s <project File Name (mmp file)> <output zip file>
""" % sys.argv[0])
sys.exit(1)
filein = sys.argv[1]
if len(sys.argv) < 3:
fileout = os.path.basename("".join(filein.split(".")[:-1])) + ".zip"
else:
fileout = sys.argv[2]
if not os.path.isfile(filein):
print("File not found : %s" % (filein))
sys.exit(2)
zipout = zipfile.ZipFile(fileout, "w")
print("Packaging LMMS Project. Please wait ...\
")
print("[INFO] Opening project source ...")
filehandler = open(filein, "r")
dataread = "".join(filehandler.readlines())
filehandler.close()
tree = ET.fromstring(dataread)
#root = tree.getroot()
compressed = list()
notfound = 0
for e in tree.findall("./
