Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Buquet
poezio
Commits
12a55845
Commit
12a55845
authored
Oct 15, 2016
by
Maxime Buquet
Committed by
Link Mauve
Oct 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make reorder plugin read create_gaps config
parent
abb41d57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
plugins/reorder.py
plugins/reorder.py
+6
-2
No files found.
plugins/reorder.py
View file @
12a55845
...
...
@@ -62,6 +62,7 @@ And finally, the ``[tab name]`` must be:
from
poezio
import
tabs
from
poezio.decorators
import
command_args_parser
from
poezio.plugin
import
BasePlugin
from
poezio.config
import
config
TEXT_TO_TAB
=
{
'muc'
:
tabs
.
MucTab
,
...
...
@@ -141,10 +142,12 @@ class Plugin(BasePlugin):
old_tabs
=
self
.
core
.
tabs
[
1
:]
roster
=
self
.
core
.
tabs
[
0
]
create_gaps
=
config
.
get
(
'create_gaps'
)
new_tabs
=
[]
last
=
0
for
pos
in
sorted
(
tabs_spec
):
if
pos
>
last
+
1
:
if
create_gaps
and
pos
>
last
+
1
:
new_tabs
+=
[
tabs
.
GapTab
(
self
.
core
)
for
i
in
range
(
pos
-
last
)]
cls
,
name
=
tabs_spec
[
pos
]
tab
=
self
.
core
.
get_tab_by_name
(
name
,
typ
=
cls
)
...
...
@@ -153,7 +156,8 @@ class Plugin(BasePlugin):
old_tabs
.
remove
(
tab
)
else
:
self
.
api
.
information
(
'Tab %s not found'
%
name
,
'Warning'
)
new_tabs
.
append
(
tabs
.
GapTab
(
self
.
core
))
if
create_gaps
:
new_tabs
.
append
(
tabs
.
GapTab
(
self
.
core
))
last
=
pos
for
tab
in
old_tabs
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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