rask  Check-in [2c2c5d3114]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:2c2c5d31141787edc264f92e3ae41f91a8fbfb02
Date: 2017-04-01 19:37:26
User: umgeher
Comment:better name
Tags And Properties
  • branch=rask/f/httpclient inherited from [7587e03116]
  • sym-rask/f/httpclient inherited from [7587e03116]
Context
2017-04-01
19:41
[d5c55f5bc9] http request is gone (user: umgeher, tags: rask/f/httpclient)
19:37
[2c2c5d3114] better name (user: umgeher, tags: rask/f/httpclient)
19:34
[cd899b3cf1] importing http stuff from rash.http (user: umgeher, tags: rask/f/httpclient)
Changes

Changes to rask/rask/http/__init__.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from client import AsyncHTTPClient,HTTPRequest
from rask.base import Base
from tornado.web import Application,asynchronous,RequestHandler
from tornado.websocket import WebSocketHandler

__all__ = [
    'Application',
    'asynchronous'
    'AsyncHTTPClient',
    'Handler',
    'HTTPRequest',
    'WSHandler'
]

class Handler(RequestHandler,Base):
    def set_default_headers(self):
        self.set_header('Server','Viking Makt HTTP Server')
        
class WSHandler(WebSocketHandler,Base):
    def check_origin(self,origin):
        return True
|







|












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from client import HTTPClient,HTTPRequest
from rask.base import Base
from tornado.web import Application,asynchronous,RequestHandler
from tornado.websocket import WebSocketHandler

__all__ = [
    'Application',
    'asynchronous'
    'HTTPClient',
    'Handler',
    'HTTPRequest',
    'WSHandler'
]

class Handler(RequestHandler,Base):
    def set_default_headers(self):
        self.set_header('Server','Viking Makt HTTP Server')
        
class WSHandler(WebSocketHandler,Base):
    def check_origin(self,origin):
        return True

Changes to rask/rask/http/client.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from tornado.httpclient import AsyncHTTPClient as HTTPClient,HTTPRequest as _HTTPRequest

__all__ = [
    'AsyncHTTPClient',
    'HTTPRequest',
]

def HTTPRequest(*kwargs):
    return _HTTPRequest(
        allow_nonstandard_methods=True,
        request_timeout=20,
        url='http://localhost',
        validate_cert=False
        **kwargs
    )



|











1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from tornado.httpclient import AsyncHTTPClient as HTTPClient,HTTPRequest as _HTTPRequest

__all__ = [
    'HTTPClient',
    'HTTPRequest',
]

def HTTPRequest(*kwargs):
    return _HTTPRequest(
        allow_nonstandard_methods=True,
        request_timeout=20,
        url='http://localhost',
        validate_cert=False
        **kwargs
    )

Changes to rask/rask/main/__init__.py.

1
2
3
4
5
6
7
8
9
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from rask.base import Base
from rask.http import Application,AsyncHTTPClient,HTTPRequest
from rask.options import define,options,parse_command_line
from rask.parser.json import dictfy
from rask.parser.utcode import UTCode

__all__ = ['Main']

class Main(Base):
................................................................................
        self.ioengine.start()

    @property
    def http_client(self):
        try:
            assert self.__http_client
        except (AssertionError,AttributeError):
            self.__http_client = AsyncHTTPClient()
        except:
            raise
        return self.__http_client.fetch
    
    @property
    def services(self):
        try:

|







 







|







1
2
3
4
5
6
7
8
9
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from rask.base import Base
from rask.http import Application,HTTPClient,HTTPRequest
from rask.options import define,options,parse_command_line
from rask.parser.json import dictfy
from rask.parser.utcode import UTCode

__all__ = ['Main']

class Main(Base):
................................................................................
        self.ioengine.start()

    @property
    def http_client(self):
        try:
            assert self.__http_client
        except (AssertionError,AttributeError):
            self.__http_client = HTTPClient()
        except:
            raise
        return self.__http_client.fetch
    
    @property
    def services(self):
        try: