thorwhalen / graze Goto Github PK
View Code? Open in Web Editor NEWCaching (a tiny part of) the internet
License: MIT License
Caching (a tiny part of) the internet
License: MIT License
This issue addresses the concern of where to put app/package data.
It resulted in the proposal of the
get_app_data_folder
function.
We should use this function to replace the ~/graze
with {app_data_folder}/graze
.
We need to figure out a good transition protocol too. For example, if the old folder exists, use that, but issue a warning telling the user they can move it to the new place to stop the warnings. Also let them know that the current package will then function as usual, but if they have anything else that depends on the old location, they should refactor there too.
Sometimes it can be useful to notify the user when content is being downloaded, since this can take some time, and we might not want to leave the user waiting, wondering what the wait is about.
Might as well abstract and generalize this immediately, including a preget
argument, which, when not None
, should be a function that will be called on the key before a url's content is downloaded from the internet (or whatever source[url]
says to do).
We should have the default be preget=None
to keep previous behavior the same.
Imagine you're grazing these, in that order:
https://github.com/thorwhalen
https://github.com/thorwhalen/graze # can't write here since thorwhalen is already a file and now needs to be a directory
https://github.com/thorwhalen/graze/issues # same issue
or in a different order:
https://github.com/thorwhalen/graze/issues
https://github.com/thorwhalen/graze # can't write to graze as a file since it's already a directory
https://github.com/thorwhalen # same problem
It's an actual puzzle, and I just went through the same "there's three incompatible requirements" thinking that this guy went through: https://www.w3.org/DesignIssues/HTTPFilenameMapping.html
Freakn annoying.
Simplest, cleanest map everything to something like
url -> root + url_with_out_http + "/content"
but then I loose the extension, for example:
http://www.audio.com/birds/coocoo.wav -> ~/graze/http/www.audio.com/birds/coocoo.wav/content
which is a shame, since .wav
could be read directly by different apps of the local system, but if we loose the extension, the apps can't function normally.
But then if you start trying to include the extension, it becomes quite convoluted.
For example, is .com
a file extension? No? So then we need to have a list of extensions to treat that way, and that list might change, so we have version problems etc.
We could:
https://github.com/thorwhalen
https://github.com/thorwhalen/graze # move thorwhalen to thorwhalen/_content only if and when we need thorwhalen to be a folder
https://github.com/thorwhalen/graze
https://github.com/thorwhalen # just write to thorwhalen/_content
But in this case, we have a url-to-localfile mapping that depends on time. Does that matter? Do we give several choices?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.