First real public release of Synoptic

Submitted by inducer on Sat, 19/04/2008 - 16:18

I’m happy to announce the first truly public release of Synoptic, my own web-based dynamic note taking application. If you find yourself lost in a jumble of either paper notes, text files on a hierarchical file system, or an overgrown Tomboy wiki, and find yourself craving order, categories, and simplicity, Synoptic may well be for you.

So go check it out! :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi Andreas -

Having not tried your code yet, I must say that the concept and execution look very enticing. And the reason I’ve not been able to try this — I can’t install synoptic! When I do easy_install synoptic, it downloads simplejason from the web but then seemingly fails to compile. I am on a Windows system with Python 2.5.2. This is the error I get:

C:\Python25\Scripts>python easy_install-2.5-script.py synoptic
<searches for synoptic online, finds it on pypi; 
<bunch of stuff>
***************************************************************************
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
I'm retrying the build without the C extension now.
***************************************************************************
error: Setup script exited with error: can't copy 'simplejson.egg-info\native_li
bs.txt': doesn't exist or not a regular file

-----------------------------------------------------

It creates a small synoptic file in the Scripts folder which when executed gives:
C:\Python25\Scripts>python synoptic
Traceback (most recent call last):
  File "synoptic", line 4, in <module>
    import pkg_resources
  File "c:\python25\lib\site-packages\setuptools-0.6c8-py2.5.egg\pkg_resources.p
y", line 2561, in <module>
  File "c:\python25\lib\site-packages\setuptools-0.6c8-py2.5.egg\pkg_resources.p
y", line 626, in require
  File "c:\python25\lib\site-packages\setuptools-0.6c8-py2.5.egg\pkg_resources.p
y", line 524, in resolve
pkg_resources.DistributionNotFound: SimpleJSON>=1.7

---------------

I think I’m almost there…what do I need to do to get SimpleJSON?

Thanks! Yogi

(edited for formatting —Andreas)

Apply this patch to SimpleJSON. Also, please pester SimpleJSON’s author (Bob Ippolito, bob ät redivi döt com) about finally applying this patch. :)

Andreas

Hey Andreas, same commenter as the whole WSGI thing below. Still using Synoptic, still working awesome. It’s become a handy external memory bank. I’ve taken to using for stuff I would normally stuff into a moinmoin wiki, because the hurdle is lower. The wiki’s still around for stuff that needs to be collaboratively edited or would benefit from having a template. It’s an awesome piece of work!

Hi. I was wondering if there’s any way of hyperlinking the notes? To have something wiki-like. Even from the code point of view, it could be added (by you or someone else) or simply is just not posible.

You may already know that you can link to search strings, simply by linking to #search. This is all I’ve been needing, so that’s all that’s implemented for now. (Plus, the version in git has a button that makes linking to you current view very easy.) That said, TiddlyWiki-style linking would not be difficult to implement.

Andreas

Hi Andreas. I didn’t notice the #search link, nice hint. I will also try the git version. thks for the quick reply and btw, it’s a nice piece of work indeed.

Dumb question — since I’m not a python programmer and I don’t understand WSGI.

If I’m using apache 2.2 and mod_wsgi, my understanding is that I need a WSGIScriptAlias directive. And it needs to point to a WSGI script file. And the WSGI script file needs to define a WSGI ‘application’ to be called.

If I just use ‘python setup.py install’ in the Synoptic build tree, I get /usr/bin/synoptic and the ‘real’ synoptic script in site-packages/synoptic-0.91.2-py2.4.egg/EGG-INFO/scripts.

But attempting to point the WSGIScriptAlias to either of these gets me this in the Apache error log:

mod_wsgi (pid=25988): Target WSGI script ‘/usr/lib/python2.4/site-packages/synoptic-0.91.2-py2.4.egg/EGG-INFO/scripts/synoptic’ does not contain WSGI application ‘application’.

So — what must I do to get a script that can be called WSGI-like?

I like this thing enough to make it available wherever possible. Thanks for whipping it up — it does exactly what it needs to do. I am so bloody tired of hierarchical notes.

Check the download page—0.91.3 contains doc/sample.wsgi, which is a script that you should be able to use as a starting point with mod_wsgi. You obviously need to customize the config variables at the top.

