+ @staticmethod
+ def get_hubapp(static_file, hubapp):
+ h = static_file.hubapp
+ if hubapp == "root":
+ return h.root
+ elif isinstance(hubapp, str):
+ return h.root.hubapps[hubapp]
+ elif isinstance(hubapp, TreeFileApp):
+ return hubapp
+ return static_file.hubapp
+