This repository has been archived by the owner on Apr 26, 2020. It is now read-only.
forked from kalkin/qubes-dbus
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
347 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import ( | ||
Any, Callable, Iterable, Tuple, List, TextIO, Sequence, | ||
Optional, overload, TypeVar, Pattern, Type | ||
) | ||
|
||
class error(Exception):... | ||
|
||
def setupterm() -> None: ... | ||
def tparm(arg: str, *args: int) -> None: ... | ||
def tigetstr(arg: str) -> str: ... | ||
|
||
# vim: syntax=python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Stubs for dbus | ||
|
||
import dbus.mainloop | ||
import dbus.proxies | ||
import dbus._dbus | ||
from typing import Optional, Union, Callable | ||
|
||
|
||
class Interface(object): | ||
def __init__(self, object: Union[dbus.proxies.ProxyObject, Interface], dbus_interface: str) -> None: ... | ||
def get_dbus_method(self, member: str, dbus_interface: Optional[str]=...) -> Callable: ... | ||
|
||
|
||
class Bus(dbus.bus.BusConnection): | ||
def __new__(cls, | ||
bus_type: Optional[int], private: Optional[bool]=..., | ||
mainloop: Optional[dbus.mainloop.NativeMainLoop]=... | ||
) -> dbus.bus.BusConnection: ... | ||
|
||
def SessionBus() -> dbus._dbus.SessionBus: ... | ||
|
||
class String(str): ... | ||
class Boolean(int): ... | ||
|
||
class Array(list): ... | ||
class Dictionary(dict): ... | ||
# vim: syntax=python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import Optional | ||
import dbus | ||
import dbus.bus | ||
import dbus.mainloop | ||
|
||
class SessionBus(dbus.bus.BusConnection): | ||
def __new__(cls, | ||
private: Optional[bool]=..., | ||
mainloop: Optional[dbus.mainloop.NativeMainLoop]=... | ||
) -> dbus.Bus: ... | ||
|
||
# vim: syntax=python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import dbus.connection | ||
import dbus.proxies | ||
from typing import Optional | ||
|
||
|
||
class BusConnection(dbus.connection.Connection): | ||
def get_object(self, | ||
bus_name: str=..., | ||
object_path: str=..., | ||
introspect: Optional[bool]=..., | ||
follow_name_owner_changes: Optional[bool]=... | ||
) -> dbus.proxies.ProxyObject: | ||
... | ||
|
||
# vim: syntax=python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Connection(object): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
class NativeMainLoop: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import dbus.mainloop | ||
|
||
def DBusGMainLoop(set_as_default: bool = ... ) -> dbus.mainloop.NativeMainLoop: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Stubs for dbus.proxies | ||
from typing import Optional, Callable | ||
|
||
class ProxyObject(object): | ||
def get_dbus_method(self, member: str=..., dbus_interface: Optional[str]=...) -> Callable: ... | ||
|
||
# vim: ft=python tw=0 syntax=python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Stubs for dbus.service | ||
|
||
import dbus | ||
from dbus.connection import Connection | ||
from dbus._dbus import SessionBus | ||
from typing import Optional, Tuple, Callable, Union | ||
|
||
|
||
class Object(dbus.Interface): | ||
def __init__(self, conn: Optional[Union[BusName,Connection]] = ..., | ||
object_path: Optional[str] = ..., | ||
bus_name: Optional[BusName] = ...) -> None: ... | ||
|
||
def method( | ||
dbus_interface: str=..., | ||
in_signature: Optional[str]=..., | ||
out_signature: Optional[str]=..., | ||
async_callbacks: Tuple[str,str]=..., | ||
sender_keyword: Optional[str]=..., | ||
path_keyword: Optional[str]=..., | ||
rel_path_keyword: Optional[str]=..., | ||
destination_keyword: Optional[str]=..., | ||
message_keyword: Optional[str]=..., | ||
connection_keyword: Optional[str]=..., | ||
utf8_strings: bool=..., | ||
byte_arrays: bool=..., | ||
|
||
) -> Callable: ... | ||
|
||
def signal( | ||
dbus_interface: str=..., | ||
signature: Optional[str]=..., | ||
path_keyword: Optional[str]=..., | ||
rel_path_keyword: Optional[str]=..., | ||
) -> Callable: ... | ||
|
||
class BusName(object): | ||
def __new__(cls, | ||
name: str, | ||
bus: Union[dbus.Bus, SessionBus], | ||
allow_replacement: Optional[bool]=..., | ||
replace_existing: Optional[bool]=..., | ||
do_not_queue: Optional[bool]=..., | ||
) -> BusName: ... | ||
# vim: syntax=python tw=0 |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Stubs for gi.repository | ||
|
||
class GLib(object): | ||
class MainLoop(object): | ||
def run(self) -> None: ... | ||
|
||
# vim: syntax=python |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from typing import (Iterable, Optional, Any, Callable) | ||
class EntryPoint(object): | ||
def load(self, require: bool = ..., *args: Any, **kwargs: Any) -> Callable: ... | ||
|
||
|
||
def iter_entry_points(group: str, name: Optional[str] = ...) -> Iterable[EntryPoint]: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from typing import (List) | ||
import qubes.vm | ||
class Qubes(object): | ||
domains = ... # type: List[qubes.vm.BaseVM] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class BaseVM(object): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class QubesVM(object): | ||
qid = ... # type: int |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Stubs for systemd.journal | ||
|
||
import logging | ||
|
||
from typing import Optional | ||
|
||
class JournalHandler(logging.Handler): | ||
def __init__(self, level: Optional[int]=..., SYSLOG_IDENTIFIER: Optional[str]=...) -> None: ... | ||
# vim: syntax=python tw=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
# Stubs for unittest | ||
|
||
# Based on http://docs.python.org/2.7/library/unittest.html | ||
|
||
# Only a subset of functionality is included. | ||
|
||
from typing import ( | ||
Any, Callable, Iterable, Tuple, List, TextIO, Sequence, | ||
overload, TypeVar, Pattern, Type, IO | ||
) | ||
from abc import abstractmethod, ABCMeta | ||
|
||
_T = TypeVar('_T') | ||
_FT = TypeVar('_FT') | ||
|
||
class Testable(metaclass=ABCMeta): | ||
@abstractmethod | ||
def run(self, result: 'TestResult') -> None: ... | ||
@abstractmethod | ||
def debug(self) -> None: ... | ||
@abstractmethod | ||
def countTestCases(self) -> int: ... | ||
|
||
# TODO ABC for test runners? | ||
|
||
class TestResult: | ||
errors = ... # type: List[Tuple[Testable, str]] | ||
failures = ... # type: List[Tuple[Testable, str]] | ||
testsRun = 0 | ||
shouldStop = ... # type: bool | ||
|
||
def wasSuccessful(self) -> bool: ... | ||
def stop(self) -> None: ... | ||
def startTest(self, test: Testable) -> None: ... | ||
def stopTest(self, test: Testable) -> None: ... | ||
def addError(self, test: Testable, | ||
err: Tuple[type, Any, Any]) -> None: ... # TODO | ||
def addFailure(self, test: Testable, | ||
err: Tuple[type, Any, Any]) -> None: ... # TODO | ||
def addSuccess(self, test: Testable) -> None: ... | ||
|
||
class TextTestResult(TestResult): | ||
separator1 = ... # type: str | ||
separator2 = ... # type: str | ||
|
||
class _AssertRaisesBaseContext: | ||
expected = ... # type: Any | ||
failureException = ... # type: type | ||
obj_name = ... # type: str | ||
expected_regex = ... # type: Pattern[str] | ||
|
||
class _AssertRaisesContext(_AssertRaisesBaseContext): | ||
exception = ... # type: Any # TODO precise type | ||
def __enter__(self) -> _AssertRaisesContext: ... | ||
def __exit__(self, exc_type, exc_value, tb) -> bool: ... | ||
|
||
class _AssertWarnsContext(_AssertRaisesBaseContext): | ||
warning = ... # type: Any # TODO precise type | ||
filename = ... # type: str | ||
lineno = 0 | ||
def __enter__(self) -> _AssertWarnsContext: ... | ||
def __exit__(self, exc_type, exc_value, tb) -> bool: ... | ||
|
||
class TestCase(Testable): | ||
def __init__(self, methodName: str = ...) -> None: ... | ||
# TODO failureException | ||
def setUp(self) -> None: ... | ||
def tearDown(self) -> None: ... | ||
def run(self, result: TestResult = ...) -> None: ... | ||
def debug(self) -> None: ... | ||
def assert_(self, expr: Any, msg: object = ...) -> None: ... | ||
def failUnless(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertTrue(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertEquals(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def failUnlessEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertNotEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertNotEquals(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def failIfEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertAlmostEqual(self, first: float, second: float, places: int = ..., | ||
msg: object = ..., | ||
delta: float = ...) -> None: ... | ||
def assertAlmostEquals(self, first: float, second: float, places: int = ..., | ||
msg: object = ..., | ||
delta: float = ...) -> None: ... | ||
def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., | ||
msg: object = ...) -> None: ... | ||
def assertNotAlmostEqual(self, first: float, second: float, places: int = ..., | ||
msg: object = ..., | ||
delta: float = ...) -> None: ... | ||
def assertNotAlmostEquals(self, first: float, second: float, places: int = ..., | ||
msg: object = ..., | ||
delta: float = ...) -> None: ... | ||
def failIfAlmostEqual(self, first: float, second: float, places: int = ..., | ||
msg: object = ..., | ||
delta: float = ...) -> None: ... | ||
def assertGreater(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertGreaterEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertMultiLineEqual(self, first: str, second: str, | ||
msg: object = ...) -> None: ... | ||
def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any], | ||
msg: object = ..., seq_type: type = ...) -> None: ... | ||
def assertListEqual(self, first: List[Any], second: List[Any], | ||
msg: object = ...) -> None: ... | ||
def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], | ||
msg: object = ...) -> None: ... | ||
def assertSetEqual(self, first: Set[Any], second: Set[Any], | ||
msg: object = ...) -> None: ... | ||
def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], | ||
msg: object = ...) -> None: ... | ||
def assertLess(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertLessEqual(self, first: Any, second: Any, | ||
msg: object = ...) -> None: ... | ||
def assertRaises(self, expected_exception: type, *args: Any, **kwargs: Any) -> Any: ... | ||
def failUnlessRaises(self, expected_exception: type, *args: Any, **kwargs: Any) -> Any: ... | ||
def failIf(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertFalse(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertIs(self, first: object, second: object, | ||
msg: object = ...) -> None: ... | ||
def assertIsNot(self, first: object, second: object, | ||
msg: object = ...) -> None: ... | ||
def assertIsNone(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ... | ||
def assertIn(self, first: _T, second: Iterable[_T], | ||
msg: object = ...) -> None: ... | ||
def assertNotIn(self, first: _T, second: Iterable[_T], | ||
msg: object = ...) -> None: ... | ||
def assertIsInstance(self, obj: Any, cls: type, | ||
msg: object = ...) -> None: ... | ||
def assertNotIsInstance(self, obj: Any, cls: type, | ||
msg: object = ...) -> None: ... | ||
def assertWarns(self, expected_warning: type, callable_obj: Any = ..., | ||
*args: Any, **kwargs: Any) -> _AssertWarnsContext: ... | ||
def fail(self, msg: object = ...) -> None: ... | ||
def countTestCases(self) -> int: ... | ||
def defaultTestResult(self) -> TestResult: ... | ||
def id(self) -> str: ... | ||
def shortDescription(self) -> str: ... # May return None | ||
def addCleanup(function: Any, *args: Any, **kwargs: Any) -> None: ... | ||
def skipTest(self, reason: Any) -> None: ... | ||
|
||
class CallableTestCase(Testable): | ||
def __init__(self, testFunc: Callable[[], None], | ||
setUp: Callable[[], None] = ..., | ||
tearDown: Callable[[], None] = ..., | ||
description: str = ...) -> None: ... | ||
def run(self, result: TestResult) -> None: ... | ||
def debug(self) -> None: ... | ||
def countTestCases(self) -> int: ... | ||
|
||
class TestSuite(Testable): | ||
def __init__(self, tests: Iterable[Testable] = ...) -> None: ... | ||
def addTest(self, test: Testable) -> None: ... | ||
def addTests(self, tests: Iterable[Testable]) -> None: ... | ||
def run(self, result: TestResult) -> None: ... | ||
def debug(self) -> None: ... | ||
def countTestCases(self) -> int: ... | ||
|
||
# TODO TestLoader | ||
# TODO defaultTestLoader | ||
|
||
class TextTestRunner: | ||
resultclass = ... # type: Type[TestResult] | ||
def __init__(self, stream: IO[str] = ..., descriptions: bool = ..., | ||
verbosity: int = ..., failfast: bool = ...) -> None: ... | ||
def run(self, test: Testable) -> TestResult: ... | ||
|
||
class SkipTest(Exception): | ||
... | ||
|
||
# TODO precise types | ||
def skipUnless(condition: Any, reason: str) -> Any: ... | ||
def skipIf(condition: Any, reason: str) -> Any: ... | ||
def expectedFailure(func: _FT) -> _FT: ... | ||
def skip(reason: str) -> Any: ... | ||
|
||
def main(module: str = ..., defaultTest: str = ..., | ||
argv: List[str] = ..., testRunner: Any = ..., | ||
testLoader: Any = ...) -> None: ... # TODO types | ||
|
||
# private but occasionally used | ||
util = ... # type: module |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.