sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.16k stars 216 forks source link

pyutil: smc-share #537

Open haraldschilly opened 8 years ago

haraldschilly commented 8 years ago

create an smc-share command, based on the ideas of Stuart Prescott

can we get some sort of tool so that I can:

$ jupyter-nbconvert --to html tutorial.ipynb 
$ smc-share add tutorial.ipynb 
$ smc-share add tutorial.html

I could envisage a tool that could:

smc-share [ add | remove | list ] [ --description "some description" ] [ filename | directoryname ] ...

The "list" sub-command could be able to list the shared resources by filename, directory or project according to what it is told. Later, the "add" sub-command could take additional options like "--public" for whether it should be publicly indexed. [...]

haraldschilly commented 8 years ago

To implement this, this utility would be part of the pyutils collection:

https://github.com/sagemathinc/smc/tree/master/src/smc_pyutil

and communicate with the local hub. I'm not sure how to actually accomplish this, though. Hmm ...

williamstein commented 8 years ago

On Sat, May 7, 2016 at 2:24 AM, Harald Schilly notifications@github.com wrote:

To implement this, this utility would be part of the pyutils collection:

https://github.com/sagemathinc/smc/tree/master/src/smc_pyutil

and communicate with the local hub. I'm not sure how to actually accomplish this, though. Hmm ...

When I rewrote the sync stuff I made it so projects can write to database tables in the same way as web browser clients (though with different permissions, of course). So there's that. However, to get the command line to tell the local_hub to do something -- I'm not sure yet. I think the natural unix thing to do would be for the local_hub to create a named pipe (maybe in ~/.smc) and control message could then be sent from the terminal or anything that can write there, and the local hub would then respond and do things, e.g., write to database.

Note that the local hub can only write to the database if some hub has connected to it -- it can't connect out.

William

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/sagemathinc/smc/issues/537#issuecomment-217622284

William (http://wstein.org)

williamstein commented 8 years ago

If this is used from the terminal, it could work just like the open command. That would make this almost trivial to implement.

williamstein commented 5 years ago

This has got a lot easier to implement over the years :-)