@@ -29,7 +29,7 @@ def __init__(self, session, code_data):
29
29
30
30
def __len__ (self ):
31
31
"""Return the number of lines contained in a Buffer."""
32
- return self ._session .request ('buffer_get_length ' , self )
32
+ return self ._session .request ('buffer_line_count ' , self )
33
33
34
34
def __getitem__ (self , idx ):
35
35
"""Get a buffer line or slice by integer index.
@@ -51,7 +51,7 @@ def __getitem__(self, idx):
51
51
if end is None :
52
52
end = - 1
53
53
include_end = True
54
- return self ._session .request ('buffer_get_slice ' , self , start , end ,
54
+ return self ._session .request ('buffer_get_line_slice ' , self , start , end ,
55
55
True , include_end )
56
56
57
57
def __setitem__ (self , idx , lines ):
@@ -78,7 +78,7 @@ def __setitem__(self, idx, lines):
78
78
if end is None :
79
79
end = - 1
80
80
include_end = True
81
- return self ._session .request ('buffer_set_slice ' , self , start , end ,
81
+ return self ._session .request ('buffer_set_line_slice ' , self , start , end ,
82
82
True , include_end , lines )
83
83
84
84
def __iter__ (self ):
@@ -93,15 +93,15 @@ def __iter__(self):
93
93
for line in lines :
94
94
yield line
95
95
96
- def get_slice (self , start , stop , start_incl , end_incl ):
96
+ def get_line_slice (self , start , stop , start_incl , end_incl ):
97
97
"""More flexible wrapper for retrieving slices."""
98
- return self ._session .request ('buffer_get_slice ' , self , start , stop ,
99
- start_incl , end_incl )
98
+ return self ._session .request ('buffer_get_line_slice ' , self , start ,
99
+ stop , start_incl , end_incl )
100
100
101
- def set_slice (self , start , stop , start_incl , end_incl , lines ):
101
+ def set_line_slice (self , start , stop , start_incl , end_incl , lines ):
102
102
"""More flexible wrapper for replacing slices."""
103
- return self ._session .request ('buffer_set_slice ' , self , start , stop ,
104
- start_incl , end_incl , lines )
103
+ return self ._session .request ('buffer_set_line_slice ' , self , start ,
104
+ stop , start_incl , end_incl , lines )
105
105
106
106
def append (self , lines , index = - 1 ):
107
107
"""Append a string or list of lines to the buffer."""
0 commit comments