Transition to buffer.number setter
This commit is contained in:
parent
a6b955f4c7
commit
d3f37d059c
1 changed files with 6 additions and 2 deletions
|
@ -372,7 +372,7 @@ class WeechatChannelBuffer(object):
|
||||||
if new_channel_position == NewChannelPosition.NONE:
|
if new_channel_position == NewChannelPosition.NONE:
|
||||||
pass
|
pass
|
||||||
elif new_channel_position == NewChannelPosition.NEXT:
|
elif new_channel_position == NewChannelPosition.NEXT:
|
||||||
W.buffer_set(self._ptr, "number", str(cur_num + 1))
|
self.number = cur_num + 1
|
||||||
elif new_channel_position == NewChannelPosition.NEAR_SERVER:
|
elif new_channel_position == NewChannelPosition.NEAR_SERVER:
|
||||||
server = G.SERVERS[server_name]
|
server = G.SERVERS[server_name]
|
||||||
last_similar_buffer_num = max(
|
last_similar_buffer_num = max(
|
||||||
|
@ -380,7 +380,7 @@ class WeechatChannelBuffer(object):
|
||||||
in server.room_buffers.values()),
|
in server.room_buffers.values()),
|
||||||
default=W.buffer_get_integer(server.server_buffer, "number")
|
default=W.buffer_get_integer(server.server_buffer, "number")
|
||||||
)
|
)
|
||||||
W.buffer_set(self._ptr, "number", str(last_similar_buffer_num + 1))
|
self.number = last_similar_buffer_num + 1
|
||||||
|
|
||||||
self.name = ""
|
self.name = ""
|
||||||
self.users = {} # type: Dict[str, WeechatUser]
|
self.users = {} # type: Dict[str, WeechatUser]
|
||||||
|
@ -869,6 +869,10 @@ class WeechatChannelBuffer(object):
|
||||||
"""Get the buffer number, starts at 1."""
|
"""Get the buffer number, starts at 1."""
|
||||||
return int(W.buffer_get_integer(self._ptr, "number"))
|
return int(W.buffer_get_integer(self._ptr, "number"))
|
||||||
|
|
||||||
|
@number.setter
|
||||||
|
def number(self, n):
|
||||||
|
W.buffer_set(self._ptr, "number", str(n))
|
||||||
|
|
||||||
def find_lines(self, predicate, max_lines=None):
|
def find_lines(self, predicate, max_lines=None):
|
||||||
lines = []
|
lines = []
|
||||||
count = 0
|
count = 0
|
||||||
|
|
Loading…
Reference in a new issue