Opened 8 years ago

Last modified 4 years ago

#2205 enhancement new

Documentation codelistings need updating and tests

Reported by: jerub Owned by:
Priority: normal Milestone:
Component: core Keywords: documentation, finger, doctests
Cc: thijs, exarkun, kehander1, tom@… Branch: branches/simple-app-2205-2
(diff, github, buildbot, log)
Author: thijs, jerub Launchpad Bug:

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 8 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 8 years ago by jerub

  • Status changed from new to assigned

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 8 years ago by jerub

  • Summary changed from Simplification of Application creation to Documentation codelistings need updating and tests

comment:4 Changed 6 years ago by thijs

  • author set to jerub
  • Branch set to branches/simple-app-2205
  • Cc thijs added
  • Keywords documentation added
  • Owner changed from jerub to thijs
  • Status changed from assigned to new

I can go through those docs.

comment:5 Changed 6 years ago by thijs

  • Keywords review added
  • Owner thijs deleted

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

comment:6 follow-up: Changed 6 years ago by exarkun

  • Cc exarkun added
  • Keywords review removed
  • Owner set to thijs

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

comment:7 Changed 6 years ago by thijs

  • Author changed from jerub to thijs, jerub
  • Branch changed from branches/simple-app-2205 to branches/simple-app-2205-2

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

comment:8 in reply to: ↑ 6 Changed 6 years ago by thijs

  • Keywords review added
  • Owner thijs 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 6 years ago by thijs

Forgot to add the tests, included in r25319

comment:10 Changed 6 years ago by therve

  • Keywords review removed
  • Owner set to thijs

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 6 years ago by thijs

  • 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 4 years ago by binjured

  • Cc tom@… 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 4 years ago by <automation>

  • Owner thijs deleted
Note: See TracTickets for help on using tickets.