Exemplo n.º 1
0
def test_query_return_splitted_list(_mdfind):
    result = mdfind.count("kind:image", onlyin="~")
    assert result == int(COUNT_STDOUT)
Exemplo n.º 2
0
def test_count_calls_mdfind_correct(_mdfind):
    mdfind.count("kind:image", onlyin="~")
    assert _mdfind.call_args == call("-count", "kind:image", "-onlyin", "~")
    mdfind.count("kind:image")
    assert _mdfind.call_args == call("-count", "kind:image")
Exemplo n.º 3
0
def count(tag: AnyTag, *, onlyin: Optional[str] = None) -> int:
    """Output the total number of files by `tag`."""
    tag = _create_tag(tag)
    return mdfind.count(query=_MDFIND_TAGS_QUERY.format(tag.name),
                        onlyin=onlyin)
Exemplo n.º 4
0
#!/usr/bin/env python
import mdfind

query = 'kMDItemContentType==public.mp3'
count = mdfind.count(query=query)
print(count)
Exemplo n.º 5
0
#!/usr/bin/env python
import mdfind
import tests_os.mac

name = "Downloads"
count = mdfind.count(name=name)
print(count)