Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1301 (closed defect: fixed)

Opened 11 years ago

Last modified 9 years ago

[PATCH] Improved reloading mechanism in TurboKid

Reported by: chrisz Owned by: faide
Priority: high Milestone: 1.0.2
Component: Kid Version: 1.0
Severity: major Keywords:
Cc:

Description

The reloading mechanism in TurboKid? did not work properly when you have two templates that are dependent on the same base template. When you update the bas template and load the first template, the template and its base template is reloaded. But when you load the second template, it is not reloaded though its base templated has changed. This leads to an incompatibility of the template and its base template, resulting in the notorious "Initialize / NoneType? not callable bug".

The attached patch improves the reload logic. We do not store the mtime for the template files, but the maximum of the mtime of the template and all its base templates. If a base template has been touched, the template will also be reloaded.

Attachments

turbokid_reload.patch Download (7.5 KB) - added by chrisz 11 years ago.
TurboKid? patch for reload mechanism
turbokid_reload_and_filter.patch Download (7.9 KB) - added by chrisz 11 years ago.
TurboKid? patch for reload mechanism and i18n filter

Change History

comment:1 Changed 11 years ago by jorge.vargas

  • Owner set to jorge.vargas
  • Component changed from unassigned to Kid

please check out your editor's config it has some mix of CRLF and LF, also there are some lines with 5 spaces. I'm not sure if that's from the original code.

I'll add this to my TODO list.

Changed 11 years ago by chrisz

TurboKid? patch for reload mechanism

comment:2 Changed 11 years ago by chrisz

I have created the patch with TSVN which used CRLF instead of LF for the control lines though the file uses LFs only. I don't think that should cause any problems, but I have uploaded again with CRLFs converted to LFs. The 5 spaces are an artifact of the patch program which adds the first column, the actual code uses only 4 spaces. If you click on the patch link above, you will see that trac can apply the patch, so it should be ok.

comment:3 Changed 11 years ago by chrisz

I have attached an expanded patch that solves another problem with TurboKid? if you are using i18n, reported  here on the Kid trac.

Changed 11 years ago by chrisz

TurboKid? patch for reload mechanism and i18n filter

comment:4 Changed 10 years ago by faide

  • Owner changed from jorge.vargas to faide
  • Status changed from new to assigned

Applied to TurboKid? trunk yesterday. Thanks!

comment:5 Changed 10 years ago by faide

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.