Exemplo n.º 1
0
 def setUp(self):
     self.web = pyweb.Web("Test")
     self.chunk = pyweb.Chunk()
     self.chunk.appendText("some text")
     self.chunk.webAdd(self.web)
     self.out = pyweb.OutputChunk("A File")
     self.out.appendText("some code")
     nm = self.web.addDefName("A Chunk")
     self.out.append(pyweb.ReferenceCommand(nm))
     self.out.webAdd(self.web)
     self.named = pyweb.NamedChunk("A Chunk...")
     self.named.appendText("some user2a code")
     self.named.setUserIDRefs("user1")
     nm = self.web.addDefName("Another Chunk")
     self.named.append(pyweb.ReferenceCommand(nm))
     self.named.webAdd(self.web)
     self.named2 = pyweb.NamedChunk("Another Chunk...")
     self.named2.appendText("some user1 code")
     self.named2.setUserIDRefs("user2a user2b")
     self.named2.webAdd(self.web)
Exemplo n.º 2
0
#!/usr/bin/env python3
"""Sample tangle.py script."""
import pyweb
import logging
import argparse

with pyweb.Logger(pyweb.log_config):
    logger = logging.getLogger(__file__)

    options = argparse.Namespace(
        webFileName="pyweb.w",
        verbosity=logging.INFO,
        command='@',
        permitList=['@i'],
        tangler_line_numbers=False,
        reference_style=pyweb.SimpleReference(),
        theTangler=pyweb.TanglerMake(),
        webReader=pyweb.WebReader(),
    )

    w = pyweb.Web()

    for action in LoadAction(), TangleAction():
        action.web = w
        action.options = options
        action()
        logger.info(action.summary())
Exemplo n.º 3
0
 def setUp(self):
     self.web = pyweb.Web("Test")
Exemplo n.º 4
0
 def setUp(self):
     source = StringIO.StringIO(self.text)
     self.web = pyweb.Web(self.file_name)
     self.rdr = pyweb.WebReader()
     self.rdr.source(self.file_name, source).web(self.web)
     self.rdr.load()