Skip to content

Commit

Permalink
Merge pull request #256 from candango/develop
Browse files Browse the repository at this point in the history
Merging develop to master.
  • Loading branch information
piraz committed Dec 23, 2018
2 parents dc5c37a + c72c28f commit 5e6749a
Show file tree
Hide file tree
Showing 56 changed files with 654 additions and 208 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ python:
install:
- "pip install -r requirements/basic.txt"
- "pip install -r requirements/redis.txt"
- "pip install -r requirements/pexpect.txt"
- "pip install -r requirements/sqlalchemy.txt"
script:
- "PYTHONPATH=$PYTHONPATH:. python tests/runtests.py"
9 changes: 9 additions & 0 deletions docs/guide/command_line.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Command line
============

Firenado provides a command line structure that helps you to execute or create
management tasks. Those tasks are organized by category, commands and sub
commands.

The framework provides a category called Firenado with the following commands:

- app
- projec(ect)

Firenado has a command line program that helps to create a new project, run an
application and other things.

Expand Down
1 change: 1 addition & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release notes
.. toctree::
:maxdepth: 2

releases/v0.1.7.5
releases/v0.1.7.4
releases/v0.1.7.3
releases/v0.1.7.2
Expand Down
32 changes: 32 additions & 0 deletions docs/releases/v0.1.7.5.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
What's new in Firenado 0.1.7.5
==============================

Dec 22, 2018
------------

We are pleased to announce the release of Firenado 0.1.7.5.

A new launcher were added to spawn an application in another process and the
socket parameter was added to the firenado launcher to overrides the
configuration file.


Here are the highlights:

Refactory
~~~~~~~~~

* Move random_string to the security module. `#247 <https://github.com/candango/firenado/issues/247>`_
* Provide a function to return the class reference by it's name. `#251 <https://github.com/candango/firenado/issues/251>`_
* Rename skell to testapp. `#252 <https://github.com/candango/firenado/issues/252>`_

New Features
~~~~~~~~~~~~

* Add socket parameter to the app run command. `#248 <https://github.com/candango/firenado/issues/248>`_
* Add a process launcher. `#249 <https://github.com/candango/firenado/issues/249>`_

Bug Fixes
~~~~~~~~~

* Fix command match with parenthesis. `#250 <https://github.com/candango/firenado/issues/250>`_
File renamed without changes.
30 changes: 30 additions & 0 deletions examples/launcher/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from . import handlers
from firenado import tornadoweb
from firenado.launcher import ProcessLauncher
from tornado import gen
import os


class LauncherComponent(tornadoweb.TornadoComponent):

def __init__(self, name, application):
super(LauncherComponent, self).__init__(name, application)
self.launcher_path = os.path.abspath(os.path.dirname(__file__))
self.charge_path = os.path.join(self.launcher_path, "charge")
self.launcher = None

def get_handlers(self):
return [
(r'/', handlers.IndexHandler),
]

@gen.coroutine
def initialize(self):
import sys
self.launcher = ProcessLauncher(dir=self.charge_path,
logfile=sys.stderr)
self.launcher.load()
yield self.launcher.launch()

def shutdown(self):
self.launcher.shutdown()
File renamed without changes.
10 changes: 10 additions & 0 deletions examples/launcher/charge/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from charge import handlers
from firenado import tornadoweb


class ChargeComponent(tornadoweb.TornadoComponent):

def get_handlers(self):
return [
(r'/', handlers.IndexHandler),
]
39 changes: 39 additions & 0 deletions examples/launcher/charge/conf/firenado.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
app:
component: 'charge'
data:
sources:
# Set here references from sources defined on data.sources
- 'session'
pythonpath: '..'
#type: 'tornado'
port: 8889

data:
sources:
- name: session
connector: redis
# host: localhost
# port: 6379
# db: 0
components:
- id: charge
class: charge.app.ChargeComponent
enabled: true
#- id: admin
# enabled: true
#- id: info
# enabled: true

log:
level: DEBUG

# Session types could be:
# file or redis.
session:
type: redis
enabled: true
# Redis session handler configuration
data:
source: session
# File session handler related configuration
# path: /tmp
7 changes: 7 additions & 0 deletions examples/launcher/charge/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from firenado import tornadoweb


class IndexHandler(tornadoweb.TornadoHandler):

