26
26
print ('File Not Found: %s' % src_html )
27
27
sys .exit (1 )
28
28
29
- source_xml = minidom .parse (src_html )
29
+ source_xml = minidom .parse (src_html )
30
30
source = None #this is the target <div id="source">...</div>
31
31
divs = source_xml .getElementsByTagName (r'div' )
32
32
for d in divs :
@@ -77,7 +77,7 @@ def writeToSource():
77
77
size = int (os .path .getsize (F )/ (2 ** 20 ))
78
78
date = time .strftime ('%Y-%m-%d' , FnD [0 ])
79
79
name = F .split (os .path .sep )[- 1 ]
80
-
80
+
81
81
tr = source_xml .createElement (r'tr' )
82
82
if first :
83
83
tr .setAttribute (r'class' ,'first' )
@@ -86,27 +86,27 @@ def writeToSource():
86
86
tr .setAttribute (r'class' , 'even' )
87
87
else :
88
88
tr .setAttribute (r'class' , 'odd' )
89
-
89
+
90
90
td = source_xml .createElement (r'td' )
91
91
td .appendChild (source_xml .createTextNode (str (release )))
92
92
tr .appendChild (td )
93
-
93
+
94
94
td = source_xml .createElement (r'td' )
95
95
print (name )
96
96
a = source_xml .createElement (r'a' )
97
97
a .setAttribute (r'href' , F .replace (os .path .sep + r'www' , '' ))
98
98
a .appendChild (source_xml .createTextNode (name ))
99
99
td .appendChild (a )
100
- tr .appendChild (td )
101
-
100
+ tr .appendChild (td )
101
+
102
102
td = source_xml .createElement (r'td' )
103
103
td .appendChild (source_xml .createTextNode ('%s MB' % size ))
104
104
tr .appendChild (td )
105
-
105
+
106
106
td = source_xml .createElement (r'td' )
107
107
td .appendChild (source_xml .createTextNode (date ))
108
108
tr .appendChild (td )
109
-
109
+
110
110
table_body .appendChild (tr )
111
111
release -= 1
112
112
@@ -123,33 +123,33 @@ def writeToSource():
123
123
size = int (os .path .getsize (F )/ (2 ** 20 ))
124
124
date = time .strftime ('%Y-%m-%d' , FnD [0 ])
125
125
name = F .split (os .path .sep )[- 1 ]
126
-
126
+
127
127
tr = source_xml .createElement (r'tr' )
128
128
if release % 2 == 0 :
129
129
tr .setAttribute (r'class' , 'even' )
130
130
else :
131
131
tr .setAttribute (r'class' , 'odd' )
132
-
132
+
133
133
td = source_xml .createElement (r'td' )
134
134
td .appendChild (source_xml .createTextNode (str (release )))
135
135
tr .appendChild (td )
136
-
136
+
137
137
td = source_xml .createElement (r'td' )
138
138
print (name , F )
139
139
a = source_xml .createElement (r'a' )
140
140
a .setAttribute (r'href' , 'http://www.sagemath.org/src-old' + F .replace (src_old , '' ))
141
141
a .appendChild (source_xml .createTextNode (name ))
142
142
td .appendChild (a )
143
- tr .appendChild (td )
144
-
143
+ tr .appendChild (td )
144
+
145
145
td = source_xml .createElement (r'td' )
146
146
td .appendChild (source_xml .createTextNode ('%s MB' % size ))
147
147
tr .appendChild (td )
148
-
148
+
149
149
td = source_xml .createElement (r'td' )
150
150
td .appendChild (source_xml .createTextNode (date ))
151
151
tr .appendChild (td )
152
-
152
+
153
153
table_body .appendChild (tr )
154
154
release -= 1
155
155
@@ -161,6 +161,4 @@ def writeToSource():
161
161
162
162
source_xml .writexml (utils .UnicodeFileWriter ( open (src_html , "w" )))
163
163
164
-
165
164
#utils.delFirstLine(src_html)
166
-
0 commit comments