~brian-murray/update-manager/no-zero-byte-files

« back to all changes in this revision

Viewing changes to UpdateManager/MetaReleaseGObject.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2007-02-07 18:02:35 UTC
  • Revision ID: james.westby@ubuntu.com-20070207180235-i0mgzoi54v54ezq7
Tags: 0.56
* added --proposed switch to fetch a release-upgrader from a different
  location (similar to the -proposed pocket in the archive)
* split into update-manager and update-manager-core and support
  cli release upgrades with the later
* added fdsend module to support file descriptor passing over sockets
  this will allow a better seperation between frontend and backend
  in the future

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  Copyright (c) 2004-2007 Canonical
 
2
#  
 
3
#  Author: Michael Vogt <michael.vogt@ubuntu.com>
 
4
 
5
#  This program is free software; you can redistribute it and/or 
 
6
#  modify it under the terms of the GNU General Public License as 
 
7
#  published by the Free Software Foundation; either version 2 of the
 
8
#  License, or (at your option) any later version.
 
9
 
10
#  This program is distributed in the hope that it will be useful,
 
11
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#  GNU General Public License for more details.
 
14
 
15
#  You should have received a copy of the GNU General Public License
 
16
#  along with this program; if not, write to the Free Software
 
17
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
18
#  USA
 
19
 
 
20
import pygtk
 
21
pygtk.require('2.0')
 
22
import gobject
 
23
import thread
 
24
import urllib2
 
25
import os
 
26
import string
 
27
import apt_pkg
 
28
import time
 
29
import rfc822
 
30
from subprocess import Popen,PIPE
 
31
from Core.MetaRelease import MetaReleaseCore
 
32
 
 
33
class MetaRelease(MetaReleaseCore,gobject.GObject):
 
34
 
 
35
    __gsignals__ = { 
 
36
        'new_dist_available' : (gobject.SIGNAL_RUN_LAST,
 
37
                                gobject.TYPE_NONE,
 
38
                                (gobject.TYPE_PYOBJECT,)),
 
39
        'dist_no_longer_supported' : (gobject.SIGNAL_RUN_LAST,
 
40
                                      gobject.TYPE_NONE,
 
41
                                      ())
 
42
 
 
43
        }
 
44
 
 
45
    def __init__(self, useDevelopmentRelase=False, useProposed=False):
 
46
        gobject.GObject.__init__(self)
 
47
        MetaReleaseCore.__init__(self, useDevelopmentRelase, useProposed)
 
48
        # in the gtk space to test if the download already finished
 
49
        # this is needed because gtk is not thread-safe
 
50
        gobject.timeout_add(1000, self.check)
 
51
 
 
52
    def check(self):
 
53
        # check if we have a metarelease_information file
 
54
        keepRuning = True
 
55
        if self.no_longer_supported is not None:
 
56
            keepRuning = False
 
57
            self.emit("dist_no_longer_supported",self.no_longer_supported )
 
58
        if self.new_dist is not None:
 
59
            keepRuning = False
 
60
            self.emit("new_dist_available", self.new_dist)            
 
61
        return keepRuning
 
62
 
 
63