Skip to content

Commit 2b7ae5a

Browse files
committed
Changed FileTailer.tailed_contents to FileTailer.contents
After some feedback, the named has been changed to reduce redundancy.
1 parent ea2d305 commit 2b7ae5a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ with conn.tail("/path/to/file.txt") as tf:
137137
# perform some actions or wait
138138
print(tf.read()) # at any time, you can read any unread contents
139139
# when you're done tailing, exit the context manager
140-
print(tf.tailed_contents)
140+
print(tf.contents)
141141
```
142142

143143
# Interactive Shell

src/connection.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ impl Connection {
471471
/// time.sleep(5) # wait or perform other operations
472472
/// print(tailer.read())
473473
/// time.sleep(5) # wait or perform other operations
474-
/// print(tailer.tailed_contents)
474+
/// print(tailer.contents)
475475
/// ```
476476
fn tail(&self, remote_file: String) -> FileTailer {
477477
FileTailer::new(self, remote_file, None)
@@ -591,7 +591,7 @@ impl InteractiveShell {
591591
/// * `remote_file`: A string representing the path to the remote file.
592592
/// * `init_pos`: An optional initial position from where to start reading the file.
593593
/// * `last_pos`: The last position read from the file.
594-
/// * `tailed_contents`: The contents read from the file.
594+
/// * `contents`: The contents read from the file.
595595
///
596596
/// # Methods
597597
///
@@ -609,7 +609,7 @@ struct FileTailer {
609609
#[pyo3(get)]
610610
last_pos: u64,
611611
#[pyo3(get)]
612-
tailed_contents: Option<String>,
612+
contents: Option<String>,
613613
}
614614

615615
#[pymethods]
@@ -621,7 +621,7 @@ impl FileTailer {
621621
remote_file,
622622
init_pos,
623623
last_pos: 0,
624-
tailed_contents: None,
624+
contents: None,
625625
}
626626
}
627627

@@ -664,7 +664,7 @@ impl FileTailer {
664664
_exc_value: Option<&Bound<'_, PyAny>>,
665665
_traceback: Option<&Bound<'_, PyAny>>,
666666
) -> PyResult<()> {
667-
self.tailed_contents = Some(self.read(self.init_pos));
667+
self.contents = Some(self.read(self.init_pos));
668668
Ok(())
669669
}
670670
}

tests/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ def test_tail(conn):
184184
assert tf.read(0) == TEST_STR
185185
assert tf.last_pos == len(TEST_STR)
186186
conn.execute("echo goodbye >> /root/hello.txt")
187-
assert tf.tailed_contents == "goodbye\n"
187+
assert tf.contents == "goodbye\n"

0 commit comments

Comments
 (0)