I’ve only tested this using Python Paste’s small builtin WSGI server, where it works fine. (Just run the script with python sample.wsgi)

Hope this helps. Andreas

I think this is the pertinent part of __init__.py:

def get_static_file(filename):
    from os.path import splitext, join, normpath

    import synoptic
    root_path = join(synoptic.__path__[0], "static")

So if we join something besides “static” (like “synoptic-static”) I can use an apache directive to get these requests to the right files on the filesystem.

(edited for formatting—Andreas)

Debugging hint: Comment out lines 112 and 113 in __init__.py:

except HTTPException, e:
    return e(environ, start_response)

Then you should get a meaningful traceback in your browser.

Well, there isn’t a traceback, since it’s not throwing any 500 errors, just 404 because Apache doesn’t understand where to get some of this stuff.

I couldn’t get it to request static files from Apache with paths other than www.foo.org/static, so I temporarily set up an alias — but it’s still got that app/ request in there:

GET /app/get_all_js

Which returns a 404. And I’m guessing this is an actual call to the python code. So no app just yet.

(I’m going to stick with this line of comments for now. Sorry about the diverging one below.)

OK, so, I also tried using mod_proxy and ProxyPass/ProxyPassReverse to just throw HTTP requests right to synoptic running with the built-in HTTP server. But the same problem exists: synoptic insists that static content and app and the other stuff which I see in __init__.py get requested using its own prefixes, /static/*, /app/* — thus, more 404s.

I guess I could just put synoptic at the root of a vh and let a proxy handle everything, but IMHO that’s ugly.

So consider this a feature request: there should be some way to prefix something to the HTTP requests that Synoptic uses, to get, for example, /synoptic/notes/synoptic.css, /synoptic/app/get_all_js, and so forth. If that makes sense.

Today seems to be your lucky day—I don’t know where I get all this motivation to work on stuff unrelated to my research. :P

0.91.4 now only uses relative paths, so running it in a subdirectory should be less painful. Please report back with stuff that I broke, if any. It still works fine in the root for me, so I hope I at least didn’t make anything worse.

Additionally, doc/sample.wsgi now has a config variable URL_PREFIX where you can tweak what the main handler expects as the first part of the URL. (defaults to “/”—this comes from the PATH_INFO variable in the WSGI request.)

It is my lucky day, and that seems to work perfectly — for me, even without the URL_PREFIX, since I think that’s taken care of as part of the WSGIScriptHandler. Thank you!

For reasons unclear to me, the “drag handle” image is broken, though it’s definitely in the egg directory under site-packages; Apache is serving up 404s.

I’ll give it a whirl and report back with anything weird I see.

Thanks again!

Hey Andreas, heavy use has not shown me any further issues. Thanks again for the wonderful software, I’ve been stuffing notes into it as fast as I can type. It’s really a godsend in technical meetings.

Hah, that worked! Excellent, I thank you. Except that it wants to GET some things from the static directory, which doesn’t work in the context of WSGI.

Hmm—can you post an error message, or exception traceback, or some such?

Really there are no errors to be seen. But the ‘synoptic’ page is loaded as if none of the stuff in static exists, so you only get some garbage and a search box. And in the apache access log:

“GET /app/get_all_js HTTP/1.1” 404 290 “https://www.foo.org/n/” “Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5) Gecko/2008041514 Firefox/3.0b5”

So changing __init__.py’s ‘static’ path-creation statement doesn’t seem to alter where the requests for static stuff goes — but then again, I don’t know python, so…

I’m wondering if it might make more sense just to use http_proxy and let the python web server run.

What a ugly ui

Thanks for your feedback. Can you suggest a way to improve?

Hi. Thanks for contributing this software. But i have a problem. How can I run the software. I have python 2.5.2 and I have installed all dependencies. I import synoptic but nothing happens. Please help me as soon as possible.

Thanks in advanced. Farsheed Ashouri, ceo@rodmena.com

You can start synoptic using

$ synoptic my_new_database_file.db

(i.e. a script by the name of “synoptic” should have been tossed in your path).

HTH, Andreas

Post new comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>.
  • You can use Markdown syntax to format and style the text. Also see and Markdown Extra for tables, footnotes, and more.

More information about formatting options