--- a/plugin_pack.py Thu Apr 06 01:07:57 2017 -0300
+++ b/plugin_pack.py Thu Apr 06 01:11:32 2017 -0300
@@ -37,7 +37,6 @@
@@ -84,9 +83,9 @@
output = 'name: {}\n'.format(self.name)
- output += 'authors: {}\n'.format(string.join(self.authors, ', '))
+ output += 'authors: {}\n'.format(', '.join(self.authors)) output += 'type: {}\n'.format(self.type)
- output += 'depends: {}\n'.format(string.join(self.depends, ' '))
+ output += 'depends: {}\n'.format(' '.join(self.depends)) output += 'provides: {}\n'.format(self.provides)
output += 'directory: {}\n'.format(self.directory)
output += 'summary: {}\n'.format(self.summary)
@@ -97,6 +96,10 @@
+ def __lt__(self, other): + return self.name < other.name @@ -164,7 +167,7 @@
names.append(plugin.name)
- print(string.join(names, ','))
def default_plugins(self):
return self.list_type('default')
@@ -207,12 +210,12 @@
cmds = self.commands.keys()
- print(' {}'.format(string.join(cmds, ' ')))
+ print(' {}'.format(' '.join(cmds))) def dist_dirs(self, args):
"""Displays a list of all plugin directories to included in the distribution"""
- print(string.join(self.unique_dirs(), ' '))
+ print(' '.join(self.unique_dirs())) commands['dist_dirs'] = dist_dirs
def build_dirs(self, args):
@@ -309,7 +312,7 @@
- print("{}".format(string.join(output, ',')))
+ print("{}".format(','.join(output))) commands['build_dirs'] = build_dirs
def list_plugins(self, args):
@@ -353,13 +356,12 @@
print('++-{}-{}-{}'.format('=' * (widths[0]), '=' * (widths[1]), '=' * (widths[2])))
- fmt = '{}{} {:<' + widths[0] + '} {:<' + widths[1] + '} {}'
+ fmt = '{}{} {:<' + str(widths[0]) + '} {:<' + str(widths[1]) + '} {}' # now loop through the list again, with everything formatted
+ keys = sorted(list(data.keys()))
print(fmt.format(d[0], d[1], d[2], d[3], d[4]))
commands['list'] = list_plugins
@@ -519,7 +521,7 @@
counts['pidgin'] = len(self.pidgin_plugins())
- return "%3d ({:6.2}%)".format(val, (float(val) / float(counts['total'])) * 100.0)
+ return "%3d ({:6.2f}%)".format(val, (float(val) / float(counts['total'])) * 100.0) print('{}\n\n{}\n\n{}\n{}\n{}\n{}\n\n{}\n{}\n{}\n{}'.format(
"Purple Plugin Pack Stats", "{} plugins in total".format(counts['total']),