def get(self):
self.write("Charge output")
39 changes: 39 additions & 0 deletions examples/launcher/conf/firenado.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
app:
component: 'launcher'
data:
sources:
# Set here references from sources defined on data.sources
- 'session'
pythonpath: '..'
#type: 'tornado'
port: 8888

data:
sources:
- name: session
connector: redis
# host: localhost
# port: 6379
# db: 0
components:
- id: launcher
class: launcher.app.LauncherComponent
enabled: true
#- id: admin
# enabled: true
#- id: info
# enabled: true

log:
level: DEBUG

# Session types could be:
# file or redis.
session:
type: redis
enabled: true
# Redis session handler configuration
data:
source: session
# File session handler related configuration
# path: /tmp
7 changes: 7 additions & 0 deletions examples/launcher/handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from firenado import tornadoweb


class IndexHandler(tornadoweb.TornadoHandler):

def get(self):
self.write("Launcher output")
11 changes: 0 additions & 11 deletions examples/skell/templates/session_timeout.html

This file was deleted.

File renamed without changes.
26 changes: 13 additions & 13 deletions examples/skell/app.py → examples/testapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import skell.handlers
import skell.services
from . import handlers, services, uimodules
import firenado.tornadoweb
from firenado import service
from skell import uimodules
import logging

logger = logging.getLogger(__name__)


class SkellComponent(firenado.tornadoweb.TornadoComponent):
class TestappComponent(firenado.tornadoweb.TornadoComponent):

user_service: skell.services.LoginService
user_service: services.LoginService

def __init__(self, name, application):
super(SkellComponent, self).__init__(name, application)
super(TestappComponent, self).__init__(name, application)
self.user_service = None

def get_handlers(self):
import firenado.conf
default_login = firenado.conf.app['login']['urls']['default']
return [
(r"/", skell.handlers.IndexHandler),
(r"/session/counter", skell.handlers.SessionCounterHandler),
(r"/session/timeout", skell.handlers.SessionTimeoutHandler),
(r"/pagination", skell.handlers.PaginationHandler),
(r"/%s" % default_login, skell.handlers.LoginHandler),
(r"/private", skell.handlers.PrivateHandler),
(r"/", handlers.IndexHandler),
(r"/session/counter", handlers.SessionCounterHandler),
(r"/session/config", handlers.SessionConfigHandler),
(r"/pagination", handlers.PaginationHandler),
(r"/%s" % default_login, handlers.LoginHandler),
(r"/%s" % default_login, handlers.LoginHandler),
(r"/logout", handlers.LogoutHandler),
(r"/private", handlers.PrivateHandler),
]

def get_ui_modules(self):
Expand All @@ -51,7 +51,7 @@ def initialize(self):
import firenado.conf
firenado.conf.app['login']['urls']['buga'] = 'buga'

@service.served_by(skell.services.UserService)
@service.served_by(services.UserService)
def install(self):
""" Installing test database
"""
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import firenado.tornadoweb
from skell.components.internal import uimodules
from firenado import tornadoweb
from . import uimodules


class SkellInternalComponent(firenado.tornadoweb.TornadoComponent):
class TestappInternalComponent(tornadoweb.TornadoComponent):
""" This component just adds another ui modules package to the application
ui modules stack.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def render(self, header):
:param header: The header string to be rendered by the module.
:return: A header string
"""
return self.render_string('skell:header2.html', header=header)
return self.render_string('testapp:header2.html', header=header)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app:
id: firenado-test-app
component: skell
component: testapp
data:
sources:
# Set here references from sources defined on data.sources
Expand All @@ -10,10 +10,10 @@ app:
login:
urls:
- name: default
value: skell_login
value: test_login
- name: custom
value: custom_login
#url_root_path: "skell"
#url_root_path: "testapp"
cookie_secret: "rebfcrj1qc81j76pxhb10pbrewe7exmjghftll93jh6sgporsc7igvrgk9l9oy9u"
xsrf_cookies: true
addresses:
Expand All @@ -32,11 +32,11 @@ data:
url: mysql+pymysql://root:rootpass@localhost:3306/test

components:
- id: skell
class: skell.app.SkellComponent
- id: testapp
class: testapp.app.TestappComponent
enabled: true
- id: internal
class: skell.components.internal.component.SkellInternalComponent
class: testapp.components.internal.component.TestappInternalComponent
enabled: true
#- id: admin
# enabled: true
Expand Down
File renamed without changes.

0 comments on commit 5e6749a

Please sign in to comment.