OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """The metaclasses used by the mojo python bindings.""" | 5 """The metaclasses used by the mojo python bindings.""" |
6 | 6 |
7 import itertools | 7 import itertools |
8 import logging | 8 import logging |
9 import sys | 9 import sys |
10 | 10 |
11 # pylint: disable=F0401 | 11 # pylint: disable=F0401 |
12 import mojo.bindings.messaging as messaging | 12 import mojo_bindings.messaging as messaging |
13 import mojo.bindings.promise as promise | 13 import mojo_bindings.promise as promise |
14 import mojo.bindings.serialization as serialization | 14 import mojo_bindings.serialization as serialization |
15 | 15 |
16 | 16 |
17 class MojoEnumType(type): | 17 class MojoEnumType(type): |
18 """Meta class for enumerations. | 18 """Meta class for enumerations. |
19 | 19 |
20 Usage: | 20 Usage: |
21 class MyEnum(object): | 21 class MyEnum(object): |
22 __metaclass__ = MojoEnumType | 22 __metaclass__ = MojoEnumType |
23 VALUES = [ | 23 VALUES = [ |
24 ('A', 0), | 24 ('A', 0), |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 logging.warning( | 560 logging.warning( |
561 'Error occured in accept method. Connection will be closed.') | 561 'Error occured in accept method. Connection will be closed.') |
562 if self.impl.manager: | 562 if self.impl.manager: |
563 self.impl.manager.Close() | 563 self.impl.manager.Close() |
564 return False | 564 return False |
565 return Accept | 565 return Accept |
566 | 566 |
567 | 567 |
568 def _NotImplemented(*_1, **_2): | 568 def _NotImplemented(*_1, **_2): |
569 raise NotImplementedError() | 569 raise NotImplementedError() |
OLD | NEW |