[Python-checkins] python/dist/src/Mac/Tools/IDE PackageManager.py, 1.14.4.3, 1.14.4.4

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Sat Feb 28 18:23:59 EST 2004


Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29834

Modified Files:
      Tag: release23-maint
	PackageManager.py 
Log Message:
Backport of 1.18:
- Allow easy opening of experimental database, if pimp >= 0.4
- Allow easy access to the PackMan homepage, for even more databases.



Index: PackageManager.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PackageManager.py,v
retrieving revision 1.14.4.3
retrieving revision 1.14.4.4
diff -C2 -d -r1.14.4.3 -r1.14.4.4
*** PackageManager.py	27 Nov 2003 23:20:06 -0000	1.14.4.3
--- PackageManager.py	28 Feb 2004 23:23:57 -0000	1.14.4.4
***************
*** 46,49 ****
--- 46,51 ----
  import pimp
  
+ PACKMAN_HOMEPAGE="http://www.python.org/packman"
+ 
  ELIPSES = '...'
  		
***************
*** 61,64 ****
--- 63,67 ----
  		from Carbon import AE
  		from Carbon import AppleEvents
+ 		self.defaulturl = ""
  		
  		AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, 
***************
*** 81,85 ****
  			if debug_stderr:
  				sys.stderr = debug_stderr
! 		self.opendoc(None)
  		self.mainloop()
  		
--- 84,88 ----
  			if debug_stderr:
  				sys.stderr = debug_stderr
! 		self.domenu_openstandard()
  		self.mainloop()
  		
***************
*** 87,93 ****
--- 90,100 ----
  		m = Wapplication.Menu(self.menubar, "File")
  		newitem = FrameWork.MenuItem(m, "Open Standard Database", "N", 'openstandard')
+ 		newexpitem = FrameWork.MenuItem(m, "Open Experimental Database", None, 'openexperimental')
+ 		newexpitem.enable(pimp.PIMP_VERSION >= "0.4")
  		openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open')
  		openURLitem = FrameWork.MenuItem(m, "Open URL"+ELIPSES, "D", 'openURL')
  		FrameWork.Separator(m)
+ 		moreinfoitem = FrameWork.MenuItem(m, "More Databases", None, 'opendatabasepage')
+ 		FrameWork.Separator(m)
  		closeitem = FrameWork.MenuItem(m, "Close", "W", 'close')
  ##		saveitem = FrameWork.MenuItem(m, "Save", "S", 'save')
***************
*** 148,151 ****
--- 155,160 ----
  	
  	def opendoc(self, url):
+ 		if url:
+ 			self.defaulturl = url
  		PackageBrowser(url)
  	
***************
*** 154,161 ****
  	
  	def do_about(self, id, item, window, event):
! 		EasyDialogs.Message("Package Install Manager for Python")
  	
  	def domenu_openstandard(self, *args):
! 		self.opendoc(None)
  		
  	def domenu_open(self, *args):
--- 163,180 ----
  	
  	def do_about(self, id, item, window, event):
! 		EasyDialogs.Message("Package Install Manager for Python\nPackMan engine (pimp) version: %s" %
! 			pimp.PIMP_VERSION)
  	
  	def domenu_openstandard(self, *args):
! 		if pimp.PIMP_VERSION >= "0.4":
! 			url = pimp.getDefaultDatabase()
! 		else:
! 			# 0.3 compatibility
! 			url = None
! 		self.opendoc(url)
! 		
! 	def domenu_openexperimental(self, *args):
! 		database = pimp.getDefaultDatabase(experimental=True)
! 		self.opendoc(database)
  		
  	def domenu_open(self, *args):
***************
*** 172,184 ****
  			yes="OK", no="")
  		if ok <= 0: return
! 		url = EasyDialogs.AskString("URL of database to open:", ok="Open")
  		if url:
  			self.opendoc(url)
  	
! 	def domenu_openbyname(self, *args):
! 		url = EasyDialogs.AskString("Open URL:", ok="Open")
! 		if url:
! 			self.opendoc(url)
! 		
  	def makeopenwindowsmenu(self):
  		for i in range(len(self.openwindowsmenu.items)):
--- 191,204 ----
  			yes="OK", no="")
  		if ok <= 0: return
! 		url = EasyDialogs.AskString("URL of database to open:", 
! 			default=self.defaulturl, ok="Open")
  		if url:
  			self.opendoc(url)
  	
! 	def domenu_opendatabasepage(self):
! 		import ic
! 			
! 		icr = ic.IC()
! 		icr.launchurl(PACKMAN_HOMEPAGE)
  	def makeopenwindowsmenu(self):
  		for i in range(len(self.openwindowsmenu.items)):




More information about the Python-checkins mailing list