Adding the ignore file
[gc-dialer] / support / fake_py2deb.py
1 import pprint
2
3
4 class Py2deb(object):
5
6         def __init__(self, appName):
7                 self._appName = appName
8                 self.description = ""
9                 self.author = ""
10                 self.mail = ""
11                 self.license = ""
12                 self.depends = ""
13                 self.section = ""
14                 self.arch = ""
15                 self.ugency = ""
16                 self.distribution = ""
17                 self.repository = ""
18                 self.changelog = ""
19                 self.postinstall = ""
20                 self.icon = ""
21                 self._install = {}
22
23         def generate(self, appVersion, appBuild, changelog, tar, dsc, changes, build, src):
24                 return """
25 Package: %s
26 version: %s-%s
27 Changes:
28 %s
29
30 Build Options:
31         Tar: %s
32         Dsc: %s
33         Changes: %s
34         Build: %s
35         Src: %s
36                 """ % (
37                         self._appName, appVersion, appBuild, changelog, tar, dsc, changes, build, src
38                 )
39
40         def __str__(self):
41                 parts = []
42                 parts.append("%s Package Settings:" % (self._appName, ))
43                 for settingName in dir(self):
44                         if settingName.startswith("_"):
45                                 continue
46                         parts.append("\t%s: %s" % (settingName, getattr(self, settingName)))
47
48                 parts.append(pprint.pformat(self._install))
49
50                 return "\n".join(parts)
51
52         def __getitem__(self, key):
53                 return self._install[key]
54
55         def __setitem__(self, key, item):
56                 self._install[key] = item