Skip to content

Commit

Permalink
minor cleanup in README
Browse files Browse the repository at this point in the history
  • Loading branch information
andhus committed Mar 30, 2019
1 parent 25d7bdd commit 25b51ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ tree = scantree('/path/to/dir', RecursionFilter(match=['*.txt']))
print([path.relative for path in tree.filepaths()])
print([path.real for path in tree.filepaths()])
```
```bash
```
['d1/d2/file3.txt', 'd1/file2.txt', 'file1.txt']
['/path/to/other_dir/file3.txt', '/path/to/dir/d1/file2.txt', '/path/to/dir/file1.txt']
```

Access metadata of directory entries in file tree:
```python
d2 = tree.directories[0].directories[0]
Expand Down Expand Up @@ -55,7 +56,7 @@ hello_count = tree.apply(
)
print(hello_count)
```
```bash
```
3
```

Expand All @@ -77,8 +78,7 @@ hello_count_tree = tree.apply(
from pprint import pprint
pprint(hello_count_tree)
```

```commandline
```
{'count': 3,
'name': 'dir',
'sub_counts': [{'count': 2, 'name': 'file1.txt'},
Expand All @@ -89,7 +89,6 @@ pprint(hello_count_tree)
'name': 'd2',
'sub_counts': [{'count': 0,
'name': 'file3.txt'}]}]}]}
```

Flexible filtering:
Expand All @@ -107,6 +106,7 @@ without_palindrome_linked_dirs = scantree(
]
)
```

Comparison:
```python
tree = scandir('path/to/dir')
Expand Down

0 comments on commit 25b51ca

Please sign in to comment.