-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
When attempting to load a non-existent file using MCSchematic, as shown below, MCSchematic does not raise an exception, or warn the user in any other way that they are doing somthing wrong.
schem = mcschematic.MCScematic("/non/existing/file.schem")Looking into the source, it seems this is an intended feature, as there are if statements checking for file existence.
mcschematic.py:2371
if type(schematicToLoadPath_or_mcStructure) == str:
schematicToLoadPath = schematicToLoadPath_or_mcStructure
if not os.path.isfile(schematicToLoadPath):
self._defaultInit(); return
if not schematicToLoadPath.endswith(".schem"):
self._defaultInit(); return
self._initFromFile(schematicToLoadPath)This is extremly user-unfriendly because if you mess up the filepath you're loading, the user isn't informed that they've messed something up. I had a situation where I wanted to load a schematic, modify it, and write it back, and I wasted a ton of time looking for the blocks of the existing schematic and seeing nothing but air.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels