Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Buquet
poezio
Commits
3e2839f7
Commit
3e2839f7
authored
Jun 30, 2016
by
mathieui
Browse files
Only import "Command" instead of "core" when possible
parent
8383f773
Changes
2
Hide whitespace changes
Inline
Side-by-side
poezio/plugin_manager.py
View file @
3e2839f7
...
...
@@ -9,8 +9,8 @@ import os
from
os
import
path
import
logging
from
poezio
import
core
from
poezio
import
tabs
from
poezio.core.structs
import
Command
from
poezio.plugin
import
PluginAPI
from
poezio.config
import
config
...
...
@@ -143,7 +143,7 @@ class PluginManager(object):
raise
Exception
(
"Command '%s' already exists"
%
(
name
,))
commands
=
self
.
commands
[
module_name
]
commands
[
name
]
=
core
.
Command
(
handler
,
help
,
completion
,
short
,
usage
)
commands
[
name
]
=
Command
(
handler
,
help
,
completion
,
short
,
usage
)
self
.
core
.
commands
[
name
]
=
commands
[
name
]
def
del_command
(
self
,
module_name
,
name
):
...
...
@@ -167,7 +167,7 @@ class PluginManager(object):
if
not
t
in
commands
:
commands
[
t
]
=
[]
commands
[
t
].
append
((
name
,
handler
,
help
,
completion
))
tab_type
.
plugin_commands
[
name
]
=
core
.
Command
(
handler
,
help
,
tab_type
.
plugin_commands
[
name
]
=
Command
(
handler
,
help
,
completion
,
short
,
usage
)
for
tab
in
self
.
core
.
tabs
:
if
isinstance
(
tab
,
tab_type
):
...
...
poezio/tabs/basetabs.py
View file @
3e2839f7
...
...
@@ -22,7 +22,7 @@ import weakref
from
datetime
import
datetime
,
timedelta
from
xml.etree
import
cElementTree
as
ET
from
poezio
import
core
from
poezio
.core.structs
import
Command
from
poezio
import
timed_events
from
poezio
import
windows
from
poezio
import
xhtml
...
...
@@ -185,7 +185,7 @@ class Tab(object):
return
if
not
desc
and
shortdesc
:
desc
=
shortdesc
self
.
commands
[
name
]
=
core
.
Command
(
func
,
desc
,
completion
,
shortdesc
,
usage
)
self
.
commands
[
name
]
=
Command
(
func
,
desc
,
completion
,
shortdesc
,
usage
)
def
complete_commands
(
self
,
the_input
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment