From 004a80bfaad38f9400e8aebcb8f980353a232295 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 23:53:07 +0100 Subject: PEP-8, Python Zen, refactor and reduce code (thx FedeG) --- pyload/cli/Cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pyload/cli/Cli.py') diff --git a/pyload/cli/Cli.py b/pyload/cli/Cli.py index f05e98b1a..cc285f060 100644 --- a/pyload/cli/Cli.py +++ b/pyload/cli/Cli.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -#Copyright (C) 2008-2014 RaNaN +# Copyright (C) 2008-2014 RaNaN # #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ from pyload.remote.thriftbackend.ThriftClient import ThriftClient, NoConnection, from Getch import Getch from rename_process import renameProcess -class Cli: +class Cli(object): def __init__(self, client, command): self.client = client self.command = command @@ -468,7 +468,7 @@ def writeConfig(opts): cfgfile.write("[cli]") for opt in opts: cfgfile.write("%s=%s\n" % (opt, opts[opt])) - except: + except Exception: print _("Couldn't write user config file") @@ -476,7 +476,7 @@ def main(): config = {"addr": "127.0.0.1", "port": "7227", "language": "en"} try: config["language"] = os.environ["LANG"][0:2] - except: + except Exception: pass if (not exists(join(pypath, "locale", config["language"]))) or config["language"] == "": -- cgit v1.2.3