Changeset 2435 for package_branches/invirt-web/cherrypy/code
- Timestamp:
- Aug 11, 2009, 1:15:07 AM (15 years ago)
- Location:
- package_branches/invirt-web/cherrypy/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy/code/ajaxterm.py
r2430 r2435 321 321 def dumplatin1(self): 322 322 return self.dump().translate(self.trl1) 323 def dumphtml(self,color=1 ):323 def dumphtml(self,color=1,force=False): 324 324 h=self.height 325 325 w=self.width … … 344 344 span+='\n' 345 345 r='<?xml version="1.0" encoding="ISO-8859-1"?><pre class="term">%s</pre>'%r 346 if self.last_html==r :346 if self.last_html==r and not force: 347 347 return '<?xml version="1.0"?><idem></idem>' 348 348 else: … … 437 437 except (IOError,OSError): 438 438 self.proc_kill(fd) 439 def dump(self,fd,color=1 ):439 def dump(self,fd,color=1,force=False): 440 440 try: 441 return self.proc[fd]['term'].dumphtml(color )441 return self.proc[fd]['term'].dumphtml(color, force) 442 442 except KeyError: 443 443 return False -
package_branches/invirt-web/cherrypy/code/main.py
r2434 r2435 298 298 299 299 @cherrypy.expose 300 def at(self, machine_id, k=None, c=0 ):300 def at(self, machine_id, k=None, c=0, force=0): 301 301 machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine 302 302 if machine_id in self.atsessions: … … 310 310 self.atmulti.proc_write(term,k) 311 311 time.sleep(0.002) 312 dump=self.atmulti.dump(term,c )312 dump=self.atmulti.dump(term,c,int(force)) 313 313 cherrypy.response.headers['Content-Type']='text/xml' 314 314 if isinstance(dump,str): 315 315 return dump 316 316 else: 317 print "Removing session for", machine_id 317 318 del self.atsessions[machine_id] 318 319 return '<?xml version="1.0"?><idem></idem>' -
package_branches/invirt-web/cherrypy/code/static/ajaxterm/ajaxterm.js
r2433 r2435 13 13 var sending=0; 14 14 var rmax=1; 15 var force=true; 15 16 16 17 var div=document.getElementById(id); … … 103 104 } 104 105 var query=query1+send; 106 if (force) { 107 query=query+"&force=1"; 108 force=false; 109 } 105 110 if(opt_get.className=='on') { 106 111 r.open("GET",base_path+"?"+query,true); … … 270 275 document.onkeypress=keypress; 271 276 document.onkeydown=keydown; 277 force=true; 272 278 timeout=window.setTimeout(update,100); 273 279 }
Note: See TracChangeset
for help on using the changeset viewer.