Ticket #10 (closed enhancement: fixed)

Opened 1 year ago

Last modified 2 weeks ago

Allow use of TurboMail independent of TurboGears.

Reported by: alberto@… Owned by: realuser
Priority: normal Milestone: 3.0
Component: infrastructure Version:
Keywords: Cc: alberto@…

Description (last modified by amcgregor) (diff)

I've made a couple of changes to TurboMail's package structure (hopefully 100% backwards compatible) to allow re-use of the TurboMail in any python app.

Changes made:

  • Removed KidMessage from message.py (I've seen in a comment it was planned for next version) since it depends on tg's view engines
  • Tweaked Message's constructor so it doesn't fetch encoding from tg's config but accept it as parameter. If not given, will use Message.default_encoding (which ext.tg monkey-patches for backwards compatibility)
  • Moved startup.py to turbogears.ext.tg (changedentrypoints and some imports accordingly)
  • Modified init.py to check if TG is installed before importing the extension's symbols into the turbomail namespace.
  • Removed the turbogears dependency at setup.py and added as "extras_require". TurboMail now only requires stdlib :)
  • Applied reindent.py on all .py files (since I sc**ed indentation badly with my 4-tab-spaces editor)

I've minimally tested it in a quickstarted 1.0.2.2 app and everything seems ok.

This patch makes TurboMail TurboGears2-ready! :)

Alberto

Attachments

refactor.diff (82.9 kB) - added by alberto@… 1 year ago.

Change History

Changed 1 year ago by alberto@…

Changed 1 year ago by amcgregor

  • status changed from new to assigned
  • component changed from unassigned to infrastructure

Is there any way you could try applying this vs. the 2.0.5 branch, then supply an updated patch?

Changed 1 year ago by amcgregor

  • priority changed from normal to low
  • type changed from defect to enhancement
  • summary changed from [PATCH] Refactoring to allow use of TurboMail outside of TG to Allow use of TurboMail independent of TurboGears.

Changed 1 year ago by amcgregor

  • keywords patch added
  • summary changed from Allow use of TurboMail independent of TurboGears. to Allow use of TurboMail independent of TurboGears. — Patch

Changed 1 year ago by amcgregor

  • description modified (diff)

Changed 1 year ago by amcgregor

  • summary changed from Allow use of TurboMail independent of TurboGears. — Patch to Patch — Allow use of TurboMail independent of TurboGears.

Changed 1 year ago by realuser

  • status changed from assigned to new
  • cc alberto@… added
  • summary changed from Patch — Allow use of TurboMail independent of TurboGears. to Allow use of TurboMail independent of TurboGears.
  • priority changed from low to normal
  • owner changed from amcgregor to realuser
  • keywords patch removed

I'll try to redo the patch for trunk this week so I've reassigned it to myself.

One comment before I start:

I'd like to apply reindent.py on all the package to change tabs to 4 spaces and make it pep8 compliant. However, this will break badly any pending patches so I won't proceed just yet. This is probably the biggest reason why my previous patch didn't apply at all so I'd like to "cleanup" before doing anything.

However, if there's any reason why tabs are preferred then I'd just adjust my editor an comply with the project's guidelines. I strongly recommend switching to 4 spaces as recommended by pep8 though...

If I get a green light I'll commit the change.

Alberto

Changed 1 year ago by realuser

  • status changed from new to assigned

Ok, I've applied reindent.py successfully in my sandbox and tests pass :) There are no pending patches so all I need is to make sure I'll not be breaking anyone's uncommitted changes and that the change in indentation style is really wanted by "management"... ;)

Alberto

Changed 4 months ago by fs

  • milestone set to 3.0

I'm not sure if someone has the time to apply this patch to the branch 2.x (if yes, I would ack the patch!) but we definitely need it for 3.0. Therefore I change the milestone to 3.0 and Alberto's changes can be used as a reference for further work.

Changed 2 weeks ago by amcgregor

  • status changed from assigned to closed
  • resolution set to fixed

I believe the concerns of this patch and ticket have been acceptably resolved in 3.0 trunk.

Note: See TracTickets for help on using tickets.