From 80c16d3d589d47c8b2ffb568e882164050fb2618 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Sat, 1 Jul 2023 13:47:32 +0200 Subject: [PATCH] crash-- --- src/mpm/commands/repo.py | 2 +- src/mpm/commands/server.py | 2 +- src/mpm/model.py | 4 +++- src/mpm/server.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mpm/commands/repo.py b/src/mpm/commands/repo.py index 59d988f..54b7a8f 100644 --- a/src/mpm/commands/repo.py +++ b/src/mpm/commands/repo.py @@ -18,7 +18,7 @@ def list_(ctx): for plugin in sorted(repo.plugins()): rows.append([ click.style(plugin.name, fg='green'), - click.style(plugin.version, fg='yellow') + click.style(str(plugin.version), fg='yellow') ]) if len(rows) > 0: click.echo(columnar(rows, ['Plugin', 'Version'], no_borders=True)) diff --git a/src/mpm/commands/server.py b/src/mpm/commands/server.py index f8b10d7..cd96536 100644 --- a/src/mpm/commands/server.py +++ b/src/mpm/commands/server.py @@ -126,7 +126,7 @@ def sync(ctx): click.echo("Missing plugins:") for state in sorted(missing): click.echo("\t{} {}".format(click.style(state.plugin.name, fg='red'), - click.style(state.plugin.versionSpec, + click.style(str(state.plugin.versionSpec), fg='yellow'))) if len(outdatedLinks) > 0 or len(available) > 0: click.echo("Apply changes? [y/N]", nl=False) diff --git a/src/mpm/model.py b/src/mpm/model.py index 907484b..84916d5 100644 --- a/src/mpm/model.py +++ b/src/mpm/model.py @@ -73,7 +73,9 @@ class UnmanagedFile(PluginState): self.filename = filename def __lt__(self, other): - return self.filename < other.filename + if isinstance(other, UnmanagedFile): + return self.filename < other.filename + return False class OutdatedSymlink(PluginState): def __init__(self, plugin, currentVersion, wantedVersion): diff --git a/src/mpm/server.py b/src/mpm/server.py index 0eabd0f..c5b773f 100644 --- a/src/mpm/server.py +++ b/src/mpm/server.py @@ -10,7 +10,7 @@ class Server: self.pluginPath = self.path+'/plugins' def plugins(self): - return [PluginSpec(p['name'], p['version']) for p in self.config['plugins']] + return [PluginSpec(p['name'], p.get('version', '*')) for p in self.config['plugins']] def add_plugin(self, pluginSpec): for plugin in self.config['plugins']: