Another Python Server

190 views
Skip to first unread message

Nathan Warner

unread,
Sep 27, 2020, 4:54:08 PM9/27/20
to TiddlyWiki
Hi all, 

I wanted to share a new project I've been working on. It is a python server for hosting/saving tiddlywiki html files.  I started with the Ruby Server one, and the "Easy local saving with Python" thread and kind of expanded from there. 


Thanks
Nathan

Ste

unread,
Sep 28, 2020, 12:38:54 PM9/28/20
to TiddlyWiki
Excellent stuff! Even if I don't quite understand it :D Thanks for sharing. 

Atronoush Parsi

unread,
Sep 29, 2020, 1:22:27 AM9/29/20
to tiddl...@googlegroups.com
Nathan,
This is wonderful especially for Pythonists. Please ask Jeremy through GitHub to list this in the Tiddlywiki resources and perhaps on the first page on saving methods.
Also have a look in the forum as I know there are two other Python-TW Saver.

Atro

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a7b4cf9f-9483-4c52-b711-452a4b7b6d8fn%40googlegroups.com.

Jed Carty

unread,
Sep 29, 2020, 4:07:51 AM9/29/20
to TiddlyWiki
If you are interested, one saver that can use python on the back end is BobSaver, but I think that they have different goals.

BobSaver is a saver plugin and it has a server component that I wrote in different languages (Node, Python or Julia at the moment). https://ooktech-public.gitlab.io/bobsaver/

Atronoush Parsi

unread,
Sep 29, 2020, 8:03:07 AM9/29/20
to tiddl...@googlegroups.com
That is really great to hear. I did as follow

1. download empty.html from tiddlywiki.ocm
2. drag and drop $:/plugins/OokTech/BobSaver into new empty.html from https://ooktech-public.gitlab.io/bobsaver/
3. download https://ooktech-public.gitlab.io/bobsaver/#BobSaverServer.py and save in the same folder as empty.html 
4. start server as  python .\BobSaverServer.py 
5. create a new tiddler and click on save button

Nothing happened and I got the below error


# python .\BobSaverServer.py
Starting Server...
Server listening using port 61192 on 127.0.0.1
Open any single file wiki with the BobSaver plugin and it should save without anything else.
Edit the BobSaverServer.py file to set a saver key or change the port used.
If you have changed the settings you need to set them in the wiki(s) you want to save also.
Press ctrl+c to stop server.
127.0.0.1 - - [29/Sep/2020 15:27:07] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [29/Sep/2020 15:27:07] "OPTIONS /save HTTP/1.1" 501 -
127.0.0.1 - - [29/Sep/2020 15:27:53] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [29/Sep/2020 15:27:53] "OPTIONS /save HTTP/1.1" 501 -
127.0.0.1 - - [29/Sep/2020 15:28:33] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [29/Sep/2020 15:28:33] "OPTIONS /save HTTP/1.1" 501 -


OS: Windows 10
Python 3.8.5
Chrome 85

Jed Carty

unread,
Sep 29, 2020, 2:29:43 PM9/29/20
to TiddlyWiki
I just fixed an error with the python server, but the error was that it didn't sent the correct response on success, but that has nothing to do with the error you are seeing.
Nothing with the BobSaver sends any OPTIONS requests, do you have something else using port 61192? I don't know of any other way that would happen.

'Nothing happened' isn't descriptive enough to give any other feedback. You should have either gotten a message informing you that BobSaver wasn't working if it had been active and not working, or the download saver should have kicked in and downloaded a copy if BobSaver wasn't ever active.

I wrote up some guidelines about making bug reports https://ooktech-public.gitlab.io/guidelines/

Atronoush Parsi

unread,
Sep 29, 2020, 2:57:14 PM9/29/20
to tiddl...@googlegroups.com
Jed,
 I updated the plugin. I created a tiddler and tried to save the wiki an error window opened

Couldn't find a working server


in the terminal where I run server using python .\BobSaverServer.py

I got


Starting Server...                                                                            
Server listening using port 61192 on 127.0.0.1                                                
Open any single file wiki with the BobSaver plugin and it should save without anything else.  
Edit the BobSaverServer.py file to set a saver key or change the port used.                  
If you have changed the settings you need to set them in the wiki(s) you want to save also.  
Press ctrl+c to stop server.                                                                  
127.0.0.1 - - [29/Sep/2020 22:18:14] code 501, message Unsupported method ('OPTIONS')        
127.0.0.1 - - [29/Sep/2020 22:18:14] "OPTIONS /save HTTP/1.1" 501 -                          
127.0.0.1 - - [29/Sep/2020 22:19:19] code 501, message Unsupported method ('OPTIONS')        
127.0.0.1 - - [29/Sep/2020 22:19:19] "OPTIONS /save HTTP/1.1" 501 -                          
127.0.0.1 - - [29/Sep/2020 22:19:37] code 501, message Unsupported method ('OPTIONS')        
127.0.0.1 - - [29/Sep/2020 22:19:37] "OPTIONS /save HTTP/1.1" 501 -                          
127.0.0.1 - - [29/Sep/2020 22:20:03] code 501, message Unsupported method ('OPTIONS')        
127.0.0.1 - - [29/Sep/2020 22:20:03] "OPTIONS /save HTTP/1.1" 501 -                           


I changed the port to 9999 on both Bobserver plugin setting page and in  BobSaverServer.py and rerun the server
I got the same error in from wiki and server


7.0.0.1 - - [29/Sep/2020 22:25:02] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [29/Sep/2020 22:25:02] "OPTIONS /save HTTP/1.1" 501 -

Atro


Nathan Warner

unread,
Sep 29, 2020, 11:45:21 PM9/29/20
to TiddlyWiki
That's cool.  This project and mine seem to be doing a lot of the same stuff.  I was interested in having an easy to setup docker container for saving and backing up

FYI, I ran into one pretty big issue using HTTPServer.  On a slow network, uploading a tiddlywiki.html file can take a bit of time.  Unfortunately, doing this fast and often caused saving issues and corrupted my html file.  One quick fix is to verify the length of the body is the same as the length of the Content-Length header.  

Reply all
Reply to author
Forward
0 new messages