Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: dart/site/try/add_time_stamp.py

Issue 139513003: Add timestamp to AppCache manifest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/site/try/build_try.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
5
6 import sys
7 import re
kustermann 2014/01/16 14:31:37 "re" is not used, is it?
ahe 2014/01/16 16:03:48 Done.
8 import time
9
10 def Main():
11 (_, input_file_name, output_file_name) = sys.argv
12 if not input_file_name or not output_file_name:
13 raise Exception('Missing argument')
14
15 input_file = open(input_file_name, 'r')
16 output_file = open(output_file_name, 'w')
17 timestamp = str(time.time())
kustermann 2014/01/16 14:31:37 If I understand it correctly, the only thing you w
ahe 2014/01/16 16:03:48 That's actually what I wanted, but I didn't want t
18
19 for line in input_file:
20 if '@@TIMESTAMP@@' in line:
21 line = line.replace('@@TIMESTAMP@@', timestamp)
22 print >> output_file, line,
23
24 input_file.close()
25 output_file.close()
kustermann 2014/01/16 14:31:37 You could make this a bit more readable: with ope
ahe 2014/01/16 16:03:48 Thank you, I had forgotten about "with". "input" i
26
27
28 if __name__ == '__main__':
29 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | dart/site/try/build_try.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698