1
# Copyright (c) 2004-2007 Canonical
2
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*-
4
# Author: Michael Vogt <michael.vogt@ubuntu.com>
6
# This program is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU General Public License as
8
# published by the Free Software Foundation; either version 2 of the
9
# License, or (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21
from __future__ import absolute_import
23
from gi.repository import GLib
24
from gi.repository import GObject
25
from .Core.MetaRelease import MetaReleaseCore
28
class MetaRelease(MetaReleaseCore, GObject.GObject):
31
'new_dist_available': (GObject.SignalFlags.RUN_LAST,
33
(GObject.TYPE_PYOBJECT,)),
34
'dist_no_longer_supported': (GObject.SignalFlags.RUN_LAST,
37
'done_downloading': (GObject.SignalFlags.RUN_LAST,
42
def __init__(self, useDevelopmentRelease=False, useProposed=False,
44
GObject.GObject.__init__(self)
45
MetaReleaseCore.__init__(self, useDevelopmentRelease, useProposed,
47
# in the gtk space to test if the download already finished
48
# this is needed because gtk is not thread-safe
49
GLib.timeout_add_seconds(1, self.check)
52
# check if we have a metarelease_information file
53
if self.no_longer_supported is not None:
54
self.emit("dist_no_longer_supported")
55
if self.new_dist is not None:
56
self.emit("new_dist_available", self.new_dist)
60
self.emit("done_downloading")