← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

Re: The Road To 0.1

 

On Sun, Mar 18, 2012 at 1:59 PM, Jono Bacon <jono@xxxxxxxxxx> wrote:
> On 18 March 2012 10:07, Duncan McGreggor <duncan@xxxxxxxxxxxxx> wrote:
>> I headed up to Tennessee this weekend to visit my Dad (80 years old!)
>> but did manage to get some hacking done; there's a new branch up for
>> review:
>>  http://goo.gl/OdOKP
>
> Many thanks, Duncan, I will review that in a few minutes.
>
>> This work is done in preparation for this bug:
>>  #946850 Add support for running the daemon the "Twisted Way"
>>
>> I should be able to start that one soon, now that much of what was in
>> the way has been cleaned up and the app file is now fairly pristine
>> and ready for actual Twisted application code.
>
> Fantastic! This is what I see as the next major thing for us to fix to
> get us to a point where we can package up the system. Thanks for
> helping!
>
>> The only blocker that I can imagine (right now) would be the command
>> line options; I may need to open a new ticket to create a Twisted
>> plugin for the daemon command line parameters (e.g., adding those
>> options to the legal ones that can be passed to "twistd"; I'm not sure
>> what twistd will swallow when it gets called), but we'll see; there
>> may be a quicker hack around that issue, and we can save the more
>> involved "right way" for a later time.
>
> Right now we don't pass the daemon any options, but I think we are
> going to need to be able to pass it a few items (in the interests of
> writing Unit Tests):
>
>  - Accomplishments Path
>  - Trophies Path
>
> Thanks for looking into this, Duncan. :-)

If only it was just "looking" ;-)

Okay, there's a great big ol' branch to review here:
  https://code.launchpad.net/~oubiwann/ubuntu-accomplishments-system/946850-twisted-app/+merge/98325

This adds support for running the daemon with twistd and using the
application infrastructure in Twisted for all sorts of nifty things
(log and pid file locations, log rotation, uid/guid setting, chroot,
etc., etc.).

Most importantly for the future of the daemon, though, is that we now
have fine-grained control of the order in which services get started
up and shut-down. As we want to do unique things with the dbus loop,
the session bus, the timer, etc., we will be able to do so very
easily, ensuring that code gets executed in an appropriate manner and
that all the dependent, internal components shutdown cleanly as well.

That being said, I need to hop off this project now. If I get some
time in the future, I may code some more, but I left lots of notes for
any motivated hacker to follow up on. There are some great
opportunities for refactoring code, working with deferreds and
callbacks, etc.

Having hacked on Python since the 90s, I've left a bunch of
suggestions for various improvements that could be made on the review
ticket, in the code itself, in several bugs that I have filed, as well
as in various blueprints.

Hope the suggestions and the Twisted support help folks out :-)

Best of luck everyone!

d


References