X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fdata.py;h=c4848be27c1cfd42c6f38c9af4f4d5645598768c;hp=2e22c7e0e2581e6c0350f6328aa3da7044e41c64;hb=275b3f156a8ceb0ec50e5651cbcb8415269c7dd4;hpb=0580d77ecba37ac032dde3e3d8d7b054ccc7fd74 diff --git a/mudpy/data.py b/mudpy/data.py index 2e22c7e..c4848be 100644 --- a/mudpy/data.py +++ b/mudpy/data.py @@ -144,7 +144,7 @@ class DataFile: for candidate in os.listdir(os.path.dirname(self.filename)): if re.match( os.path.basename(self.filename) + - """\.\d+$""", candidate + r"""\.\d+$""", candidate ): backups.append(int(candidate.split(".")[-1])) backups.sort() @@ -247,16 +247,18 @@ def find_file( "internal:storage", "").get("search_path", "") # another fallback root path, this time from the universe startdir - if not root_path and hasattr(universe, "startdir"): - root_path = universe.startdir + if hasattr(universe, "startdir"): + if not root_path: + root_path = universe.startdir + elif not os.path.isabs(root_path): + root_path = os.path.join(universe.startdir, root_path) # when no root path is specified, assume the current working directory if not root_path: root_path = os.getcwd() - # otherwise, make sure it's absolute - elif not os.path.isabs(root_path): - root_path = os.path.realpath(root_path) + # make sure it's absolute + root_path = os.path.realpath(root_path) # if there's no search path, just use the root path and etc if not search_path: