Changeset 1334:0f6f0e1b3515
- Timestamp:
- 01/10/10 20:00:33 (2 years ago)
- Branch:
- default
- Location:
- zine
- Files:
-
- 4 edited
-
templates/admin/perform_upgrade.html (modified) (5 diffs)
-
upgrades/__init__.py (modified) (1 diff)
-
upgrades/versions/001_split_tables.py (modified) (2 diffs)
-
upgrades/webapp.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zine/templates/admin/perform_upgrade.html
r1318 r1334 15 15 16 16 div.msg { 17 width: 90%;17 width: 40em; 18 18 margin: 0 auto 0 auto; 19 19 padding: 20px; … … 31 31 32 32 h2 { 33 border-bottom: 1px solid #cfcfcf; 34 margin-left: 10px; 33 border-top: 5px solid #cfcfcf; 34 padding-top: 5px; 35 margin-left: -20px; 35 36 margin-bottom: 0; 36 margin-right: 10px;37 margin-right: -20px; 37 38 text-align: center; 38 39 } 39 40 40 41 h3 { 41 font-weight: small; 42 border-bottom: 1px dashed #cfcfcf; 43 margin-left: 10px; 44 margin-bottom: 0; 45 margin-right: 150px; 42 font-weight: normal; 43 border-bottom: 1px solid #cfcfcf; 46 44 } 47 45 … … 54 52 } 55 53 56 p {57 margin: 0;58 padding: 0;59 }60 61 54 div.message { 62 55 border: 1px solid #E8B5B5; 63 margin: 0 -10px 10px -10px; 64 padding: 8px 8px 8px 32px; 56 padding: 8px; 65 57 -moz-border-radius: 3px; 66 58 -webkit-border-radius: 3px; … … 73 65 margin-top: 10px; 74 66 margin-left: 10px; 75 margin-right: 150px; 76 padding-top: 0; 77 padding-bottom: 0; 67 margin-right: 10px; 78 68 background-color: #F7FAFD; 79 69 border-color: #B4D2E7; 80 70 } 81 span.progress, dl dt { 71 72 .progress { 82 73 font-size: 80%; 83 74 font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Monaco', monospace; 75 } 76 77 p.finish { 78 border-top: 5px solid #cfcfcf; 79 padding-top: 5px; 80 margin-left: -20px; 81 margin-right: -20px; 82 text-align: center; 84 83 } 85 84 … … 92 91 <h1>{{ _("Upgrade In Progress") }}</h1> 93 92 <p>{% trans %}<b>Database upgrade in progress!</b>{% endtrans %}</p> 94 {% elif live_log is defined %}93 {%- elif live_log is defined %} 95 94 <h1>{{ _("Upgrading...") }}</h1> 96 <p>{% trans %}Upgrade in pro cess.95 <p>{% trans %}Upgrade in progress. 97 96 <strong>Don't hit cancel!</strong>{% endtrans %}</p> 98 97 {%- for event in live_log %}{{ event }}{%- endfor %} 99 <p >{% trans %}Database upgraded successfully.{% endtrans %}</p>98 <p class="finish">{% trans %}Database upgrade finished.{% endtrans %}</p> 100 99 <br/> 101 <div class="message">{% trans %}Zine is in maintenance mode.100 <div class="message">{% trans %}Zine maintenance mode has been switched on. 102 101 Please <a href="{{ blog_url }}">check your blog</a> to see if the 103 upgrade was perfect.104 Don't forget to <a href="{{ maintenance_url }}">turn it off again</a>105 o nce you finish.102 blog works fine with the upgraded database. 103 Don't forget to <a href="{{ maintenance_url }}">turn maintenance mode 104 off again</a> once you finish. 106 105 {% endtrans %}</div> 106 {# XXX offer advice in case the upgrade failed? #} 107 107 {{ finish() }} 108 {% else %}109 <h1>{{ _("Upgrade ") }}</h1>108 {%- else %} 109 <h1>{{ _("Upgrade required") }}</h1> 110 110 <p>{% trans %}<b>Zine requires a database upgrade!</b>{% endtrans %}</p> 111 <p>{% trans %}A database upgrade can become necessary when a new version 112 of Zine or one of your plugins is installed.{% endtrans %}</p> 113 <p>{% trans %}When you click “Perform upgrade”, your database will be 114 brought in sync with the format the installed software expects. While 115 this is designed not to corrupt your database, you can back it up 116 now before clicking “Perform upgrade”.{% endtrans %}</p> 111 117 <br/> 112 118 <form action="" method="POST"> 113 <input type="submit" name="upgrade" value=" Upgrade!">119 <input type="submit" name="upgrade" value="{{ _("Perform upgrade") }}"> 114 120 </form> 115 121 {%- endif %} -
zine/upgrades/__init__.py
r1333 r1334 245 245 version = self._migrate_version(schema, version, upgrade) 246 246 247 yield '<h2>Migrating %s</h2>\n' % repository.id 248 247 249 changeset = schema.changeset(version) 248 250 if not changeset: 249 yield '<p> Repository %s is already up to date.</p>\n' % repository.id251 yield '<p>This repository is already up to date.</p>\n' 250 252 return 251 253 252 yield '<h2>Migrating %s</h2>\n' % repository.id253 254 for ver, change in changeset: 254 255 nextver = ver + changeset.step -
zine/upgrades/versions/001_split_tables.py
r1333 r1334 285 285 metadata2.bind = migrate_engine 286 286 287 yield '<div class="message info"> <dl>'288 yield '< dt>.</dt><dd> comment</dd>\n'289 yield '< dt>+</dt><dd> comment with <tt>parent_id</tt></dd>\n'290 yield '< dt>E</dt><dd> Error handling comment</dd>\n'291 yield '</d l></div>\n'287 yield '<div class="message info">' 288 yield '<span class="progress">. </span>comment<br/>\n' 289 yield '<span class="progress">+ </span>comment with parent_id<br/>\n' 290 yield '<span class="progress">E </span>error handling comment<br/>\n' 291 yield '</div>\n' 292 292 293 293 yield '<ul>' … … 432 432 metadata2.bind = migrate_engine 433 433 434 yield '<div class="message info"> <dl>'435 yield '< dt>.</dt><dd> comment</dd>\n'436 yield '< dt>+</dt><dd> comment with <tt>parent_id</tt></dd>\n'437 yield '< dt>E</dt><dd> Error handling comment</dd>\n'438 yield '</d l></div>\n'434 yield '<div class="message info">' 435 yield '<span class="progress">. </span>comment<br/>\n' 436 yield '<span class="progress">+ </span>comment with parent_id<br/>\n' 437 yield '<span class="progress">E </span>error handling comment<br/>\n' 438 yield '</div>\n' 439 439 440 440 yield '<ul>' -
zine/upgrades/webapp.py
r1331 r1334 119 119 open(self.lockfile, 'w').write('locked on database upgrade\n') 120 120 mdb = ManageDatabase(request.app) 121 db.session.close() # Close open sessions121 db.session.close() # close open sessions 122 122 def finish(): 123 # this runsafter the upgrade finishes123 # this is run from the template after the upgrade finishes 124 124 remove(self.lockfile) 125 db.session.close() # Close open sessions126 self.wants_reload = True # Force application reload125 db.session.close() # close open sessions 126 self.wants_reload = True # force application reload 127 127 return '' # just because I need to return something to jinja 128 128
Note: See TracChangeset
for help on using the changeset viewer.