Opened 11 years ago

Last modified 7 years ago

#2205 enhancement new

Documentation codelistings need updating and tests

Reported by: Stephen Thorne Owned by:
Priority: normal Milestone:
Component: core Keywords: documentation, finger, doctests
Cc: Thijs Triemstra, Jean-Paul Calderone, kehander1, Tom Davis Branch: branches/simple-app-2205-2
branch-diff, diff-cov, branch-cov, buildbot
Author: thijs, jerub

Description

The code used in .tac files is too complicated. I'd like to be able to create an application object with a minimum of verbage.

What we have:

application = Application('myapp', uid=1, gid=1)
serviceCollection = IServiceCollection(application)
service1.setServiceParent(serviceCollection)
service2.setServiceParent(serviceCollection)

What I'd like

application = Application('myapp', uid=1, gid=1, servies=[service1, service2])

The tutorials and documentation would have to be updated to include this new form, and probably to continue to acknowledge how to do both ways.

Change History (13)

comment:1 Changed 11 years ago by Glyph

You asked for my feedback, and my feedback is that I think this is a good idea (although definitely high enough priority for me to work on it...)

I think that this might apply to other twisted.application stuff as well, not just Application. Personally, I can never remember how to create a service without going and reading the code, and that's a very bad sign for other folks...

comment:2 Changed 11 years ago by Stephen Thorne

Status: newassigned

Branch is simple-app-2205. Tests and code have been updated, children=[] is the kwarg as per a suggestion on irc.

Still need to update the docs.

comment:3 Changed 11 years ago by Stephen Thorne

Summary: Simplification of Application creationDocumentation codelistings need updating and tests

comment:4 Changed 9 years ago by Thijs Triemstra

author: jerub
Branch: branches/simple-app-2205
Cc: Thijs Triemstra added
Keywords: documentation added
Owner: changed from Stephen Thorne to Thijs Triemstra
Status: assignednew

I can go through those docs.

comment:5 Changed 9 years ago by Thijs Triemstra

Keywords: review added
Owner: Thijs Triemstra deleted

Perhaps someone can review jerub's branch as well, putting it up for review.

comment:6 Changed 9 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone added
Keywords: review removed
Owner: set to Thijs Triemstra

This conflicts horribly with trunk. The conflicts need to be resolved and the branch merged forward.

comment:7 Changed 9 years ago by Thijs Triemstra

Author: jerubthijs, jerub
Branch: branches/simple-app-2205branches/simple-app-2205-2

(In [25314]) Branching to 'simple-app-2205-2'

comment:8 in reply to:  6 Changed 9 years ago by Thijs Triemstra

Keywords: review added
Owner: Thijs Triemstra deleted

Replying to exarkun:

This conflicts horribly with trunk. The conflicts need to be resolved and the branch merged forward.

Done, see r25315

comment:9 Changed 9 years ago by Thijs Triemstra

Forgot to add the tests, included in r25319

comment:10 Changed 9 years ago by therve

Keywords: review removed
Owner: set to Thijs Triemstra

Most of the tests are failing with this error:

[ERROR]: twisted.test.test_fingertutorial.Finger21TestCase.testFingerFactory

Traceback (most recent call last):
  File "/home/therve/projects/Twisted/trunk/twisted/test/test_fingertutorial.py", line 264, in setUp
    super(Finger19TestCase, self).setUp()
  File "/home/therve/projects/Twisted/trunk/twisted/test/test_fingertutorial.py", line 36, in setUp
    self.finger = __import__(self.module)
exceptions.ImportError: No module named finger21
-------------------------------------------------------------------------------
Ran 68 tests in 0.496s

FAILED (errors=47, successes=21)

comment:11 Changed 9 years ago by Thijs Triemstra

Cc: kehander1 added

kehander1 has been working on splitting up the finger example into libraries and the tests here should be made up to date for that.

comment:12 Changed 7 years ago by Tom Davis

Cc: Tom Davis added
Keywords: finger doctests added

kehander1 has stopped working on that (as far as I can tell) which takes this ticket to limbo with it. There seem to be a number of circular dependencies for the Finger tutorial to make any progress towards "maybe less awful".

comment:13 Changed 7 years ago by <automation>

Owner: Thijs Triemstra deleted
Note: See TracTickets for help on using tickets.