-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layers not initialised when loading existing opf #227
Comments
The description is a bit unclear... in the case you're looking at, are there existing layer files? If not, it seems quite normal that the layer object is empty |
I am passing an already created opf that is downloaded from Openpecha-Data to openpechaFS and it has layers.The main problem is that i need what type of layer exist in a particular opf. |
ok yes, then that seems like an issue, can you create a minimal working example demonstrating your bug? |
The function returns empty list even though the pecha has layers.
|
A minimal working example is an example that actually works if I test it but if I run your code nothing will happen. Please provide some code that I can run to reproduce the issue |
I have added the MRE in this repo.The main function gets the layer types of opf and then it updates a catalog. |
wonderful, thanks! |
I can't push code to your repo, but here's a from openpecha.core.pecha import OpenPechaFS
def get_opf_layers(opf_path):
opf = OpenPechaFS(opf_path)
layers = []
for base in opf.meta.bases:
layers = list(opf.get_layers(base))
return layers
if __name__ == "__main__":
pecha_id = "I4AEA9D55"
opf_path = "./I4AEA9D55/I4AEA9D55.opf"
print("opf has %d layers" % len(get_opf_layers(opf_path))) |
Is your feature request related to a problem? Please describe.
i am trying to get the layers from openpechaFS given a created opf Path to it,however the layers attribute is empty when accessing through the object.
Describe the solution you'd like
if the given path is already created,then the layers can be initialise.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
The text was updated successfully, but these errors were encountered: