~brian-murray/ubuntu/natty/apport/rr-if-idontknow

« back to all changes in this revision

Viewing changes to apport/packaging.py

  • Committer: Martin Pitt
  • Date: 2011-02-04 14:41:46 UTC
  • mfrom: (1369.34.52 trunk)
  • Revision ID: martin.pitt@canonical.com-20110204144146-o0fq0kh4shzsutr3
new upstream release 1.17.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        
16
16
        Throw ValueError if package does not exist.
17
17
        '''
18
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
18
        raise NotImplementedError('this method must be implemented by a concrete subclass')
19
19
 
20
20
    def get_available_version(self, package):
21
21
        '''Return the latest available version of a package.
22
22
        
23
23
        Throw ValueError if package does not exist.
24
24
        '''
25
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
25
        raise NotImplementedError('this method must be implemented by a concrete subclass')
26
26
 
27
27
    def get_dependencies(self, package):
28
28
        '''Return a list of packages a package depends on.'''
29
29
 
30
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
30
        raise NotImplementedError('this method must be implemented by a concrete subclass')
31
31
 
32
32
    def get_source(self, package):
33
33
        '''Return the source package name for a package.
34
34
        
35
35
        Throw ValueError if package does not exist.
36
36
        '''
37
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
37
        raise NotImplementedError('this method must be implemented by a concrete subclass')
38
38
 
39
39
    def is_distro_package(self, package):
40
40
        '''Check package origin.
44
44
 
45
45
        Throw ValueError if package does not exist.
46
46
        '''
47
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
47
        raise NotImplementedError('this method must be implemented by a concrete subclass')
48
48
 
49
49
    def get_architecture(self, package):
50
50
        '''Return the architecture of a package.
52
52
        This might differ on multiarch architectures (e. g.  an i386 Firefox
53
53
        package on a x86_64 system)
54
54
        '''
55
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
55
        raise NotImplementedError('this method must be implemented by a concrete subclass')
56
56
 
57
57
    def get_files(self, package):
58
58
        '''Return list of files shipped by a package.
59
59
 
60
60
        Throw ValueError if package does not exist.
61
61
        '''
62
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
62
        raise NotImplementedError('this method must be implemented by a concrete subclass')
63
63
 
64
64
    def get_modified_files(self, package):
65
65
        '''Return list of all modified files of a package.'''
66
66
 
67
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
67
        raise NotImplementedError('this method must be implemented by a concrete subclass')
68
68
 
69
69
    def get_file_package(self, file, uninstalled=False, map_cachedir=None):
70
70
        '''Return the package a file belongs to.
77
77
        an existing directory which will be used to permanently store the
78
78
        downloaded maps. If it is not set, a temporary directory will be used.
79
79
        '''
80
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
80
        raise NotImplementedError('this method must be implemented by a concrete subclass')
81
81
 
82
82
    def get_system_architecture(self):
83
83
        '''Return the architecture of the system.
84
84
        
85
85
        This should use the notation of the particular distribution.
86
86
        '''
87
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
87
        raise NotImplementedError('this method must be implemented by a concrete subclass')
88
88
 
89
89
    def set_mirror(self, url):
90
90
        '''Explicitly set a distribution mirror URL.
95
95
        By default, the mirror will be read from the system configuration
96
96
        files.
97
97
        '''
98
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
98
        raise NotImplementedError('this method must be implemented by a concrete subclass')
99
99
 
100
100
    def get_source_tree(self, srcpackage, dir, version=None):
101
101
        '''Download a source package and unpack it into dir..
112
112
        (which might be a subdirectory of dir). Return None if the source is
113
113
        not available.
114
114
        '''
115
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
115
        raise NotImplementedError('this method must be implemented by a concrete subclass')
116
116
 
117
117
    def compare_versions(self, ver1, ver2):
118
118
        '''Compare two package versions.
119
119
 
120
120
        Return -1 for ver < ver2, 0 for ver1 == ver2, and 1 for ver1 > ver2.
121
121
        '''
122
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
122
        raise NotImplementedError('this method must be implemented by a concrete subclass')
123
123
 
124
124
    def enabled(self):
125
125
        '''Return whether Apport should generate crash reports.
132
132
        Implementations should parse the configuration file which controls
133
133
        Apport (such as /etc/default/apport in Debian/Ubuntu).
134
134
        '''
135
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
135
        raise NotImplementedError('this method must be implemented by a concrete subclass')
136
136
 
137
137
    def get_kernel_package(self):
138
138
        '''Return the actual Linux kernel package name.
139
139
 
140
140
        This is used when the user reports a bug against the "linux" package.
141
141
        '''
142
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
142
        raise NotImplementedError('this method must be implemented by a concrete subclass')
143
143
 
144
144
    def install_retracing_packages(self, report, verbosity=0,
145
145
            unpack_only=False, no_pkg=False, extra_packages=[]):
157
157
        
158
158
        Return a tuple (list of installed packages, string with outdated packages).
159
159
        '''
160
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
160
        raise NotImplementedError('this method must be implemented by a concrete subclass')
161
161
 
162
162
    def remove_packages(self, packages, verbosity=0):
163
163
        '''Remove packages.
165
165
        This is called after install_retracing_packages() to clean up again
166
166
        afterwards. packages is a list of package names.
167
167
        '''
168
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
168
        raise NotImplementedError('this method must be implemented by a concrete subclass')
169
169
 
170
170
    def package_name_glob(self, glob):
171
171
        '''Return known package names which match given glob.'''
172
172
 
173
 
        raise NotImplementedError, 'this method must be implemented by a concrete subclass'
 
173
        raise NotImplementedError('this method must be implemented by a concrete subclass')
174
174
 
175
 
import packaging_impl
 
175
import apport.packaging_impl