~ubuntu-branches/ubuntu/utopic/awn-extras-applets/utopic

« back to all changes in this revision

Viewing changes to applets/maintained/to-do/icon.py

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-03-30 20:26:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100330202640-vza3bdnv9gc9bg5z
Tags: 0.4.0~rc1-0ubuntu1
* New upstream release (rc1) (LP: #551309)
 - Stack applet close on click (LP: #261520)
* debian/patches/
 - 03-remove-cairo-menu-pref.patch: From upstream (r1244 + r1245 + r1252),
   remove menu entry for cairo-menu preferences, it's not implemented
   (LP: #511254)
 - 04-tomboy-threading-free.patch: From upstream (r1246), remove threading to
   make the applet working. 
* debian/*.install: Update installation location of comics and digital 
  applets.
* debian/control: 
 - Move digital applet from python to C, and add proper Replaces.
 - Add Replaces for awn-applets-c-core to handle migration from 0.3.2.2.
   (LP: #524559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  
53
53
  #Get some data
54
54
  num_items = 0
55
 
  for x in settings['items']:
56
 
    if x!='':
57
 
      num_items += 1
 
55
  new_progress = []
 
56
  for i, item in enumerate(settings['items']):
 
57
    if item != '':
 
58
      if len(settings['progress']) > i:
 
59
        if settings['progress'][i] != 100:
 
60
          num_items += 1
 
61
        new_progress.append(settings['progress'][i])
58
62
  
59
63
  #Get the needed data based on the icon type
60
64
  
64
68
      progress = 100
65
69
      number = '100%'
66
70
    else:
67
 
      progress = settings['progress']
68
 
      progress = float(sum(progress))/float(num_items)
 
71
      progress = float(sum(new_progress))/float(len(new_progress))
69
72
      progress = int(progress)
70
73
      number = str(progress)+'%'
71
74
  
75
78
      progress = 100
76
79
      number = '100%'
77
80
    else:
78
 
      progress = settings['progress']
79
 
      progress = float(sum(progress))/float(num_items)
 
81
      progress = float(sum(new_progress))/float(len(new_progress))
80
82
      progress = int(progress)
81
83
      number = str(num_items)
82
84