mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
allow commands that are .pyc files to be used
This commit is contained in:
parent
7e19a11521
commit
9af41fd457
2 changed files with 6 additions and 3 deletions
|
@ -11,6 +11,7 @@
|
||||||
* Escape hyphens in the manpage
|
* Escape hyphens in the manpage
|
||||||
* Make the delete key work
|
* Make the delete key work
|
||||||
* Allow ~ to be used in the path in the add command
|
* Allow ~ to be used in the path in the add command
|
||||||
|
* Allow commands that are .pyc files to be used
|
||||||
|
|
||||||
=== Deluge 1.2.0_rc3 (01 November 2009) ===
|
=== Deluge 1.2.0_rc3 (01 November 2009) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -124,10 +124,12 @@ def load_commands(command_dir, exclude=[]):
|
||||||
try:
|
try:
|
||||||
commands = []
|
commands = []
|
||||||
for filename in os.listdir(command_dir):
|
for filename in os.listdir(command_dir):
|
||||||
if filename.split('.')[0] in exclude or filename.startswith('_') or not filename.endswith('.py'):
|
if filename.split('.')[0] in exclude or filename.startswith('_'):
|
||||||
continue
|
continue
|
||||||
cmd = get_command(filename[:-3])
|
if not (filename.endswith('.py') or filename.endswith('.pyc')):
|
||||||
aliases = [ filename[:-3] ]
|
continue
|
||||||
|
cmd = get_command(filename.split('.')[len(filename.split('.')) - 2])
|
||||||
|
aliases = [ filename.split('.')[len(filename.split('.')) - 2] ]
|
||||||
aliases.extend(cmd.aliases)
|
aliases.extend(cmd.aliases)
|
||||||
for a in aliases:
|
for a in aliases:
|
||||||
commands.append((a, cmd))
|
commands.append((a, cmd))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue