mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Add "Log info" to view rcs log.
Speed up __getattr__ by storing the value as self.<key>.
This commit is contained in:
		
							parent
							
								
									d7bfa80c63
								
							
						
					
					
						commit
						f701bf1098
					
				
					 1 changed files with 33 additions and 4 deletions
				
			
		|  | @ -4,6 +4,8 @@ | ||||||
| 
 | 
 | ||||||
| XXX TO DO | XXX TO DO | ||||||
| 
 | 
 | ||||||
|  | - customize rcs command pathnames | ||||||
|  | - recognize urls and email addresses and turn them into <A> tags | ||||||
| - use cookies to keep Name/email the same | - use cookies to keep Name/email the same | ||||||
| - explanation of editing somewhere | - explanation of editing somewhere | ||||||
| - various embellishments, GIFs, crosslinks, hints, etc. | - various embellishments, GIFs, crosslinks, hints, etc. | ||||||
|  | @ -23,7 +25,7 @@ | ||||||
| 
 | 
 | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
| import cgi, string, os | import cgi, string, os, sys | ||||||
| 
 | 
 | ||||||
| NAMEPAT = "faq??.???.htp" | NAMEPAT = "faq??.???.htp" | ||||||
| NAMEREG = "^faq\([0-9][0-9]\)\.\([0-9][0-9][0-9]\)\.htp$" | NAMEREG = "^faq\([0-9][0-9]\)\.\([0-9][0-9][0-9]\)\.htp$" | ||||||
|  | @ -50,8 +52,9 @@ def __getattr__(self, key): | ||||||
| 	if key not in self.KEYS: | 	if key not in self.KEYS: | ||||||
| 	    raise AttributeError | 	    raise AttributeError | ||||||
| 	try: | 	try: | ||||||
| 	    item = self.form[key] | 	    value = self.form[key].value | ||||||
| 	    return item.value | 	    setattr(self, key, value) | ||||||
|  | 	    return value | ||||||
| 	except KeyError: | 	except KeyError: | ||||||
| 	    return '' | 	    return '' | ||||||
| 
 | 
 | ||||||
|  | @ -339,6 +342,29 @@ def do_review(self): | ||||||
| 	<HR> | 	<HR> | ||||||
| 	""" % name | 	""" % name | ||||||
| 
 | 
 | ||||||
|  |     def do_info(self): | ||||||
|  | 	name = self.name | ||||||
|  | 	headers, text = self.read(name) | ||||||
|  | 	if not headers: | ||||||
|  | 	    print "Invalid file name", name | ||||||
|  | 	    return | ||||||
|  | 	print '<PRE>' | ||||||
|  | 	sys.stdout.flush() | ||||||
|  | 	os.system("/depot/gnu/plat/bin/rlog -r %s </dev/null 2>&1" % self.name) | ||||||
|  | 	print '</PRE>' | ||||||
|  | 	print '<A HREF="faq.py?req=rlog&name=%s">View full rcs log</A>' % name | ||||||
|  | 
 | ||||||
|  |     def do_rlog(self): | ||||||
|  | 	name = self.name | ||||||
|  | 	headers, text = self.read(name) | ||||||
|  | 	if not headers: | ||||||
|  | 	    print "Invalid file name", name | ||||||
|  | 	    return | ||||||
|  | 	print '<PRE>' | ||||||
|  | 	sys.stdout.flush() | ||||||
|  | 	os.system("/depot/gnu/plat/bin/rlog %s </dev/null 2>&1" % self.name) | ||||||
|  | 	print '</PRE>' | ||||||
|  | 
 | ||||||
|     def checkin(self): |     def checkin(self): | ||||||
| 	import regsub, time, tempfile | 	import regsub, time, tempfile | ||||||
| 	name = self.name | 	name = self.name | ||||||
|  | @ -517,7 +543,10 @@ def show(self, name, title, text, edit=0): | ||||||
| 	    pre = 0 | 	    pre = 0 | ||||||
| 	print '<P>' | 	print '<P>' | ||||||
| 	if edit: | 	if edit: | ||||||
| 	    print '<A HREF="faq.py?req=edit&name=%s">Edit this entry</A>' %name | 	    print """ | ||||||
|  | 	    <A HREF="faq.py?req=edit&name=%s">Edit this entry</A> / | ||||||
|  | 	    <A HREF="faq.py?req=info&name=%s" TARGET=_blank>Log info</A> | ||||||
|  | 	    """ % (name, name) | ||||||
| 	    print '<P>' | 	    print '<P>' | ||||||
| 	print "<HR>" | 	print "<HR>" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum