Closed busla closed 3 years ago
@busla thanks for the feedback! I appreciate you sharing an example for other's sake π. I am definitely interested in improving the documentation, if there is something you can think of that would have helped you? I have some information about expanding FakeDir
objects in these examples, but I could certainly add on.
I am not really familiar with SFTP, but I guess the issue is there is no equivalent to seedir.fakedir()
(for making a FakeDir
from a local directory). So it is a nice example.
Ahh, these examples are great! They demonstrate exactly what I was doing.
x.create_file(['__init__.py', 'main.py', 'styles.txt'])
x.create_folder('docs')
y = sd.FakeDir('resources', parent=x)
z = sd.FakeDir('images')
z.parent = y
The docs were really good in terms of rendering a tree from local files. Maybe just add the examples you referenced to the docs?
Regarding (s)ftp paths, they fit perfectly with seedir since they're just slash separated strings, .e.g. foo/bar/some/file.text
, so nothing out of the ordinary.
@busla gotcha! I had initially intended have this example Notebook for demonstrative purposes, and the docs for cataloging the tools available, but it would be an improvement to add examples into the docs (like here); will do so
Added more example code to the docstrings for 0.1.3.
Hey, great job!
Love the simplicity, clear documentation and a nice API ππΌ
Not sure how detailed examples you want to add to the README and the API docs but since I had to dig a bit in the code to figure out how to build a tree from path strings so I thought I'd share a snippet
When dealing with filesystem paths from strings, e.g. Paramiko SFTP tree, this might be useful. Mentioning Paramiko here for Google on purpose π
The snippet is part of a cli written with Typer and recursively iterates through a remote sftp tree and builds a FakeDir tree.