Excluded pycache from example inclusions

This commit is contained in:
Mark Qvist 2023-02-04 19:06:16 +01:00
parent 6aca6d671a
commit f4e3f1cb46

View file

@ -170,10 +170,9 @@ class NomadNetworkApp:
else: else:
if not os.path.isdir(self.examplespath): if not os.path.isdir(self.examplespath):
try: try:
os.makedirs(self.examplespath) import shutil
from distutils.dir_util import copy_tree
examplespath = os.path.join(os.path.dirname(__file__), "examples") examplespath = os.path.join(os.path.dirname(__file__), "examples")
copy_tree(examplespath, self.examplespath) shutil.copytree(examplespath, self.examplespath, ignore=shutil.ignore_patterns("__pycache__"))
except Exception as e: except Exception as e:
RNS.log("Could not copy examples into the "+self.examplespath+" directory.", RNS.LOG_ERROR) RNS.log("Could not copy examples into the "+self.examplespath+" directory.", RNS.LOG_ERROR)