Skip to content
Permalink
Branch: websocket-firs…
Commits on Jan 24, 2019
  1. [WIP] Issue #261: do not loose first websocket message due to race co…

    spaceone committed Jan 24, 2019
    …ndition
Commits on Dec 19, 2018
  1. Fix wsgi component for Python 2.7 and Python 3 (#257)

    spaceone authored and prologic committed Dec 19, 2018
    * Fix import error
    
    * Fix circuits.web WSGI components for Python 3
    
    response.body = str('foobar') in Python3 was not wrapped into a list and
    not encoded into bytes. Therefore WSGI components returned nothing and
    the browser shows a content-type mislength error.
    
    * Fix circuits.web WSGI components for Python 2.7
    
    Using Controller.redirect() under python 2.7 causes errors due to wrong
    encoding of the Location header value (unicode instead if bytes) (due to
    the "url = request.uri.relative(url).unicode()" call in
    circuits.web.errors.redirect().
    
    HTTP headers seem to be stored as str(), so we ensure str() is returned in items().
    
    * Replace deprecated inspect.getargspec()
  2. Code cleanup (#259)

    spaceone authored and prologic committed Dec 19, 2018
    * Apply isort
    
    * Code cleanup stomp protocol components
    
    * Code cleanup
Commits on Dec 7, 2018
  1. Fixup, last arg may be None (#255)

    spaceone authored and prologic committed Dec 7, 2018
Commits on Nov 22, 2018
  1. Fix CRLF injection in IRC protocol (#254)

    spaceone authored and prologic committed Nov 22, 2018
    >>> print bytes(irc.Message("PRIVMSG", 'spaceone', 'test test\r\nPRIVMSG ChanServ SET PASSWORD foo'))
    PRIVMSG spaceone :test test
    PRIVMSG ChanServ SET PASSWORD foo
  2. IRC: enhance stripping of colors (#245)

    spaceone authored and prologic committed Nov 22, 2018
Commits on Sep 18, 2018
  1. Add irc.utils.irc_color_to_ansi() (#249)

    spaceone authored and prologic committed Sep 18, 2018
    from circuits.protocols.irc.utils import irc_color_to_ansi
    colorstring = '\x0300white\x03 \x0301black\x03 \x0302blue\x03 \x0303green\x03 \x0304red\x03 '
    colorstring += '\x0305brown\x03 \x0306magenta\x03 \x0307orange\x03 \x0308yellow\x03 '
    colorstring += '\x0309lightgreen\x03 \x0310cyan\x03 \x0311lightcyan\x03 \x0312lightblue\x03 '
    colorstring += '\x0313pink\x03 \x0314grey\x03 \x0315lightgrey\x03\x0f'
    print(irc_color_to_ansi('hi \x02bold\x02 \x1ditalic\x1d \x1funderline\x1f \x1estrikethrough\x1e'))
    print(irc_color_to_ansi(colorstring))
    print(irc_color_to_ansi(colorstring.replace(' \x03', ' \x0301,')))
Commits on Sep 13, 2018
  1. Issue #246: pytest Metafunc.addcall is deprecated; replace with Metaf…

    spaceone authored and prologic committed Sep 13, 2018
    …unc.parametrize (#248)
Commits on Sep 12, 2018
Commits on Sep 6, 2018
Commits on Jun 20, 2018
  1. Added PY2 to imports in values.py (#242)

    kromg authored and prologic committed Jun 20, 2018
  2. Fixed API call to networkx (#241)

    ri0t authored and prologic committed Jun 20, 2018
    networkx.write_dot -> networkx.drawing.nx_agraph.write_dot
Commits on Jun 13, 2018
  1. Auto add in notify#239 (#240)

    kromg authored and prologic committed Jun 13, 2018
    * Added auto_add to notify.add_path()
    
    * Added auto_add with default to True to notify.add_path().
      Fixes #239.
    
    * Added various notify tests (#239)
Commits on Apr 19, 2018
  1. make __str__ compatible with py2 (#232)

    bloodywing authored and prologic committed Apr 19, 2018
    * make __str__ compatible with py2
    
    See a similar implementation in Django:
    https://docs.djangoproject.com/en/1.11/_modules/django/utils/six/#python_2_unicode_compatible
    
    * Update values.py
    
    Fixed import sorting for six
  2. Stomp (#231)

    kathychurch authored and prologic committed Apr 19, 2018
    * Add support for STOMP protocol
    
    * cleanup
    
    * Test params from env, tests for http proxy and no ssl context
    
    * sample credentials in example
    
    * better default ssl version, pep8
    
    * Changes per review comments
  3. Changing factorial example to have multiple calls. (#228)

    sacherjj authored and prologic committed Apr 19, 2018
    * Changing factorial example to have multiple calls.
    
    * Parallel downloading with requests using Worker and task.
    
    * Adding Class and method name to help find method causing issues.
    It was silent otherwise and impossible to find by error message.
    Is this style of except Python 2.7 compatible?
    
    * Changing to allow running on Windows platforms.
    AF_UNIX does not exist in Windows (3.5)
  4. Fix for handling request without headers (#238)

    kwangswei authored and prologic committed Apr 19, 2018
    - None of the HTTP headers are required in a HTTP/1.0 request.
    - Circuits couldn't receive a request which doesn't have any headers
    - For example, "GET / HTTP/1.0\r\n\r\n"
    - This commit fixed this issue
Commits on Oct 13, 2017
  1. allow a callable no-arg prefix for the debugger (#235)

    ke4roh authored and prologic committed Oct 13, 2017
    This could be useful for, for example, printing a timestamp
Commits on Jul 17, 2017
  1. make __str__ compatible with py2 (six-decorator) (#233)

    bloodywing authored and spaceone committed Jul 17, 2017
    * make __str__ compatible with py2 (six-decorator)
    See also: #232 and #229
Commits on Jun 1, 2017
  1. [web]: Improves the API for session management and adds expire suppor…

    prologic committed Jun 1, 2017
    …t. (#212)
    
    * [web]: Improve the API for session management and add expire support.
    
    Fixes #133
    
    * Address @spaceone's feedback
    
    * wtf? Fixed Import order :)
    
    * use circuits.six
    
    * isort
Commits on May 31, 2017
  1. Documentation: Cannot import name `WebSockets` (#230)

    Chris-May authored and spaceone committed May 31, 2017
    I think the example code for Websockets might be slightly out of date.
    
    I attempted to run the code, and python returned an error:
    ```
    Traceback (most recent call last):
      File "file.py", line 5, in <module>
        from circuits.web.dispatchers import WebSockets
    ImportError: cannot import name 'WebSockets'
    ```
    I believe it's because it should be importing `WebSocketsDispatcher` instead. The examples in the examples directory would seem to agree with this.
Commits on Feb 15, 2017
  1. Write a test for issue #226

    ke4roh authored and spaceone committed Feb 15, 2017
    * waiting for an already finished event should work
Commits on Feb 11, 2017
Commits on Feb 2, 2017
  1. Update dnsclient.py (#223)

    BigCedar authored and spaceone committed Feb 2, 2017
Commits on Jan 31, 2017
  1. Update README.rst (#222)

    prologic authored and spaceone committed Jan 31, 2017
  2. Update README.md (#221)

    prologic authored and spaceone committed Jan 31, 2017
Commits on Jan 30, 2017
  1. Implement STARTTLS event; Fix #113 (#214)

    spaceone authored and prologic committed Jan 30, 2017
    from circuits import Component, Debugger
    from circuits.net.sockets import TCPServer, write
    from circuits.net.events import starttls
    
    class TLSEchoServer(Component):
    
        def init(self, bind):
            self.transport = TCPServer(bind,
                certfile="/circuits/tests/net/cert.pem",
            ).register(self)
    
        def connect(self, sock, foo, bar):
            self.fire(write(sock, b'* OK [CAPABILITY STARTTLS] Dovecot ready.\r\n'))
    
        def read(self, sock, data):
            if data.strip().upper() == b". STARTTLS":
                yield self.fire(write(sock, b'. OK Begin TLS negotiation now.'))
                self.fire(starttls(sock))
                return
            if data.strip() == b'. CAPABILITY':
                self.fire(write(sock, b'* CAPABILITY STARTTLS \r\n. OK Pre-login capabilities listed, post-login capabilities have more.\r\n'))
            else:
                self.fire(write(sock, b'Thanks for TLS encrypting! You wrote: %r' % (data,)))
    
    (TLSEchoServer(("0.0.0.0", 8000)) + Debugger()).run()
    
    $ openssl s_client -connect localhost:8000 -starttls imap
Commits on Jan 29, 2017
  1. Add support to set additional socket options

    spaceone committed Jan 24, 2017
    from circuits.net.sockets import TCPServer
    from socket import SOL_SOCKET, SO_REUSEPORT
    s = TCPServer(('0.0.0.0', 8090), socket_options=[(SOL_SOCKET, SO_REUSEPORT, 1)])
    assert s._sock.getsockopt(SOL_SOCKET, SO_REUSEPORT) == 1
Commits on Jan 27, 2017
  1. Fixed race condition in test_value.py

    apollo13 committed Jan 27, 2017
    x.notify was set to late, the executing thread did already finish
    processing the events.
Commits on Jan 26, 2017
  1. Fixed #198 -- Made pushing onto the event queue via fire threadsafe.

    apollo13 committed Jan 22, 2017
Commits on Jan 23, 2017
  1. [web]: Simplify HTTP properties by removing useless hasattr/getattr c…

    prologic committed Jan 23, 2017
    …hecks (#211)
Commits on Jan 21, 2017
  1. [docs]: Fixed documentation for circuits.core.Worker (#205)

    prologic committed Jan 21, 2017
    Fixes #179
Older
You can’t perform that action at this time.