-
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
Use a URI library for parsing filenames and paths #3
Comments
@jacobpennington How familiar are you with the URI system Ivar set up? I'm having difficulty saving/loading files to my local filesystem because the URI is a bit brittle. Any chance we can integrate a real URI handling library that's a bit smarter about local paths? |
That makes sense to me.
Stephen
…On Mar 16, 2018 4:40 PM, "Brad Buran" ***@***.***> wrote:
@jacobpennington <https://github.com/jacobpennington> How familiar are
you with the URI system Ivar set up? I'm having difficulty saving/loading
files to my local filesystem because the URI is a bit brittle. Any chance
we can integrate a real URI handling library that's a bit smarter about
local paths?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<LBHB/NEMS#3 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH_8p4PBi3LokGWOxAqYEppbv_UhmJUTks5tfD9MgaJpZM4SsmQr>
.
|
@bburan Not very familiar - it was all set up pretty quickly in his last week as far as I know. I've used save_resource and load_resource a bit and hooked them up to nems_web, and fixed a couple bugs, but that's about it. Happy to add the URI lib stuff to my todo list though. |
@bburan Used the 'uri' library some today and i'm not really sure how to get it to handle '~/...' style paths - it seems to just ignore the ~ altogether. Same with the various os.path and urllib.parse methods. So I'll go ahead and start incorporating it since it helps fix issues like having too many slashes in the wrong place, but I'll probably need some input from you to get ~/ paths supported. Could have the relevant methods replace any leading ~ with os.environ['HOME'] in the meantime, but i'm not sure if that's the right approach. |
The OS doesn't know how to handle ~, it's expanded by bash. If you have path-strings like this you should run them through |
WEB_API option is now implemented, so that data can now be read in and saved via an http server running on nems_baphy. Crummy name, but basically it substitutes NEMS_RESULTS_DIR and NEMS_RECORDINGS_DIR with http://NEMS_BAPHY_API_HOST:/NEMS_BAPHY_API_PORT |
I tried to load a recording using my relative path (e.g.,
~/downloads/TAR010c-18-1.targz
) but this didn't work since we aren't properly handling URIs. There are already URI libraries out there that can validate URI strings (both local filesystem and protocol-based such as http). See https://pypi.python.org/pypi/uri/2.0.0 for example. We should probably switch to one of these.The text was updated successfully, but these errors were encountered: