Skip to content
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

Files add accepts unused filename filter #49

Closed
whereswaldon opened this issue Aug 3, 2016 · 3 comments
Closed

Files add accepts unused filename filter #49

whereswaldon opened this issue Aug 3, 2016 · 3 comments

Comments

@whereswaldon
Copy link
Contributor

The recursive add functionality does not currently use the filter that it accepts to check the names of files. This should be implemented.

@whereswaldon
Copy link
Contributor Author

Compared to some other problems within the repo, this doesn't seem like a huge priority. I looked at what it might take to implement this, but I'm not going to try to do it just yet.

Implementation notes: This needs to be addressed on several levels:

  • ipfsApi.multipart.DirectoryStream._prepare has access to the fnpattern because it's a property of the DirectoryStream object. However, it doesn't do anything with this.
  • ipfsApi.commands.FileCommand.request does not accept an fnpattern explicitly, though ipfsApi.commands.FileCommand.directory does accept a match pattern that will be passed to the DirectoryStream (see above). Since FileCommand.request dispatches either FileCommand.files or FileCommand.directory based upon whether the add path is a directory, it needs to pass the pattern when it invokes FileCommand.directory, but not FileCommand.files (otherwise the request library gets angry about an unexpected keyword argument).
  • The ipfsApi.client.add function needs to accept a pattern (optionally) that is propagated down to the DirectoryStream if a directory is being added. Otherwise, it need not propagate it.

I'd welcome thoughts about a better approach to implementing this, as well as questions if my notes above don't make sense.

@heaven00
Copy link
Contributor

heaven00 commented Oct 3, 2016

@whereswaldon close this ?

@ntninja
Copy link
Contributor

ntninja commented Oct 3, 2016

Yes, this has been fixed thanks to you 😃

@ntninja ntninja closed this as completed Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants