/usr/share/pyshared/opensync.py is in python-opensync 0.39-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
Python bindings for the OpenSync library
"""
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_opensync', [dirname(__file__)])
except ImportError:
import _opensync
return _opensync
if fp is not None:
try:
_mod = imp.load_module('_opensync', fp, pathname, description)
finally:
fp.close()
return _mod
_opensync = swig_import_helper()
del swig_import_helper
else:
import _opensync
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
class _ListWrapper:
"""Utility class to wrap a common idiom in OpenSync as a Python list."""
def __init__(self, lenf, getf):
self.__lenf = lenf
self.__getf = getf
def __len__(self):
return self.__lenf()
def __getitem__(self, num):
if not isinstance(num, int):
raise TypeError
if num < 0 or num >= len(self):
raise IndexError
return self.__getf(num)
class Error(Exception):
"""Proxy of C Error struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> Error
__init__(self, char msg, ErrorType type = OSYNC_ERROR_GENERIC) -> Error
"""
this = _opensync.new_Error(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Error
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.Error_get_name(self)
def is_set(self):
"""is_set(self) -> bool"""
return _opensync.Error_is_set(self)
def get_type(self):
"""get_type(self) -> ErrorType"""
return _opensync.Error_get_type(self)
def set_type(self, *args):
"""set_type(self, ErrorType type)"""
return _opensync.Error_set_type(self, *args)
def get_msg(self):
"""get_msg(self) -> char"""
return _opensync.Error_get_msg(self)
def print_stack(self):
"""print_stack(self) -> char"""
return _opensync.Error_print_stack(self)
def set_from_error(self, *args):
"""set_from_error(self, Error source)"""
return _opensync.Error_set_from_error(self, *args)
def set(self, *args):
"""set(self, ErrorType type, char msg)"""
return _opensync.Error_set(self, *args)
def stack(self, *args):
"""stack(self, Error child)"""
return _opensync.Error_stack(self, *args)
def get_child(self):
"""get_child(self) -> Error"""
return _opensync.Error_get_child(self)
# for some reason the OpenSync API only allows setting the msg with a type
def __set_msg(self, msg):
self.set(self.num, msg)
def __str__(self):
return self.get_name() + ": " + self.get_msg()
def report(self, context):
"""Report myself as an error to the given Context object."""
context.report_osyncerror(self)
name = property(get_name)
is_set = property(is_set)
num = property(get_type, set_type) # 'type' is a reserved word
msg = property(get_msg, __set_msg)
Error_swigregister = _opensync.Error_swigregister
Error_swigregister(Error)
NO_ERROR = _opensync.NO_ERROR
ERROR_GENERIC = _opensync.ERROR_GENERIC
ERROR_IO_ERROR = _opensync.ERROR_IO_ERROR
ERROR_NOT_SUPPORTED = _opensync.ERROR_NOT_SUPPORTED
ERROR_TIMEOUT = _opensync.ERROR_TIMEOUT
ERROR_DISCONNECTED = _opensync.ERROR_DISCONNECTED
ERROR_FILE_NOT_FOUND = _opensync.ERROR_FILE_NOT_FOUND
ERROR_EXISTS = _opensync.ERROR_EXISTS
ERROR_CONVERT = _opensync.ERROR_CONVERT
ERROR_MISCONFIGURATION = _opensync.ERROR_MISCONFIGURATION
ERROR_INITIALIZATION = _opensync.ERROR_INITIALIZATION
ERROR_PARAMETER = _opensync.ERROR_PARAMETER
ERROR_EXPECTED = _opensync.ERROR_EXPECTED
ERROR_NO_CONNECTION = _opensync.ERROR_NO_CONNECTION
ERROR_TEMPORARY = _opensync.ERROR_TEMPORARY
ERROR_LOCKED = _opensync.ERROR_LOCKED
ERROR_PLUGIN_NOT_FOUND = _opensync.ERROR_PLUGIN_NOT_FOUND
class Context(object):
"""Proxy of C Context struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> Context
__init__(self) -> Context
"""
this = _opensync.new_Context(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Context
__del__ = lambda self : None;
def report_error(self, *args):
"""report_error(self, ErrorType type, char msg)"""
return _opensync.Context_report_error(self, *args)
def report_success(self):
"""report_success(self)"""
return _opensync.Context_report_success(self)
def report_osyncerror(self, *args):
"""report_osyncerror(self, Error error)"""
return _opensync.Context_report_osyncerror(self, *args)
def report_osyncwarning(self, *args):
"""report_osyncwarning(self, Error error)"""
return _opensync.Context_report_osyncwarning(self, *args)
def report_change(self, *args):
"""report_change(self, Change change)"""
return _opensync.Context_report_change(self, *args)
def set_callback_object(self, *args):
"""set_callback_object(self, PyObject handler)"""
return _opensync.Context_set_callback_object(self, *args)
Context_swigregister = _opensync.Context_swigregister
Context_swigregister(Context)
class ContextCallbacks:
"""A purely-Python class that should be subclassed by code that wishes to handle context callbacks."""
def callback(self, err):
"""If err is set, this call indicates that an error was reported. Otherwise success."""
pass
def changes(self, change):
"""Called to report a change object."""
pass
def warning(self, err):
"""Called to report a non-fatal error."""
pass
CONV_DATA_UNKNOWN = _opensync.CONV_DATA_UNKNOWN
CONV_DATA_MISMATCH = _opensync.CONV_DATA_MISMATCH
CONV_DATA_SIMILAR = _opensync.CONV_DATA_SIMILAR
CONV_DATA_SAME = _opensync.CONV_DATA_SAME
class Data(object):
"""Proxy of C Data struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char buf, ObjFormat format) -> Data"""
this = _opensync.new_Data(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Data
__del__ = lambda self : None;
def get_objformat(self):
"""get_objformat(self) -> ObjFormat"""
return _opensync.Data_get_objformat(self)
def set_objformat(self, *args):
"""set_objformat(self, ObjFormat objformat)"""
return _opensync.Data_set_objformat(self, *args)
def get_objtype(self):
"""get_objtype(self) -> char"""
return _opensync.Data_get_objtype(self)
def set_objtype(self, *args):
"""set_objtype(self, char objtype)"""
return _opensync.Data_set_objtype(self, *args)
def get_data(self):
"""get_data(self)"""
return _opensync.Data_get_data(self)
def set_data(self, *args):
"""set_data(self, char buffer, unsigned int size)"""
return _opensync.Data_set_data(self, *args)
def has_data(self):
"""has_data(self) -> bool"""
return _opensync.Data_has_data(self)
def clone(self):
"""clone(self) -> Data"""
return _opensync.Data_clone(self)
def get_printable(self):
"""get_printable(self) -> char"""
return _opensync.Data_get_printable(self)
def get_revision(self):
"""get_revision(self) -> time_t"""
return _opensync.Data_get_revision(self)
objformat = property(get_objformat, set_objformat)
objtype = property(get_objtype, set_objtype)
data = property(get_data, set_data)
revision = property(get_revision)
Data_swigregister = _opensync.Data_swigregister
Data_swigregister(Data)
CHANGE_TYPE_UNKNOWN = _opensync.CHANGE_TYPE_UNKNOWN
CHANGE_TYPE_ADDED = _opensync.CHANGE_TYPE_ADDED
CHANGE_TYPE_UNMODIFIED = _opensync.CHANGE_TYPE_UNMODIFIED
CHANGE_TYPE_DELETED = _opensync.CHANGE_TYPE_DELETED
CHANGE_TYPE_MODIFIED = _opensync.CHANGE_TYPE_MODIFIED
class Change(object):
"""Proxy of C Change struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> Change
__init__(self) -> Change
"""
this = _opensync.new_Change(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Change
__del__ = lambda self : None;
def set_hash(self, *args):
"""set_hash(self, char hash)"""
return _opensync.Change_set_hash(self, *args)
def get_hash(self):
"""get_hash(self) -> char"""
return _opensync.Change_get_hash(self)
def set_uid(self, *args):
"""set_uid(self, char uid)"""
return _opensync.Change_set_uid(self, *args)
def get_uid(self):
"""get_uid(self) -> char"""
return _opensync.Change_get_uid(self)
def set_changetype(self, *args):
"""set_changetype(self, ChangeType changetype)"""
return _opensync.Change_set_changetype(self, *args)
def get_changetype(self):
"""get_changetype(self) -> ChangeType"""
return _opensync.Change_get_changetype(self)
def set_data(self, *args):
"""set_data(self, Data data)"""
return _opensync.Change_set_data(self, *args)
def get_data(self):
"""get_data(self) -> Data"""
return _opensync.Change_get_data(self)
def compare(self, *args):
"""compare(self, Change change) -> ConvCmpResult"""
return _opensync.Change_compare(self, *args)
def get_objformat(self):
"""get_objformat(self) -> ObjFormat"""
return _opensync.Change_get_objformat(self)
def set_objtype(self, *args):
"""set_objtype(self, char objtype)"""
return _opensync.Change_set_objtype(self, *args)
def get_objtype(self):
"""get_objtype(self) -> char"""
return _opensync.Change_get_objtype(self)
hash = property(get_hash, set_hash)
uid = property(get_uid, set_uid)
changetype = property(get_changetype, set_changetype)
data = property(get_data, set_data)
objformat = property(get_objformat)
objtype = property(get_objtype, set_objtype)
Change_swigregister = _opensync.Change_swigregister
Change_swigregister(Change)
ENGINE_COMMAND_CONNECT = _opensync.ENGINE_COMMAND_CONNECT
ENGINE_COMMAND_READ = _opensync.ENGINE_COMMAND_READ
ENGINE_COMMAND_WRITE = _opensync.ENGINE_COMMAND_WRITE
ENGINE_COMMAND_SYNC_DONE = _opensync.ENGINE_COMMAND_SYNC_DONE
ENGINE_COMMAND_DISCONNECT = _opensync.ENGINE_COMMAND_DISCONNECT
ENGINE_COMMAND_SOLVE = _opensync.ENGINE_COMMAND_SOLVE
ENGINE_COMMAND_DISCOVER = _opensync.ENGINE_COMMAND_DISCOVER
ENGINE_STATE_UNINITIALIZED = _opensync.ENGINE_STATE_UNINITIALIZED
ENGINE_STATE_INITIALIZED = _opensync.ENGINE_STATE_INITIALIZED
ENGINE_STATE_WAITING = _opensync.ENGINE_STATE_WAITING
ENGINE_STATE_CONNECTING = _opensync.ENGINE_STATE_CONNECTING
ENGINE_STATE_READING = _opensync.ENGINE_STATE_READING
ENGINE_STATE_WRITING = _opensync.ENGINE_STATE_WRITING
ENGINE_STATE_DISCONNECTING = _opensync.ENGINE_STATE_DISCONNECTING
ENGINE_EVENT_CONNECTED = _opensync.ENGINE_EVENT_CONNECTED
ENGINE_EVENT_ERROR = _opensync.ENGINE_EVENT_ERROR
ENGINE_EVENT_READ = _opensync.ENGINE_EVENT_READ
ENGINE_EVENT_WRITTEN = _opensync.ENGINE_EVENT_WRITTEN
ENGINE_EVENT_SYNC_DONE = _opensync.ENGINE_EVENT_SYNC_DONE
ENGINE_EVENT_DISCONNECTED = _opensync.ENGINE_EVENT_DISCONNECTED
ENGINE_EVENT_SUCCESSFUL = _opensync.ENGINE_EVENT_SUCCESSFUL
ENGINE_EVENT_END_CONFLICTS = _opensync.ENGINE_EVENT_END_CONFLICTS
ENGINE_EVENT_PREV_UNCLEAN = _opensync.ENGINE_EVENT_PREV_UNCLEAN
ENGINE_MEMBER_EVENT_CONNECTED = _opensync.ENGINE_MEMBER_EVENT_CONNECTED
ENGINE_MEMBER_EVENT_ERROR = _opensync.ENGINE_MEMBER_EVENT_ERROR
ENGINE_MEMBER_EVENT_READ = _opensync.ENGINE_MEMBER_EVENT_READ
ENGINE_MEMBER_EVENT_WRITTEN = _opensync.ENGINE_MEMBER_EVENT_WRITTEN
ENGINE_MEMBER_EVENT_SYNC_DONE = _opensync.ENGINE_MEMBER_EVENT_SYNC_DONE
ENGINE_MEMBER_EVENT_DISCONNECTED = _opensync.ENGINE_MEMBER_EVENT_DISCONNECTED
ENGINE_MEMBER_EVENT_DISCOVERED = _opensync.ENGINE_MEMBER_EVENT_DISCOVERED
ENGINE_CHANGE_EVENT_READ = _opensync.ENGINE_CHANGE_EVENT_READ
ENGINE_CHANGE_EVENT_WRITTEN = _opensync.ENGINE_CHANGE_EVENT_WRITTEN
ENGINE_CHANGE_EVENT_ERROR = _opensync.ENGINE_CHANGE_EVENT_ERROR
ENGINE_MAPPING_EVENT_SOLVED = _opensync.ENGINE_MAPPING_EVENT_SOLVED
ENGINE_MAPPING_EVENT_ERROR = _opensync.ENGINE_MAPPING_EVENT_ERROR
class Engine(object):
"""Proxy of C Engine struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, Group group) -> Engine"""
this = _opensync.new_Engine(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Engine
__del__ = lambda self : None;
def initialize(self):
"""initialize(self)"""
return _opensync.Engine_initialize(self)
def finalize(self):
"""finalize(self)"""
return _opensync.Engine_finalize(self)
def synchronize(self):
"""synchronize(self)"""
return _opensync.Engine_synchronize(self)
def synchronize_and_block(self):
"""synchronize_and_block(self)"""
return _opensync.Engine_synchronize_and_block(self)
def wait_sync_end(self):
"""wait_sync_end(self)"""
return _opensync.Engine_wait_sync_end(self)
def discover(self, *args):
"""discover(self, Member member)"""
return _opensync.Engine_discover(self, *args)
def discover_and_block(self, *args):
"""discover_and_block(self, Member member)"""
return _opensync.Engine_discover_and_block(self, *args)
def set_enginestatus_callback(self, *args):
"""set_enginestatus_callback(self, PyObject pyfunc)"""
return _opensync.Engine_set_enginestatus_callback(self, *args)
# group = property(get_group)
# archive = property(get_archive)
Engine_swigregister = _opensync.Engine_swigregister
Engine_swigregister(Engine)
CONVERTER_CONV = _opensync.CONVERTER_CONV
CONVERTER_ENCAP = _opensync.CONVERTER_ENCAP
CONVERTER_DECAP = _opensync.CONVERTER_DECAP
CONVERTER_DETECTOR = _opensync.CONVERTER_DETECTOR
class FormatConverter(object):
"""Proxy of C FormatConverter struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> FormatConverter"""
this = _opensync.new_FormatConverter()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_FormatConverter
__del__ = lambda self : None;
def get_sourceformat(self):
"""get_sourceformat(self) -> ObjFormat"""
return _opensync.FormatConverter_get_sourceformat(self)
def get_targetformat(self):
"""get_targetformat(self) -> ObjFormat"""
return _opensync.FormatConverter_get_targetformat(self)
def get_type(self):
"""get_type(self) -> OSyncConverterType"""
return _opensync.FormatConverter_get_type(self)
def detect(self, *args):
"""detect(self, Data data) -> ObjFormat"""
return _opensync.FormatConverter_detect(self, *args)
def invoke(self, *args):
"""invoke(self, Data data, char config)"""
return _opensync.FormatConverter_invoke(self, *args)
def matches(self, *args):
"""matches(self, Data data) -> bool"""
return _opensync.FormatConverter_matches(self, *args)
sourceformat = property(get_sourceformat)
targetformat = property(get_targetformat)
type = property(get_type)
FormatConverter_swigregister = _opensync.FormatConverter_swigregister
FormatConverter_swigregister(FormatConverter)
class FormatConverterPath(object):
"""Proxy of C FormatConverterPath struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> FormatConverterPath"""
this = _opensync.new_FormatConverterPath()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_FormatConverterPath
__del__ = lambda self : None;
def add_edge(self, *args):
"""add_edge(self, FormatConverter edge)"""
return _opensync.FormatConverterPath_add_edge(self, *args)
def get_config(self):
"""get_config(self) -> char"""
return _opensync.FormatConverterPath_get_config(self)
def set_config(self, *args):
"""set_config(self, char config)"""
return _opensync.FormatConverterPath_set_config(self, *args)
config = property(get_config, set_config)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
FormatConverterPath_swigregister = _opensync.FormatConverterPath_swigregister
FormatConverterPath_swigregister(FormatConverterPath)
class FormatEnv(object):
"""Proxy of C FormatEnv struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> FormatEnv"""
this = _opensync.new_FormatEnv()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_FormatEnv
__del__ = lambda self : None;
def load_plugins(self, path = None):
"""load_plugins(self, char path = None)"""
return _opensync.FormatEnv_load_plugins(self, path)
def register_objformat(self, *args):
"""register_objformat(self, ObjFormat format)"""
return _opensync.FormatEnv_register_objformat(self, *args)
def find_objformat(self, *args):
"""find_objformat(self, char name) -> ObjFormat"""
return _opensync.FormatEnv_find_objformat(self, *args)
def register_converter(self, *args):
"""register_converter(self, FormatConverter converter)"""
return _opensync.FormatEnv_register_converter(self, *args)
def find_converter(self, *args):
"""find_converter(self, ObjFormat sourceformat, ObjFormat targetformat) -> FormatConverter"""
return _opensync.FormatEnv_find_converter(self, *args)
def detect_objformat(self, *args):
"""detect_objformat(self, Data data) -> ObjFormat"""
return _opensync.FormatEnv_detect_objformat(self, *args)
def detect_objformat_full(self, *args):
"""detect_objformat_full(self, Data input) -> ObjFormat"""
return _opensync.FormatEnv_detect_objformat_full(self, *args)
def convert(self, *args):
"""convert(self, FormatConverterPath path, Data data)"""
return _opensync.FormatEnv_convert(self, *args)
def find_path(self, *args):
"""find_path(self, ObjFormat sourceformat, ObjFormat targetformat) -> FormatConverterPath"""
return _opensync.FormatEnv_find_path(self, *args)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
# self.filters = _ListWrapper(self.num_filters, self.nth_filter)
FormatEnv_swigregister = _opensync.FormatEnv_swigregister
FormatEnv_swigregister(FormatEnv)
class ObjFormat(object):
"""Proxy of C ObjFormat struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char name, char objtype_name) -> ObjFormat"""
this = _opensync.new_ObjFormat(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_ObjFormat
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.ObjFormat_get_name(self)
def get_objtype(self):
"""get_objtype(self) -> char"""
return _opensync.ObjFormat_get_objtype(self)
name = property(get_name)
objtype = property(get_objtype)
ObjFormat_swigregister = _opensync.ObjFormat_swigregister
ObjFormat_swigregister(ObjFormat)
class ObjFormatSink(object):
"""Proxy of C ObjFormatSink struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char name) -> ObjFormatSink"""
this = _opensync.new_ObjFormatSink(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_ObjFormatSink
__del__ = lambda self : None;
def get_objformat(self):
"""get_objformat(self) -> char"""
return _opensync.ObjFormatSink_get_objformat(self)
def get_config(self):
"""get_config(self) -> char"""
return _opensync.ObjFormatSink_get_config(self)
def set_config(self, *args):
"""set_config(self, char config)"""
return _opensync.ObjFormatSink_set_config(self, *args)
config = property(get_config)
objformat = property(get_objformat)
ObjFormatSink_swigregister = _opensync.ObjFormatSink_swigregister
ObjFormatSink_swigregister(ObjFormatSink)
class GroupEnv(object):
"""Proxy of C GroupEnv struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> GroupEnv"""
this = _opensync.new_GroupEnv()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_GroupEnv
__del__ = lambda self : None;
def load_groups(self, path = None):
"""load_groups(self, char path = None)"""
return _opensync.GroupEnv_load_groups(self, path)
def find_group(self, *args):
"""find_group(self, char name) -> Group"""
return _opensync.GroupEnv_find_group(self, *args)
def add_group(self, *args):
"""add_group(self, Group group)"""
return _opensync.GroupEnv_add_group(self, *args)
def remove_group(self, *args):
"""remove_group(self, Group group)"""
return _opensync.GroupEnv_remove_group(self, *args)
def num_groups(self):
"""num_groups(self) -> int"""
return _opensync.GroupEnv_num_groups(self)
def nth_group(self, *args):
"""nth_group(self, int nth) -> Group"""
return _opensync.GroupEnv_nth_group(self, *args)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
self.groups = _ListWrapper(self.num_groups, self.nth_group)
GroupEnv_swigregister = _opensync.GroupEnv_swigregister
GroupEnv_swigregister(GroupEnv)
LOCK_OK = _opensync.LOCK_OK
LOCKED = _opensync.LOCKED
LOCK_STALE = _opensync.LOCK_STALE
CONFLICT_RESOLUTION_UNKNOWN = _opensync.CONFLICT_RESOLUTION_UNKNOWN
CONFLICT_RESOLUTION_DUPLICATE = _opensync.CONFLICT_RESOLUTION_DUPLICATE
CONFLICT_RESOLUTION_IGNORE = _opensync.CONFLICT_RESOLUTION_IGNORE
CONFLICT_RESOLUTION_NEWER = _opensync.CONFLICT_RESOLUTION_NEWER
CONFLICT_RESOLUTION_SELECT = _opensync.CONFLICT_RESOLUTION_SELECT
class Group(object):
"""Proxy of C Group struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Group"""
this = _opensync.new_Group()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Group
__del__ = lambda self : None;
def lock(self):
"""lock(self) -> LockState"""
return _opensync.Group_lock(self)
def unlock(self):
"""unlock(self)"""
return _opensync.Group_unlock(self)
def set_name(self, *args):
"""set_name(self, char name)"""
return _opensync.Group_set_name(self, *args)
def get_name(self):
"""get_name(self) -> char"""
return _opensync.Group_get_name(self)
def save(self):
"""save(self)"""
return _opensync.Group_save(self)
def delete(self):
"""delete(self)"""
return _opensync.Group_delete(self)
def reset(self):
"""reset(self)"""
return _opensync.Group_reset(self)
def load(self, *args):
"""load(self, char path)"""
return _opensync.Group_load(self, *args)
def add_member(self, *args):
"""add_member(self, Member member)"""
return _opensync.Group_add_member(self, *args)
def remove_member(self, *args):
"""remove_member(self, Member member)"""
return _opensync.Group_remove_member(self, *args)
def find_member(self, *args):
"""find_member(self, int id) -> Member"""
return _opensync.Group_find_member(self, *args)
def num_members(self):
"""num_members(self) -> int"""
return _opensync.Group_num_members(self)
def nth_member(self, *args):
"""nth_member(self, int nth) -> Member"""
return _opensync.Group_nth_member(self, *args)
def get_configdir(self):
"""get_configdir(self) -> char"""
return _opensync.Group_get_configdir(self)
def set_configdir(self, *args):
"""set_configdir(self, char directory)"""
return _opensync.Group_set_configdir(self, *args)
def num_objtypes(self):
"""num_objtypes(self) -> int"""
return _opensync.Group_num_objtypes(self)
def nth_objtype(self, *args):
"""nth_objtype(self, int nth) -> char"""
return _opensync.Group_nth_objtype(self, *args)
def set_objtype_enabled(self, *args):
"""set_objtype_enabled(self, char objtype, bool enabled)"""
return _opensync.Group_set_objtype_enabled(self, *args)
def objtype_enabled(self, *args):
"""objtype_enabled(self, char objtype) -> int"""
return _opensync.Group_objtype_enabled(self, *args)
def get_last_synchronization(self):
"""get_last_synchronization(self) -> time_t"""
return _opensync.Group_get_last_synchronization(self)
def set_conflict_resolution(self, *args):
"""set_conflict_resolution(self, ConflictResolution res, int num)"""
return _opensync.Group_set_conflict_resolution(self, *args)
def get_conflict_resolution(self, *args):
"""get_conflict_resolution(self, long long winner)"""
return _opensync.Group_get_conflict_resolution(self, *args)
def get_merger_enabled(self):
"""get_merger_enabled(self) -> bool"""
return _opensync.Group_get_merger_enabled(self)
def set_merger_enabled(self, *args):
"""set_merger_enabled(self, bool enable_merger)"""
return _opensync.Group_set_merger_enabled(self, *args)
def get_converter_enabled(self):
"""get_converter_enabled(self) -> bool"""
return _opensync.Group_get_converter_enabled(self)
def set_converter_enabled(self, *args):
"""set_converter_enabled(self, bool enable_converter)"""
return _opensync.Group_set_converter_enabled(self, *args)
name = property(get_name, set_name)
configdir = property(get_configdir, set_configdir)
last_synchronization = property(get_last_synchronization)
merger_enabled = property(get_merger_enabled, set_merger_enabled)
converter_enabled = property(get_converter_enabled, set_converter_enabled)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
self.members = _ListWrapper(self.num_members, self.nth_member)
self.objtypes = _ListWrapper(self.num_objtypes, self.nth_objtype)
# self.filters = _ListWrapper(self.num_filters, self.nth_filter)
Group_swigregister = _opensync.Group_swigregister
Group_swigregister(Group)
class Member(object):
"""Proxy of C Member struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Member"""
this = _opensync.new_Member()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Member
__del__ = lambda self : None;
def get_pluginname(self):
"""get_pluginname(self) -> char"""
return _opensync.Member_get_pluginname(self)
def set_pluginname(self, *args):
"""set_pluginname(self, char pluginname)"""
return _opensync.Member_set_pluginname(self, *args)
def get_name(self):
"""get_name(self) -> char"""
return _opensync.Member_get_name(self)
def set_name(self, *args):
"""set_name(self, char name)"""
return _opensync.Member_set_name(self, *args)
def get_configdir(self):
"""get_configdir(self) -> char"""
return _opensync.Member_get_configdir(self)
def set_configdir(self, *args):
"""set_configdir(self, char configdir)"""
return _opensync.Member_set_configdir(self, *args)
def get_config_or_default(self):
"""get_config_or_default(self) -> PluginConfig"""
return _opensync.Member_get_config_or_default(self)
def has_config(self):
"""has_config(self) -> bool"""
return _opensync.Member_has_config(self)
def get_config(self):
"""get_config(self) -> PluginConfig"""
return _opensync.Member_get_config(self)
def set_config(self, *args):
"""set_config(self, PluginConfig data)"""
return _opensync.Member_set_config(self, *args)
def load(self, *args):
"""load(self, char path)"""
return _opensync.Member_load(self, *args)
def save(self):
"""save(self)"""
return _opensync.Member_save(self)
def delete(self):
"""delete(self)"""
return _opensync.Member_delete(self)
def get_id(self):
"""get_id(self) -> long long"""
return _opensync.Member_get_id(self)
def add_objformat(self, *args):
"""add_objformat(self, char objtype, char format)"""
return _opensync.Member_add_objformat(self, *args)
def get_objformats(self, *args):
"""get_objformats(self, char objtype) -> PyObject"""
return _opensync.Member_get_objformats(self, *args)
def add_objtype_sink(self, *args):
"""add_objtype_sink(self, ObjTypeSink sink)"""
return _opensync.Member_add_objtype_sink(self, *args)
def objtype_enabled(self, *args):
"""objtype_enabled(self, char objtype) -> bool"""
return _opensync.Member_objtype_enabled(self, *args)
def set_objtype_enabled(self, *args):
"""set_objtype_enabled(self, char objtype, bool enabled)"""
return _opensync.Member_set_objtype_enabled(self, *args)
def get_capabilities(self):
"""get_capabilities(self) -> Capabilities"""
return _opensync.Member_get_capabilities(self)
def set_capabilities(self, *args):
"""set_capabilities(self, Capabilities capabilities)"""
return _opensync.Member_set_capabilities(self, *args)
def flush_objtypes(self):
"""flush_objtypes(self)"""
return _opensync.Member_flush_objtypes(self)
pluginname = property(get_pluginname, set_pluginname)
name = property(get_name, set_name)
configdir = property(get_configdir, set_configdir)
config = property(get_config, set_config)
id = property(get_id)
capabilities = property(get_capabilities, set_capabilities)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
Member_swigregister = _opensync.Member_swigregister
Member_swigregister(Member)
def sink_state_equal(*args):
"""sink_state_equal(OSyncSinkStateDB state_db, char key, char value) -> bool"""
return _opensync.sink_state_equal(*args)
def sink_state_set(*args):
"""sink_state_set(OSyncSinkStateDB state_db, char key, char value) -> bool"""
return _opensync.sink_state_set(*args)
def sink_state_get(*args):
"""sink_state_get(OSyncSinkStateDB state_db, char key) -> char"""
return _opensync.sink_state_get(*args)
def hashtable_slowsync(*args):
"""hashtable_slowsync(OSyncHashTable hashtable) -> bool"""
return _opensync.hashtable_slowsync(*args)
def hashtable_update_change(*args):
"""hashtable_update_change(OSyncHashTable hashtable, Change change)"""
return _opensync.hashtable_update_change(*args)
def hashtable_get_deleted(*args):
"""hashtable_get_deleted(OSyncHashTable hashtable) -> PyObject"""
return _opensync.hashtable_get_deleted(*args)
def hashtable_get_changetype(*args):
"""hashtable_get_changetype(OSyncHashTable hashtable, Change change) -> ChangeType"""
return _opensync.hashtable_get_changetype(*args)
class Capability(object):
"""Proxy of C Capability struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, OSyncCapabilitiesObjType capobjtype) -> Capability"""
this = _opensync.new_Capability(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Capability
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.Capability_get_name(self)
name = property(get_name)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
Capability_swigregister = _opensync.Capability_swigregister
Capability_swigregister(Capability)
class Capabilities(object):
"""Proxy of C Capabilities struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char capsformat) -> Capabilities"""
this = _opensync.new_Capabilities(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Capabilities
__del__ = lambda self : None;
Capabilities_swigregister = _opensync.Capabilities_swigregister
Capabilities_swigregister(Capabilities)
class XMLFormat(object):
"""Proxy of C XMLFormat struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char objtype) -> XMLFormat"""
this = _opensync.new_XMLFormat(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_XMLFormat
__del__ = lambda self : None;
def get_first_field(self):
"""get_first_field(self) -> XMLField"""
return _opensync.XMLFormat_get_first_field(self)
def search_field(self, *args):
"""search_field(self, char name) -> PyObject"""
return _opensync.XMLFormat_search_field(self, *args)
def assemble(self):
"""assemble(self) -> PyObject"""
return _opensync.XMLFormat_assemble(self)
def sort(self):
"""sort(self)"""
return _opensync.XMLFormat_sort(self)
def get_objtype(self):
"""get_objtype(self) -> char"""
return _opensync.XMLFormat_get_objtype(self)
objtype = property(get_objtype)
XMLFormat_swigregister = _opensync.XMLFormat_swigregister
XMLFormat_swigregister(XMLFormat)
def xmlformat_parse(*args):
"""xmlformat_parse(char buffer) -> XMLFormat"""
return _opensync.xmlformat_parse(*args)
class XMLField(object):
"""Proxy of C XMLField struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, XMLFormat xmlformat, char name) -> XMLField"""
this = _opensync.new_XMLField(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_XMLField
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.XMLField_get_name(self)
def get_next(self):
"""get_next(self) -> XMLField"""
return _opensync.XMLField_get_next(self)
def get_attr(self, *args):
"""get_attr(self, char attr) -> char"""
return _opensync.XMLField_get_attr(self, *args)
def set_attr(self, *args):
"""set_attr(self, char attr, char value)"""
return _opensync.XMLField_set_attr(self, *args)
def get_attr_count(self):
"""get_attr_count(self) -> int"""
return _opensync.XMLField_get_attr_count(self)
def get_nth_attr_name(self, *args):
"""get_nth_attr_name(self, int nth) -> char"""
return _opensync.XMLField_get_nth_attr_name(self, *args)
def get_nth_attr_value(self, *args):
"""get_nth_attr_value(self, int nth) -> char"""
return _opensync.XMLField_get_nth_attr_value(self, *args)
def get_key_value(self, *args):
"""get_key_value(self, char key) -> char"""
return _opensync.XMLField_get_key_value(self, *args)
def set_key_value(self, *args):
"""set_key_value(self, char key, char value)"""
return _opensync.XMLField_set_key_value(self, *args)
def add_key_value(self, *args):
"""add_key_value(self, char key, char value)"""
return _opensync.XMLField_add_key_value(self, *args)
def get_key_count(self):
"""get_key_count(self) -> int"""
return _opensync.XMLField_get_key_count(self)
def get_nth_key_name(self, *args):
"""get_nth_key_name(self, int nth) -> char"""
return _opensync.XMLField_get_nth_key_name(self, *args)
def get_nth_key_value(self, *args):
"""get_nth_key_value(self, int nth) -> char"""
return _opensync.XMLField_get_nth_key_value(self, *args)
def set_nth_key_value(self, *args):
"""set_nth_key_value(self, int nth, char value)"""
return _opensync.XMLField_set_nth_key_value(self, *args)
name = property(get_name)
next = property(get_next)
# map attributes and keys to two properties of the XMLField object
class Attrs:
def __init__(self, xmlfield):
self.xmlfield = xmlfield
def __len__(self):
return self.xmlfield.get_attr_count()
def __getitem__(self, key):
return self.xmlfield.get_attr(key)
def __setitem__(self, key, value):
self.xmlfield.set_attr(key, value)
def __iter__(self):
class Iter:
def __init__(self, xmlfield):
self.xmlfield = xmlfield
self.pos = 0
self.maxpos = self.xmlfield.get_attr_count()
def __iter__(self):
return self
def next(self):
if self.pos > self.maxpos:
raise StopIteration
name = self.xmlfield.get_nth_attr_name(self.pos)
value = self.xmlfield.get_nth_attr_value(self.pos)
self.pos += 1
return (name, value)
return Iter(self.xmlfield)
class Keys:
def __init__(self, xmlfield):
self.xmlfield = xmlfield
def __len__(self):
return self.xmlfield.get_key_count()
def __getitem__(self, key):
return self.xmlfield.get_key_value(key)
def __setitem__(self, key, value):
self.xmlfield.set_key_value(key, value)
def __iter__(self):
class Iter:
def __init__(self, xmlfield):
self.xmlfield = xmlfield
self.pos = 0
self.maxpos = self.xmlfield.get_key_count()
def __iter__(self):
return self
def next(self):
if self.pos > self.maxpos:
raise StopIteration
name = self.xmlfield.get_nth_key_name(self.pos)
value = self.xmlfield.get_nth_key_value(self.pos)
self.pos += 1
return (name, value)
return Iter(self.xmlfield)
attrs = property(Attrs)
keys = property(Keys)
XMLField_swigregister = _opensync.XMLField_swigregister
XMLField_swigregister(XMLField)
PLUGIN_NO_CONFIGURATION = _opensync.PLUGIN_NO_CONFIGURATION
PLUGIN_OPTIONAL_CONFIGURATION = _opensync.PLUGIN_OPTIONAL_CONFIGURATION
PLUGIN_NEEDS_CONFIGURATION = _opensync.PLUGIN_NEEDS_CONFIGURATION
START_TYPE_UNKNOWN = _opensync.START_TYPE_UNKNOWN
START_TYPE_PROCESS = _opensync.START_TYPE_PROCESS
START_TYPE_THREAD = _opensync.START_TYPE_THREAD
START_TYPE_EXTERNAL = _opensync.START_TYPE_EXTERNAL
class Plugin(object):
"""Proxy of C Plugin struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> Plugin
__init__(self) -> Plugin
"""
this = _opensync.new_Plugin(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Plugin
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.Plugin_get_name(self)
def set_name(self, *args):
"""set_name(self, char name)"""
return _opensync.Plugin_set_name(self, *args)
def get_longname(self):
"""get_longname(self) -> char"""
return _opensync.Plugin_get_longname(self)
def set_longname(self, *args):
"""set_longname(self, char longname)"""
return _opensync.Plugin_set_longname(self, *args)
def get_description(self):
"""get_description(self) -> char"""
return _opensync.Plugin_get_description(self)
def set_description(self, *args):
"""set_description(self, char description)"""
return _opensync.Plugin_set_description(self, *args)
def get_config_type(self):
"""get_config_type(self) -> ConfigurationType"""
return _opensync.Plugin_get_config_type(self)
def set_config_type(self, *args):
"""set_config_type(self, ConfigurationType config_type)"""
return _opensync.Plugin_set_config_type(self, *args)
def initialize(self, *args):
"""initialize(self, PluginInfo info, void plugin_data) -> osync_bool"""
return _opensync.Plugin_initialize(self, *args)
def finalize(self, *args):
"""finalize(self, void data)"""
return _opensync.Plugin_finalize(self, *args)
def discover(self, *args):
"""discover(self, void data, PluginInfo info)"""
return _opensync.Plugin_discover(self, *args)
name = property(get_name, set_name)
longname = property(get_longname, set_longname)
description = property(get_description, set_description)
config_type = property(get_config_type, set_config_type)
Plugin_swigregister = _opensync.Plugin_swigregister
Plugin_swigregister(Plugin)
class PluginEnv(object):
"""Proxy of C PluginEnv struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> PluginEnv"""
this = _opensync.new_PluginEnv()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_PluginEnv
__del__ = lambda self : None;
def load(self, path = None):
"""load(self, char path = None)"""
return _opensync.PluginEnv_load(self, path)
def register_plugin(self, *args):
"""register_plugin(self, Plugin plugin)"""
return _opensync.PluginEnv_register_plugin(self, *args)
def find_plugin(self, *args):
"""find_plugin(self, char name) -> Plugin"""
return _opensync.PluginEnv_find_plugin(self, *args)
def num_plugins(self):
"""num_plugins(self) -> int"""
return _opensync.PluginEnv_num_plugins(self)
def nth_plugin(self, *args):
"""nth_plugin(self, int nth) -> Plugin"""
return _opensync.PluginEnv_nth_plugin(self, *args)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
self.plugins = _ListWrapper(self.num_plugins, self.nth_plugin)
PluginEnv_swigregister = _opensync.PluginEnv_swigregister
PluginEnv_swigregister(PluginEnv)
class PluginInfo(object):
"""Proxy of C PluginInfo struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> PluginInfo
__init__(self) -> PluginInfo
"""
this = _opensync.new_PluginInfo(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_PluginInfo
__del__ = lambda self : None;
def set_loop(self, *args):
"""set_loop(self, void loop)"""
return _opensync.PluginInfo_set_loop(self, *args)
def get_loop(self):
"""get_loop(self) -> void"""
return _opensync.PluginInfo_get_loop(self)
def set_config(self, *args):
"""set_config(self, PluginConfig config)"""
return _opensync.PluginInfo_set_config(self, *args)
def get_config(self):
"""get_config(self) -> PluginConfig"""
return _opensync.PluginInfo_get_config(self)
def set_configdir(self, *args):
"""set_configdir(self, char configdir)"""
return _opensync.PluginInfo_set_configdir(self, *args)
def find_objtype(self, *args):
"""find_objtype(self, char name) -> ObjTypeSink"""
return _opensync.PluginInfo_find_objtype(self, *args)
def add_objtype(self, *args):
"""add_objtype(self, ObjTypeSink sink)"""
return _opensync.PluginInfo_add_objtype(self, *args)
def num_objtype_sinks(self):
"""num_objtype_sinks(self) -> unsigned int"""
return _opensync.PluginInfo_num_objtype_sinks(self)
def nth_objtype(self, *args):
"""nth_objtype(self, int nth) -> ObjTypeSink"""
return _opensync.PluginInfo_nth_objtype(self, *args)
def get_main_sink(self):
"""get_main_sink(self) -> ObjTypeSink"""
return _opensync.PluginInfo_get_main_sink(self)
def set_main_sink(self, *args):
"""set_main_sink(self, ObjTypeSink sink)"""
return _opensync.PluginInfo_set_main_sink(self, *args)
def get_format_env(self):
"""get_format_env(self) -> FormatEnv"""
return _opensync.PluginInfo_get_format_env(self)
def set_format_env(self, *args):
"""set_format_env(self, FormatEnv env)"""
return _opensync.PluginInfo_set_format_env(self, *args)
def set_sink(self, *args):
"""set_sink(self, ObjTypeSink sink)"""
return _opensync.PluginInfo_set_sink(self, *args)
def set_groupname(self, *args):
"""set_groupname(self, char groupname)"""
return _opensync.PluginInfo_set_groupname(self, *args)
def get_groupname(self):
"""get_groupname(self) -> char"""
return _opensync.PluginInfo_get_groupname(self)
def set_version(self, *args):
"""set_version(self, Version version)"""
return _opensync.PluginInfo_set_version(self, *args)
def get_version(self):
"""get_version(self) -> Version"""
return _opensync.PluginInfo_get_version(self)
def set_capabilities(self, *args):
"""set_capabilities(self, Capabilities capabilities)"""
return _opensync.PluginInfo_set_capabilities(self, *args)
def get_capabilities(self):
"""get_capabilities(self) -> Capabilities"""
return _opensync.PluginInfo_get_capabilities(self)
loop = property(get_loop, set_loop)
config = property(get_config, set_config)
main_sink = property(get_main_sink, set_main_sink)
format_env = property(get_format_env, set_format_env)
# sink = property(get_sink, set_sink)
groupname = property(get_groupname, set_groupname)
version = property(get_version, set_version)
capabilities = property(get_capabilities, set_capabilities)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
self.objtypes = _ListWrapper(self.num_objtype_sinks, self.nth_objtype)
PluginInfo_swigregister = _opensync.PluginInfo_swigregister
PluginInfo_swigregister(PluginInfo)
class PluginConfig(object):
"""Proxy of C PluginConfig struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, PyObject obj) -> PluginConfig
__init__(self) -> PluginConfig
"""
this = _opensync.new_PluginConfig(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_PluginConfig
__del__ = lambda self : None;
PluginConfig_swigregister = _opensync.PluginConfig_swigregister
PluginConfig_swigregister(PluginConfig)
class ObjTypeSink(object):
"""Proxy of C ObjTypeSink struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, char objtype, PyObject callback_obj = None) -> ObjTypeSink"""
this = _opensync.new_ObjTypeSink(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_ObjTypeSink
__del__ = lambda self : None;
def get_name(self):
"""get_name(self) -> char"""
return _opensync.ObjTypeSink_get_name(self)
def set_name(self, *args):
"""set_name(self, char name)"""
return _opensync.ObjTypeSink_set_name(self, *args)
def find_objformat(self, *args):
"""find_objformat(self, ObjFormat objformat) -> ObjFormatSink"""
return _opensync.ObjTypeSink_find_objformat(self, *args)
def add_objformat(self, *args):
"""add_objformat(self, ObjFormatSink format_sink)"""
return _opensync.ObjTypeSink_add_objformat(self, *args)
def remove_objformat(self, *args):
"""remove_objformat(self, ObjFormatSink format_sink)"""
return _opensync.ObjTypeSink_remove_objformat(self, *args)
def get_state_db(self):
"""get_state_db(self) -> OSyncSinkStateDB"""
return _opensync.ObjTypeSink_get_state_db(self)
def get_hashtable(self):
"""get_hashtable(self) -> OSyncHashTable"""
return _opensync.ObjTypeSink_get_hashtable(self)
def is_enabled(self):
"""is_enabled(self) -> bool"""
return _opensync.ObjTypeSink_is_enabled(self)
def set_enabled(self, *args):
"""set_enabled(self, bool enabled)"""
return _opensync.ObjTypeSink_set_enabled(self, *args)
def is_available(self):
"""is_available(self) -> bool"""
return _opensync.ObjTypeSink_is_available(self)
def set_available(self, *args):
"""set_available(self, bool available)"""
return _opensync.ObjTypeSink_set_available(self, *args)
def get_write(self):
"""get_write(self) -> bool"""
return _opensync.ObjTypeSink_get_write(self)
def set_write(self, *args):
"""set_write(self, bool write)"""
return _opensync.ObjTypeSink_set_write(self, *args)
def get_read(self):
"""get_read(self) -> bool"""
return _opensync.ObjTypeSink_get_read(self)
def set_read(self, *args):
"""set_read(self, bool read)"""
return _opensync.ObjTypeSink_set_read(self, *args)
def num_objformatsinks(self):
"""num_objformatsinks(self) -> unsigned int"""
return _opensync.ObjTypeSink_num_objformatsinks(self)
def nth_objformatsink(self, *args):
"""nth_objformatsink(self, int nth) -> ObjFormatSink"""
return _opensync.ObjTypeSink_nth_objformatsink(self, *args)
name = property(get_name, set_name)
enabled = property(is_enabled, set_enabled)
available = property(is_available, set_available)
write = property(get_write, set_write)
read = property(get_read, set_read)
#slowsync = property(get_slowsync, set_slowsync)
#callback_obj = property(get_callback_obj)
# extend the SWIG-generated constructor, so that we can setup our list-wrapper classes
__oldinit = __init__
def __init__(self, *args):
self.__oldinit(*args)
self.objformats = _ListWrapper(self.num_objformatsinks, self.nth_objformatsink)
ObjTypeSink_swigregister = _opensync.ObjTypeSink_swigregister
ObjTypeSink_swigregister(ObjTypeSink)
class ObjTypeSinkCallbacks:
"""A purely-Python class that should be subclassed by plugins implementing their own sinks."""
def __init__(self, objtype):
# construct ObjTypeSink object and pass it our reference
self.sink = ObjTypeSink(objtype, self)
def connect(self, info, ctx):
pass
def get_changes(self, info, ctx):
pass
def commit(self, info, ctx, chg):
pass
def committed_all(self, info, ctx):
pass
def read(self, info, ctx, chg):
pass
def write(self, info, ctx, chg):
pass
def disconnect(self, info, ctx):
pass
def sync_done(self, info, ctx):
pass
TRACE_ENTRY = _opensync.TRACE_ENTRY
TRACE_EXIT = _opensync.TRACE_EXIT
TRACE_INTERNAL = _opensync.TRACE_INTERNAL
TRACE_SENSITIVE = _opensync.TRACE_SENSITIVE
TRACE_EXIT_ERROR = _opensync.TRACE_EXIT_ERROR
TRACE_ERROR = _opensync.TRACE_ERROR
def trace_reset_indent():
"""trace_reset_indent()"""
return _opensync.trace_reset_indent()
def trace(*args):
"""trace(TraceType type, char message)"""
return _opensync.trace(*args)
def trace_disable():
"""trace_disable()"""
return _opensync.trace_disable()
def trace_enable():
"""trace_enable()"""
return _opensync.trace_enable()
def get_version():
"""get_version() -> char"""
return _opensync.get_version()
# this won't change, so just call it once at module load time
version = get_version()
class Version(object):
"""Proxy of C Version struct"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Version"""
this = _opensync.new_Version()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _opensync.delete_Version
__del__ = lambda self : None;
def set_priority(self, *args):
"""set_priority(self, char priority)"""
return _opensync.Version_set_priority(self, *args)
def set_vendor(self, *args):
"""set_vendor(self, char vendor)"""
return _opensync.Version_set_vendor(self, *args)
def set_plugin(self, *args):
"""set_plugin(self, char plugin)"""
return _opensync.Version_set_plugin(self, *args)
def set_modelversion(self, *args):
"""set_modelversion(self, char modelversion)"""
return _opensync.Version_set_modelversion(self, *args)
def set_firmwareversion(self, *args):
"""set_firmwareversion(self, char firmwareversion)"""
return _opensync.Version_set_firmwareversion(self, *args)
def set_softwareversion(self, *args):
"""set_softwareversion(self, char softwareversion)"""
return _opensync.Version_set_softwareversion(self, *args)
def set_hardwareversion(self, *args):
"""set_hardwareversion(self, char hardwareversion)"""
return _opensync.Version_set_hardwareversion(self, *args)
def set_identifier(self, *args):
"""set_identifier(self, char identifier)"""
return _opensync.Version_set_identifier(self, *args)
# plugin = property(get_plugin, set_plugin)
# priority = property(get_priority, set_priority)
# vendor = property(get_vendor, set_vendor)
# modelversion = property(get_modelversion, set_modelversion)
# firmwareversion = property(get_firmwareversion, set_firmwareversion)
# softwareversion = property(get_softwareversion, set_softwareversion)
# hardwareversion = property(get_hardwareversion, set_hardwareversion)
# identifier = property(get_identifier, set_identifier)
Version_swigregister = _opensync.Version_swigregister
Version_swigregister(Version)
|