Commits

Maytag Metalark committed a1bba5c

Added footer to gonzo_push

Comments (0)

Files changed (2)

 import time
 
 from gonzo_out import Output
+from gonzo_web_common import VER_MAJOR, VER_MINOR
 
 class GonzoPushHandler(gonzo_web_common.GonzoCommonHandler):
     def serverAppName(self):
 """
         else:
             content += """
+        %(message)s
         <form action="upload" method="post" target="output_frame" enctype="multipart/form-data" onsubmit="formSubmit();">
             <input type="file" name="ufile" title="Choose a file to upload." /><br />
             <input type="submit" name="submit" value="Upload" />
         <iframe name="output_frame" src="" id="output_frame" width="400" height="400">
         </iframe>  
 
+        <hr />
+        <footer>
+            <p>
+                <em>
+                    Powered by
+                    <a href='https://bitbucket.org/bmearns/gonzo-ftp' title='Gonzo FTP'>Gonzo FTP</a> v%(vmaj)d.%(vmin)d
+                    - For no-hassle, no-setup, one-off file transfers.
+                </em>
+            </p>
+        </footer>
+
         <script type='text/javascript'>
         // <![CDATA[
 
                                 field = field.substring(0, field.length-1);
                                 if(field == "already completed") {
                                     stattext.nodeValue = "File was already uploaded.";
-                                    progfill.style.width = "100%";
+                                    progfill.style.width = "100%%";
                                     progfill.className = "already completed";
                                 }
                                 else if(field == "canceled") {
                                     stattext.nodeValue = "Upload aborted by server.";
                                 }
                                 else if(field == "done") {
-                                    progfill.style.width = "100%";
+                                    progfill.style.width = "100%%";
                                     progfill.className = "completed";
                                     stattext.nodeValue = "Upload complete.";
                                 }
                                             sizeFound = true;
                                             size = null;
                                             progfill.className = "indeterm";
-                                            progfill.style.width = "100%";
+                                            progfill.style.width = "100%%";
                                         }
                                         value = parseInt(field);
                                         if(!sizeFound) {
                                             if(size != null) {
                                                 var pct = value / size;
                                                 progfill.style.width = parseInt(400 * pct) + "px";
-                                                stattext.nodeValue = (parseInt(100.0*pct*10)/10) + "% (" + value + " / " + size + " bytes)";
+                                                stattext.nodeValue = (parseInt(100.0*pct*10)/10) + "%% (" + value + " / " + size + " bytes)";
                                             } else {
                                                 stattext.nodeValue = value + " bytes (total size unknown)";
                                             }
 
         //]]>
         </script>
-"""
+""" % {
+    "message": self.server.customMessage(),
+    "vmaj": VER_MAJOR,
+    "vmin": VER_MINOR,
+}
 
         content += """
     </body>

gonzo_web_common.py

 from gonzo_out import Output
 
 VER_MAJOR = 0
-VER_MINOR = 1
+VER_MINOR = 2
 VER_PATCH = 0
 
 class GonzoCommonHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.