Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2935)  |  Call(160)  |  Derive(2007)  |  Import(768)

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/SampleTemplateComponent.py   kamaelia(Download)
 
"""
from Axon.Component import component, scheduler
class CallbackStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
class StandardStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
   #Outboxes=["outbox","signal"] List of outbox names if different
   #Usescomponents=[] # List of classes used.
   def __init__(self,label,looptimes):

src/k/a/kamaelia-HEAD/Code/Python/Kamaelia/Kamaelia/SampleTemplateComponent.py   kamaelia(Download)
 
"""
from Axon.Component import component, scheduler
class CallbackStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
class StandardStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
   #Outboxes=["outbox","signal"] List of outbox names if different
   #Usescomponents=[] # List of classes used.
   def __init__(self,label,looptimes):

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Contrib/Kamaelia.Apps.SA/TTL.py   kamaelia(Download)
class WellBehaved1(Axon.Component.component):
    def main(self):
        t = time.time()
        while not self.dataReady("control"):
            if time.time() - t>0.3:
class WellBehaved2(Axon.Component.component):
    Inboxes = {
        "inbox"   : "Foo Bar",
        "control" : "Foo Bar",
    }
class WellBehaved3(Axon.Component.component):
    Inboxes = [ "inbox", "control" ]
    Outboxes = [ "outbox", "signal" ]
    def main(self):
        t = time.time()
class WellBehaved4(Axon.Component.component):
    Inboxes = [ "inbox", "control" ]
    Outboxes = {
        "outbox" : "Foo Bar",
        "signal" : "Foo Bar",
class BadlyBehaved1(Axon.Component.component):
    Inboxes = [ ]
    Outboxes = [ ]
    def main(self):
        t = time.time()

src/k/a/kamaelia-HEAD/Code/Python/Kamaelia/Examples/Contrib/Kamaelia.Apps.SA/TTL.py   kamaelia(Download)
class WellBehaved1(Axon.Component.component):
    def main(self):
        t = time.time()
        while not self.dataReady("control"):
            if time.time() - t>0.3:
class WellBehaved2(Axon.Component.component):
    Inboxes = {
        "inbox"   : "Foo Bar",
        "control" : "Foo Bar",
    }
class WellBehaved3(Axon.Component.component):
    Inboxes = [ "inbox", "control" ]
    Outboxes = [ "outbox", "signal" ]
    def main(self):
        t = time.time()
class WellBehaved4(Axon.Component.component):
    Inboxes = [ "inbox", "control" ]
    Outboxes = {
        "outbox" : "Foo Bar",
        "signal" : "Foo Bar",
class BadlyBehaved1(Axon.Component.component):
    Inboxes = [ ]
    Outboxes = [ ]
    def main(self):
        t = time.time()

src/k/a/kamaelia-HEAD/Sketches/MPS/Experiments/DistPipe/ExampleClasses.py   kamaelia(Download)
import time
from Axon.ThreadedComponent import threadedcomponent
from Axon.Component import component
 
class Producer(threadedcomponent):
class Transformer(component):
    def main(self):
        while 1:
            while self.dataReady("inbox"):
                d = self.recv("inbox")
                self.send(len(d), "outbox")
            yield 1
 
class Triangular(component):
class Square(component):
    def main(self):
        while 1:
            while self.dataReady("inbox"):
                d = self.recv("inbox")

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/HTTPSpider/HTTPSpider.py   kamaelia(Download)
import string
 
from Axon.Component import component
 
from Kamaelia.Protocol.HTTP.HTTPClient import SimpleHTTPClient
class HTMLProcess(component):
    def stateStart(self, c):
        if c == "<":
            contents = "".join(self.temp)
            self.temp = []
class CorrectRelativeLinks(component):
    Inboxes = {
        "links" : "List of URLs",
        "sourceurl" : "The URL of the page those links were extracted from",
        "control" : "Shut me down",
    class ListSplit(component):
        def main(self):
            while 1:
                yield 1
                while self.dataReady("inbox"):

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Axon/Examples/SynchronousLinks/basic_syncLinksAcceptanceTest.py   kamaelia(Download)
class SlowConsumer(Axon.Component.component):    
    delay = 0.2
    def main(self):
        print ("     Consumer starting")
        yield 1
class Producer(Axon.Component.component):
   def main(self):
      for i in range(10):
         success = False
         message = "hello" + str(i)
class testComponent(Axon.Component.component):
    def main(self):
        producer = Producer().activate()
        consumer = SlowConsumer().activate()
        self.link((producer,"outbox"),(consumer, "inbox"),synchronous=True)
class testComponent(Axon.Component.component):
    def main(self):
        producer = Producer().activate()
        consumer = SlowConsumer().activate()
        self.link((producer,"outbox"),(consumer, "inbox"),pipewidth=1)

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/TorrentBasedStreaming_GSOC/P2PStreamPeer/p2pstreampeer.py   kamaelia(Download)
import time
 
from Axon.Component import component
 
from Kamaelia.Chassis.Pipeline import Pipeline
class StreamReconstructor(component):
    """\
    StreamReconstructor()
 
    This component receives reports on the status/completion of BitTorrent
class PartsFilenameGenerator(component):
    """\
    PartsFilenameGenerator()
    Arguments:
    - prefix - string to prepend to the id of a torrent to make its URL

src/k/a/kamaelia-HEAD/Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/TCP_Systems/HTTP/cookbook_2.py   kamaelia(Download)
class HelloHandler(Axon.Component.component):
    """\
    This is the hello handler.  It will respond to every request with a
    Hello world message (with some HTML formatting)
    """
class Cat(Axon.Component.component):
    """\
    Like the unix command "cat", this takes whatever has been passed as an
    argument and forwards it out it's standard output - in this case out the
    outbox "outbox".
class ExampleWrapper(Axon.Component.component):
    """\
    This component will simply wrap any input it receives into a dictionary
    that the HTTP Server can use to form a response.  Note that this code
    works this way for example purposes.  In most instances, it's better to

src/k/a/Kamaelia-0.6.0/Kamaelia/SampleTemplateComponent.py   Kamaelia(Download)
 
"""
from Axon.Component import component, scheduler
class CallbackStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
class StandardStyleComponent(component):
   #Inboxes=["inbox","control"] List of inbox names if different
   #Outboxes=["outbox","signal"] List of outbox names if different
   #Usescomponents=[] # List of classes used.
   def __init__(self,label,looptimes):

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next