@@ -305,7 +305,8 @@ def getbrowserdata(self, show_hidden=1):
305305 name = pkg .fullname ()
306306 status , _ = pkg .installed ()
307307 description = pkg .description ()
308- rv .append ((status , name , description ))
308+ description_line1 = description .split ('\n ' )[0 ]
309+ rv .append ((status , name , description_line1 ))
309310 return rv
310311
311312 def getstatus (self , number ):
@@ -333,19 +334,22 @@ def close(self):
333334 self .closepimp ()
334335
335336 def setupwidgets (self ):
337+ DESCRIPTION_HEIGHT = 140
336338 INSTALL_POS = - 30
337- STATUS_POS = INSTALL_POS - 70
338- self .w = W .Window ((580 , 400 ), "Python Install Manager" , minsize = (400 , 200 ), tabbable = 0 )
339+ STATUS_POS = INSTALL_POS - ( 70 + DESCRIPTION_HEIGHT )
340+ self .w = W .Window ((580 , 600 ), "Python Install Manager" , minsize = (400 , 400 ), tabbable = 0 )
339341 self .w .titlebar = W .TextBox ((4 , 8 , 60 , 18 ), 'Packages:' )
340342 self .w .hidden_button = W .CheckBox ((- 100 , 4 , 0 , 18 ), 'Show Hidden' , self .updatestatus )
341343 data = self .getbrowserdata ()
342344 self .w .packagebrowser = W .MultiList ((4 , 24 , 0 , STATUS_POS - 2 ), data , self .listhit , cols = 3 )
343345
344- self .w .installed_l = W .TextBox ((4 , STATUS_POS , 60 , 12 ), 'Installed:' )
345- self .w .installed = W .TextBox ((64 , STATUS_POS , 0 , 12 ), '' )
346- self .w .message_l = W .TextBox ((4 , STATUS_POS + 20 , 60 , 12 ), 'Status:' )
347- self .w .message = W .TextBox ((64 , STATUS_POS + 20 , 0 , 12 ), '' )
346+ self .w .installed_l = W .TextBox ((4 , STATUS_POS , 70 , 12 ), 'Installed:' )
347+ self .w .installed = W .TextBox ((74 , STATUS_POS , 0 , 12 ), '' )
348+ self .w .message_l = W .TextBox ((4 , STATUS_POS + 20 , 70 , 12 ), 'Status:' )
349+ self .w .message = W .TextBox ((74 , STATUS_POS + 20 , 0 , 12 ), '' )
348350 self .w .homepage_button = W .Button ((4 , STATUS_POS + 40 , 96 , 18 ), 'View homepage' , self .do_homepage )
351+ self .w .description_l = W .TextBox ((4 , STATUS_POS + 70 , 70 , 12 ), 'Description:' )
352+ self .w .description = W .EditText ((74 , STATUS_POS + 70 , 0 , DESCRIPTION_HEIGHT - 4 ))
349353
350354 self .w .divline = W .HorizontalLine ((0 , INSTALL_POS - 4 , 0 , 0 ))
351355 self .w .verbose_button = W .CheckBox ((84 , INSTALL_POS + 4 , 60 , 18 ), 'Verbose' )
@@ -355,6 +359,7 @@ def setupwidgets(self):
355359 self .w .user_button = W .CheckBox ((340 , INSTALL_POS + 4 , 140 , 18 ), 'For Current User Only' , self .do_user )
356360 self .w .install_button = W .Button ((4 , INSTALL_POS + 4 , 56 , 18 ), 'Install:' , self .do_install )
357361 self .w .open ()
362+ self .w .description .enable (0 )
358363
359364 def updatestatus (self ):
360365 sel = self .w .packagebrowser .getselection ()
@@ -366,6 +371,7 @@ def updatestatus(self):
366371 self .w .message .set ('' )
367372 self .w .install_button .enable (0 )
368373 self .w .homepage_button .enable (0 )
374+ self .w .description .set ('' )
369375 self .w .verbose_button .enable (0 )
370376 self .w .recursive_button .enable (0 )
371377 self .w .force_button .enable (0 )
@@ -378,6 +384,10 @@ def updatestatus(self):
378384 self .w .message .set (message )
379385 self .w .install_button .enable (installed != "yes" or self .w .force_button .get ())
380386 self .w .homepage_button .enable (not not self .packages [sel ].homepage ())
387+ description = self .packages [sel ].description ()
388+ description = description .split ('\r \n ' )
389+ description = '\r ' .join (description )
390+ self .w .description .set (description )
381391 self .w .verbose_button .enable (1 )
382392 self .w .recursive_button .enable (1 )
383393 self .w .force_button .enable (1 )
0 commit comments