interscript:developers needed to take over project

Discussion in 'Python' started by John Max Skaller, Sep 11, 2003.

  1. please reply to
    (I don't read this newsgroup, and the reply-to address is fake)

    For some time now -- over 5 years -- I have been using the
    interscript literate programming and document generation tool

    http://interscript.sourceforge.net

    for all my programming tasks, both commercial and personal.

    I no longer have time to do more than cursorary maintenance
    on this project, and I'm looking for some developers to take it over.
    This program is written entirely in Python.
    If you're interested please mail me.

    WHAT IT DOES.
    -------------

    Interscript allows you to package several program files in
    a single file, for example C header and implementation files.
    You can also include documentation. The basic operation
    is called tangling, which just extracts the program files,
    whilst the advanced operation is called weaving, which typesets
    all the documentation .. including a full listing of the program
    sources.

    Interscript is unique in that the typesetting and extraction
    commands are arbitrary Python scripts. It can therefore be used
    to generate both code and documentation. You can view an interscript
    source as a Python program with very long embedded strings
    that's used to print out program and documentation files.

    Interscript has dedicated tanglers for typesetting Python and
    a number of other languages (including C, C++, Java, Perl ..).
    Tanglers are plug-and-play .. you can make new ones by just dropping
    a file into the right directory.

    It also has plug-and-play weavers for plain text, LaTeX2e, flat HTML, and
    a cross linked HTML multipage web. All formats can be generated
    simultaneously, and in addition for any set of native languages.

    I personally make good use of the facilities to integrate
    test suites with source codes, as well as embedding all
    make scripts in interscript, usually as Python script.
    [Make sucks .. Python is better :]

    The basic packaging feature is that you can distribute complex
    program sources as a small number of plain text files, and then
    extract sources, build directories, run tests, etc, all with
    a uniform distribution format. Yes I know Python has distutils,
    but this system is language and platform independent -- its for
    C and C++ codes as well as Python (for example).

    The central core of this system has been executed millions
    of times without problem. In addition I recently made a few mods
    so it now works with the psyco accelerator. There are a couple of bugs
    in the dependency checker, but the major work now required is:

    * upgraded support for syntax colouring non-python codes
    * upgraded widget/format controls (it does simple
    tables, but can't include pictures ..)
    * rewrite of the codes to be more efficient and more modern
    * a comprehensible manual
    * anything else you want

    In addition, with a little design, the weaver and tangler modules
    could become part of the standard Python distribution, as general
    purpose typesetting components (with a common interface ..).

    The whole program is built as a Python package with a 10 line
    program harness to call the main subroutine.
     
    John Max Skaller, Sep 11, 2003
    #1
    1. Advertising

  2. John Max Skaller

    Tim Guest

    Parsing python file by statement in python

    Hi,

    Been looking around for any pointers to this but although mentioned in a
    few places, can't see any answers (python.org, Vaults of Parnassus,
    Google etc).

    What i'd like to be able to do is parse a file statement block by
    statement block, rather than line by line. The files I usually see have
    a large number of not very deep conditional blocks, and a (potentially)
    huge number of single (possibly broken over numerous lines) statements.

    Is there some way to parse these into a number of /top level statement
    blocks/ to then execute..

    eg.

    foo()
    bar()

    if var :
    quux()
    if not other var :
    wibble()
    malarky()

    egg()
    if egg : chicken()

    becomes (top level block statements numbered)

    /---- 1
    foo()
    /---- 2
    bar()
    /---- 3
    if var :
    quux()
    if not other var :
    wibble()
    malarky()
    /---- 4
    egg()
    /---- 5
    if egg : chicken()
    /---- end

    don't really want to compile the statement until have a top level block
    - have seen some scripts that do incremental command_compiles() on
    readlines until they get back non-None but these obviously balls up on
    statements like

    for i in range(n) :
    foo(i)
    bar(i)

    Could use eg. the paser module and a bunch of logic, but just thought
    someone, somewhere might have down this before ?

    Hope some of this makes sense and I haven't missed some bleedin obvious
    link..

    Cheers
    Tim
     
    Tim, Sep 11, 2003
    #2
    1. Advertising

  3. John Max Skaller

    Duncan Booth Guest

    Re: Parsing python file by statement in python

    Tim <> wrote in news::

    > don't really want to compile the statement until have a top level block
    > - have seen some scripts that do incremental command_compiles() on
    > readlines until they get back non-None but these obviously balls up on
    > statements like
    >
    > for i in range(n) :
    > foo(i)
    > bar(i)


    code.compile_command handles this like the interactive interpreter, the
    trick is to make sure you have newlines separating the lines, but no
    trailing newline. This simulates the interactive thing of needing a blank
    line to terminate the block.

    >>> import code
    >>> code.compile_command("x=3")

    <code object ? at 00917340, file "<input>", line 1>
    >>> code.compile_command("for i in range(n):")
    >>> code.compile_command("for i in range(n):\n foo(i)")
    >>> code.compile_command("for i in range(n):\n foo(i)\n bar(i)")
    >>> code.compile_command("for i in range(n):\n foo(i)\n bar(i)\n")

    <code object ? at 00927FF0, file "<input>", line 1>
    >>>


    --
    Duncan Booth
    int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
    "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
     
    Duncan Booth, Sep 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    433
    The Abrasive Sponge
    Jan 2, 2005
  2. Replies:
    0
    Views:
    625
  3. nokidding
    Replies:
    7
    Views:
    554
    Andy Dingley
    Jan 24, 2008
  4. Steve Ferg
    Replies:
    10
    Views:
    592
    Steve Ferg
    May 20, 2009
  5. Isaac
    Replies:
    0
    Views:
    592
    Isaac
    Oct 22, 2010
Loading...

Share This Page