~ubuntu-branches/ubuntu/karmic/calibre/karmic-updates

« back to all changes in this revision

Viewing changes to src/calibre/trac/donations/server.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-04-05 18:42:16 UTC
  • mfrom: (1.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090405184216-cyb0x4edrwjcaw33
Tags: 0.5.9+dfsg-1
* New upstream release. (Closes: #525339)
* manpages-installation.patch: Encode generated manpages as UTF-8, to avoid
  UnicodeDecodeErrors when writing them out to files.
* debian/control: Demote calibre dependency of calibre-bin to Recommends:,
  which is sufficient and avoids a circular dependency. (Closes: #522059)
* debian/control: Drop build dependency help2man, current version does not
  need it any more.
* debian/control: Drop versioned build dependency on python-mechanize,
  current sid version is enough.
* debian/rules: Copy "setup.py install" command from cdbs'
  python-distutils.mk, since the current version broke this. This is a
  hackish workaround until #525436 gets fixed.
* debian/rules: Drop using $(wildcard ), use `ls`; the former does not work
  any more.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
    
197
197
    def calculate_month_trend(self, days=31):
198
198
        stats = self.get_slice(date.today()-timedelta(days=days-1), date.today())
199
 
        fig = plt.figure(2, (12, 4), 96)#, facecolor, edgecolor, frameon, FigureClass)
 
199
        fig = plt.figure(2, (10, 4), 96)#, facecolor, edgecolor, frameon, FigureClass)
200
200
        fig.clear()
201
201
        ax = fig.add_subplot(111)
202
202
        x = list(range(days-1, -1, -1))
205
205
        ax.set_xlabel('Days ago')
206
206
        ax.set_ylabel('Income ($)')
207
207
        ax.hlines([stats.daily_average], 0, days-1)
 
208
        ax.hlines([stats.daily_average+stats.daily_deviation,
 
209
                   stats.daily_average-stats.daily_deviation], 0, days-1,
 
210
                   linestyle=':',color='r')
208
211
        ax.set_xlim([0, days-1])
209
212
        text = u'''\
210
213
Total: $%(total).2f
216
219
                 ad=stats.average_deviation,
217
220
                 dpd=len(stats.totals)/float(stats.period.days),
218
221
             )
219
 
        text = ax.annotate(text, (0.6, 0.65), textcoords='axes fraction')
 
222
        text = ax.annotate(text, (0.5, 0.65), textcoords='axes fraction')
220
223
        fig.savefig(self.MONTH_TRENDS)
221
224
    
222
225
    def calculate_trend(self):