/usr/share/doc/cedar-backup3-doc/interface/CedarBackup3.util-pysrc.html is in cedar-backup3-doc 3.1.6-1.
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 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 | <?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>CedarBackup3.util</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="CedarBackup3-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://bitbucket.org/cedarsolutions/cedar-backup3">CedarBackup3</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="CedarBackup3-module.html">Package CedarBackup3</a> ::
Module util
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="CedarBackup3.util-pysrc.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<h1 class="epydoc">Source Code for <a href="CedarBackup3.util-module.html">Module CedarBackup3.util</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># -*- coding: iso-8859-1 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"># vim: set ft=python ts=3 sw=3 expandtab:</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"># C E D A R</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"># S O L U T I O N S "Software done right."</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"># S O F T W A R E</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"># Copyright (c) 2004-2008,2010,2015 Kenneth J. Pronovici.</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"># All rights reserved.</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment"># Portions copyright (c) 2001, 2002 Python Software Foundation.</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"># All Rights Reserved.</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"># This program is free software; you can redistribute it and/or</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-comment"># modify it under the terms of the GNU General Public License,</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-comment"># Version 2, as published by the Free Software Foundation.</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-comment"># This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"><tt class="py-comment"># Copies of the GNU General Public License are available from</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"><tt class="py-comment"># the Free Software Foundation website, http://www.gnu.org/.</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"><tt class="py-comment"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"><tt class="py-comment"># Author : Kenneth J. Pronovici <pronovic@ieee.org></tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"><tt class="py-comment"># Language : Python 3 (>= 3.4)</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"><tt class="py-comment"># Project : Cedar Backup, release 3</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"><tt class="py-comment"># Purpose : Provides general-purpose utilities.</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"><tt class="py-comment"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"><tt class="py-comment"># Module documentation</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"><tt class="py-docstring">Provides general-purpose utilities.</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"><tt class="py-docstring">@sort: AbsolutePathList, ObjectTypeList, RestrictedContentList, RegexMatchList,</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"><tt class="py-docstring"> RegexList, _Vertex, DirectedGraph, PathResolverSingleton,</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"><tt class="py-docstring"> sortDict, convertSize, getUidGid, changeOwnership, splitCommandLine,</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"><tt class="py-docstring"> resolveCommand, executeCommand, calculateFileAge, encodePath, nullDevice,</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"><tt class="py-docstring"> deriveDayOfWeek, isStartOfWeek, buildNormalizedPath,</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"><tt class="py-docstring"> ISO_SECTOR_SIZE, BYTES_PER_SECTOR,</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"><tt class="py-docstring"> BYTES_PER_KBYTE, BYTES_PER_MBYTE, BYTES_PER_GBYTE, KBYTES_PER_MBYTE, MBYTES_PER_GBYTE,</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"><tt class="py-docstring"> SECONDS_PER_MINUTE, MINUTES_PER_HOUR, HOURS_PER_DAY, SECONDS_PER_DAY,</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"><tt class="py-docstring"> UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES, UNIT_SECTORS</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"><tt class="py-docstring">@var ISO_SECTOR_SIZE: Size of an ISO image sector, in bytes.</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"><tt class="py-docstring">@var BYTES_PER_SECTOR: Number of bytes (B) per ISO sector.</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"><tt class="py-docstring">@var BYTES_PER_KBYTE: Number of bytes (B) per kilobyte (kB).</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"><tt class="py-docstring">@var BYTES_PER_MBYTE: Number of bytes (B) per megabyte (MB).</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"><tt class="py-docstring">@var BYTES_PER_GBYTE: Number of bytes (B) per megabyte (GB).</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"><tt class="py-docstring">@var KBYTES_PER_MBYTE: Number of kilobytes (kB) per megabyte (MB).</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"><tt class="py-docstring">@var MBYTES_PER_GBYTE: Number of megabytes (MB) per gigabyte (GB).</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"><tt class="py-docstring">@var SECONDS_PER_MINUTE: Number of seconds per minute.</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"><tt class="py-docstring">@var MINUTES_PER_HOUR: Number of minutes per hour.</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"><tt class="py-docstring">@var HOURS_PER_DAY: Number of hours per day.</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"><tt class="py-docstring">@var SECONDS_PER_DAY: Number of seconds per day.</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"><tt class="py-docstring">@var UNIT_BYTES: Constant representing the byte (B) unit for conversion.</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"><tt class="py-docstring">@var UNIT_KBYTES: Constant representing the kilobyte (kB) unit for conversion.</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"><tt class="py-docstring">@var UNIT_MBYTES: Constant representing the megabyte (MB) unit for conversion.</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"><tt class="py-docstring">@var UNIT_GBYTES: Constant representing the gigabyte (GB) unit for conversion.</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"><tt class="py-docstring">@var UNIT_SECTORS: Constant representing the ISO sector unit for conversion.</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"><tt class="py-docstring">@author: Kenneth J. Pronovici <pronovic@ieee.org></tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"><tt class="py-comment"># Imported modules</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">math</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">time</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">subprocess</tt> <tt class="py-keyword">import</tt> <tt class="py-name">Popen</tt><tt class="py-op">,</tt> <tt class="py-name">STDOUT</tt><tt class="py-op">,</tt> <tt class="py-name">PIPE</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">functools</tt> <tt class="py-keyword">import</tt> <tt class="py-name">total_ordering</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">numbers</tt> <tt class="py-keyword">import</tt> <tt class="py-name">Real</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">decimal</tt> <tt class="py-keyword">import</tt> <tt class="py-name">Decimal</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">collections</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">pwd</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">grp</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt id="link-0" class="py-name" targets="Variable CedarBackup3.util._UID_GID_AVAILABLE=CedarBackup3.util-module.html#_UID_GID_AVAILABLE"><a title="CedarBackup3.util._UID_GID_AVAILABLE" class="py-name" href="#" onclick="return doclink('link-0', '_UID_GID_AVAILABLE', 'link-0');">_UID_GID_AVAILABLE</a></tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"><tt class="py-keyword">except</tt> <tt class="py-name">ImportError</tt><tt class="py-op">:</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt id="link-1" class="py-name"><a title="CedarBackup3.util._UID_GID_AVAILABLE" class="py-name" href="#" onclick="return doclink('link-1', '_UID_GID_AVAILABLE', 'link-0');">_UID_GID_AVAILABLE</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Package CedarBackup3=CedarBackup3-module.html"><a title="CedarBackup3" class="py-name" href="#" onclick="return doclink('link-2', 'CedarBackup3', 'link-2');">CedarBackup3</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Module CedarBackup3.release=CedarBackup3.release-module.html"><a title="CedarBackup3.release" class="py-name" href="#" onclick="return doclink('link-3', 'release', 'link-3');">release</a></tt> <tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Variable CedarBackup3.release.VERSION=CedarBackup3.release-module.html#VERSION"><a title="CedarBackup3.release.VERSION" class="py-name" href="#" onclick="return doclink('link-4', 'VERSION', 'link-4');">VERSION</a></tt><tt class="py-op">,</tt> <tt id="link-5" class="py-name" targets="Variable CedarBackup3.release.DATE=CedarBackup3.release-module.html#DATE"><a title="CedarBackup3.release.DATE" class="py-name" href="#" onclick="return doclink('link-5', 'DATE', 'link-5');">DATE</a></tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> </tt>
<a name="L100"></a><tt class="py-lineno"> 100</tt> <tt class="py-line"> </tt>
<a name="L101"></a><tt class="py-lineno"> 101</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L102"></a><tt class="py-lineno"> 102</tt> <tt class="py-line"><tt class="py-comment"># Module-wide constants and variables</tt> </tt>
<a name="L103"></a><tt class="py-lineno"> 103</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L104"></a><tt class="py-lineno"> 104</tt> <tt class="py-line"> </tt>
<a name="L105"></a><tt class="py-lineno"> 105</tt> <tt class="py-line"><tt id="link-6" class="py-name" targets="Variable CedarBackup3.actions.collect.logger=CedarBackup3.actions.collect-module.html#logger,Variable CedarBackup3.actions.initialize.logger=CedarBackup3.actions.initialize-module.html#logger,Variable CedarBackup3.actions.purge.logger=CedarBackup3.actions.purge-module.html#logger,Variable CedarBackup3.actions.rebuild.logger=CedarBackup3.actions.rebuild-module.html#logger,Variable CedarBackup3.actions.stage.logger=CedarBackup3.actions.stage-module.html#logger,Variable CedarBackup3.actions.store.logger=CedarBackup3.actions.store-module.html#logger,Variable CedarBackup3.actions.util.logger=CedarBackup3.actions.util-module.html#logger,Variable CedarBackup3.actions.validate.logger=CedarBackup3.actions.validate-module.html#logger,Variable CedarBackup3.cli.logger=CedarBackup3.cli-module.html#logger,Variable CedarBackup3.config.logger=CedarBackup3.config-module.html#logger,Variable CedarBackup3.customize.logger=CedarBackup3.customize-module.html#logger,Variable CedarBackup3.extend.amazons3.logger=CedarBackup3.extend.amazons3-module.html#logger,Variable CedarBackup3.extend.capacity.logger=CedarBackup3.extend.capacity-module.html#logger,Variable CedarBackup3.extend.encrypt.logger=CedarBackup3.extend.encrypt-module.html#logger,Variable CedarBackup3.extend.mbox.logger=CedarBackup3.extend.mbox-module.html#logger,Variable CedarBackup3.extend.mysql.logger=CedarBackup3.extend.mysql-module.html#logger,Variable CedarBackup3.extend.postgresql.logger=CedarBackup3.extend.postgresql-module.html#logger,Variable CedarBackup3.extend.split.logger=CedarBackup3.extend.split-module.html#logger,Variable CedarBackup3.extend.subversion.logger=CedarBackup3.extend.subversion-module.html#logger,Variable CedarBackup3.extend.sysinfo.logger=CedarBackup3.extend.sysinfo-module.html#logger,Variable CedarBackup3.filesystem.logger=CedarBackup3.filesystem-module.html#logger,Variable CedarBackup3.peer.logger=CedarBackup3.peer-module.html#logger,Variable CedarBackup3.tools.amazons3.logger=CedarBackup3.tools.amazons3-module.html#logger,Variable CedarBackup3.tools.span.logger=CedarBackup3.tools.span-module.html#logger,Variable CedarBackup3.util.logger=CedarBackup3.util-module.html#logger,Variable CedarBackup3.writers.cdwriter.logger=CedarBackup3.writers.cdwriter-module.html#logger,Variable CedarBackup3.writers.dvdwriter.logger=CedarBackup3.writers.dvdwriter-module.html#logger,Variable CedarBackup3.writers.util.logger=CedarBackup3.writers.util-module.html#logger,Variable CedarBackup3.xmlutil.logger=CedarBackup3.xmlutil-module.html#logger"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-6', 'logger', 'link-6');">logger</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">getLogger</tt><tt class="py-op">(</tt><tt class="py-string">"CedarBackup3.log.util"</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno"> 106</tt> <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable CedarBackup3.util.outputLogger=CedarBackup3.util-module.html#outputLogger"><a title="CedarBackup3.util.outputLogger" class="py-name" href="#" onclick="return doclink('link-7', 'outputLogger', 'link-7');">outputLogger</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">getLogger</tt><tt class="py-op">(</tt><tt class="py-string">"CedarBackup3.output"</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno"> 107</tt> <tt class="py-line"> </tt>
<a name="L108"></a><tt class="py-lineno"> 108</tt> <tt class="py-line"><tt id="link-8" class="py-name" targets="Variable CedarBackup3.util.ISO_SECTOR_SIZE=CedarBackup3.util-module.html#ISO_SECTOR_SIZE"><a title="CedarBackup3.util.ISO_SECTOR_SIZE" class="py-name" href="#" onclick="return doclink('link-8', 'ISO_SECTOR_SIZE', 'link-8');">ISO_SECTOR_SIZE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2048.0</tt> <tt class="py-comment"># in bytes</tt> </tt>
<a name="L109"></a><tt class="py-lineno"> 109</tt> <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable CedarBackup3.util.BYTES_PER_SECTOR=CedarBackup3.util-module.html#BYTES_PER_SECTOR"><a title="CedarBackup3.util.BYTES_PER_SECTOR" class="py-name" href="#" onclick="return doclink('link-9', 'BYTES_PER_SECTOR', 'link-9');">BYTES_PER_SECTOR</a></tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="CedarBackup3.util.ISO_SECTOR_SIZE" class="py-name" href="#" onclick="return doclink('link-10', 'ISO_SECTOR_SIZE', 'link-8');">ISO_SECTOR_SIZE</a></tt> </tt>
<a name="L110"></a><tt class="py-lineno"> 110</tt> <tt class="py-line"> </tt>
<a name="L111"></a><tt class="py-lineno"> 111</tt> <tt class="py-line"><tt id="link-11" class="py-name" targets="Variable CedarBackup3.util.BYTES_PER_KBYTE=CedarBackup3.util-module.html#BYTES_PER_KBYTE"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-11', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1024.0</tt> </tt>
<a name="L112"></a><tt class="py-lineno"> 112</tt> <tt class="py-line"><tt id="link-12" class="py-name" targets="Variable CedarBackup3.util.KBYTES_PER_MBYTE=CedarBackup3.util-module.html#KBYTES_PER_MBYTE"><a title="CedarBackup3.util.KBYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-12', 'KBYTES_PER_MBYTE', 'link-12');">KBYTES_PER_MBYTE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1024.0</tt> </tt>
<a name="L113"></a><tt class="py-lineno"> 113</tt> <tt class="py-line"><tt id="link-13" class="py-name" targets="Variable CedarBackup3.util.MBYTES_PER_GBYTE=CedarBackup3.util-module.html#MBYTES_PER_GBYTE"><a title="CedarBackup3.util.MBYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-13', 'MBYTES_PER_GBYTE', 'link-13');">MBYTES_PER_GBYTE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1024.0</tt> </tt>
<a name="L114"></a><tt class="py-lineno"> 114</tt> <tt class="py-line"><tt id="link-14" class="py-name" targets="Variable CedarBackup3.util.BYTES_PER_MBYTE=CedarBackup3.util-module.html#BYTES_PER_MBYTE"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-14', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt> <tt class="py-op">=</tt> <tt id="link-15" class="py-name"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-15', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt> <tt class="py-op">*</tt> <tt id="link-16" class="py-name"><a title="CedarBackup3.util.KBYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-16', 'KBYTES_PER_MBYTE', 'link-12');">KBYTES_PER_MBYTE</a></tt> </tt>
<a name="L115"></a><tt class="py-lineno"> 115</tt> <tt class="py-line"><tt id="link-17" class="py-name" targets="Variable CedarBackup3.util.BYTES_PER_GBYTE=CedarBackup3.util-module.html#BYTES_PER_GBYTE"><a title="CedarBackup3.util.BYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-17', 'BYTES_PER_GBYTE', 'link-17');">BYTES_PER_GBYTE</a></tt> <tt class="py-op">=</tt> <tt id="link-18" class="py-name"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-18', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt> <tt class="py-op">*</tt> <tt id="link-19" class="py-name"><a title="CedarBackup3.util.MBYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-19', 'MBYTES_PER_GBYTE', 'link-13');">MBYTES_PER_GBYTE</a></tt> </tt>
<a name="L116"></a><tt class="py-lineno"> 116</tt> <tt class="py-line"> </tt>
<a name="L117"></a><tt class="py-lineno"> 117</tt> <tt class="py-line"><tt id="link-20" class="py-name" targets="Variable CedarBackup3.util.SECONDS_PER_MINUTE=CedarBackup3.util-module.html#SECONDS_PER_MINUTE"><a title="CedarBackup3.util.SECONDS_PER_MINUTE" class="py-name" href="#" onclick="return doclink('link-20', 'SECONDS_PER_MINUTE', 'link-20');">SECONDS_PER_MINUTE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">60.0</tt> </tt>
<a name="L118"></a><tt class="py-lineno"> 118</tt> <tt class="py-line"><tt id="link-21" class="py-name" targets="Variable CedarBackup3.util.MINUTES_PER_HOUR=CedarBackup3.util-module.html#MINUTES_PER_HOUR"><a title="CedarBackup3.util.MINUTES_PER_HOUR" class="py-name" href="#" onclick="return doclink('link-21', 'MINUTES_PER_HOUR', 'link-21');">MINUTES_PER_HOUR</a></tt> <tt class="py-op">=</tt> <tt class="py-number">60.0</tt> </tt>
<a name="L119"></a><tt class="py-lineno"> 119</tt> <tt class="py-line"><tt id="link-22" class="py-name" targets="Variable CedarBackup3.util.HOURS_PER_DAY=CedarBackup3.util-module.html#HOURS_PER_DAY"><a title="CedarBackup3.util.HOURS_PER_DAY" class="py-name" href="#" onclick="return doclink('link-22', 'HOURS_PER_DAY', 'link-22');">HOURS_PER_DAY</a></tt> <tt class="py-op">=</tt> <tt class="py-number">24.0</tt> </tt>
<a name="L120"></a><tt class="py-lineno"> 120</tt> <tt class="py-line"><tt id="link-23" class="py-name" targets="Variable CedarBackup3.util.SECONDS_PER_DAY=CedarBackup3.util-module.html#SECONDS_PER_DAY"><a title="CedarBackup3.util.SECONDS_PER_DAY" class="py-name" href="#" onclick="return doclink('link-23', 'SECONDS_PER_DAY', 'link-23');">SECONDS_PER_DAY</a></tt> <tt class="py-op">=</tt> <tt id="link-24" class="py-name"><a title="CedarBackup3.util.SECONDS_PER_MINUTE" class="py-name" href="#" onclick="return doclink('link-24', 'SECONDS_PER_MINUTE', 'link-20');">SECONDS_PER_MINUTE</a></tt> <tt class="py-op">*</tt> <tt id="link-25" class="py-name"><a title="CedarBackup3.util.MINUTES_PER_HOUR" class="py-name" href="#" onclick="return doclink('link-25', 'MINUTES_PER_HOUR', 'link-21');">MINUTES_PER_HOUR</a></tt> <tt class="py-op">*</tt> <tt id="link-26" class="py-name"><a title="CedarBackup3.util.HOURS_PER_DAY" class="py-name" href="#" onclick="return doclink('link-26', 'HOURS_PER_DAY', 'link-22');">HOURS_PER_DAY</a></tt> </tt>
<a name="L121"></a><tt class="py-lineno"> 121</tt> <tt class="py-line"> </tt>
<a name="L122"></a><tt class="py-lineno"> 122</tt> <tt class="py-line"><tt id="link-27" class="py-name" targets="Variable CedarBackup3.util.UNIT_BYTES=CedarBackup3.util-module.html#UNIT_BYTES"><a title="CedarBackup3.util.UNIT_BYTES" class="py-name" href="#" onclick="return doclink('link-27', 'UNIT_BYTES', 'link-27');">UNIT_BYTES</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L123"></a><tt class="py-lineno"> 123</tt> <tt class="py-line"><tt id="link-28" class="py-name" targets="Variable CedarBackup3.util.UNIT_KBYTES=CedarBackup3.util-module.html#UNIT_KBYTES"><a title="CedarBackup3.util.UNIT_KBYTES" class="py-name" href="#" onclick="return doclink('link-28', 'UNIT_KBYTES', 'link-28');">UNIT_KBYTES</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L124"></a><tt class="py-lineno"> 124</tt> <tt class="py-line"><tt id="link-29" class="py-name" targets="Variable CedarBackup3.util.UNIT_MBYTES=CedarBackup3.util-module.html#UNIT_MBYTES"><a title="CedarBackup3.util.UNIT_MBYTES" class="py-name" href="#" onclick="return doclink('link-29', 'UNIT_MBYTES', 'link-29');">UNIT_MBYTES</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L125"></a><tt class="py-lineno"> 125</tt> <tt class="py-line"><tt id="link-30" class="py-name" targets="Variable CedarBackup3.util.UNIT_GBYTES=CedarBackup3.util-module.html#UNIT_GBYTES"><a title="CedarBackup3.util.UNIT_GBYTES" class="py-name" href="#" onclick="return doclink('link-30', 'UNIT_GBYTES', 'link-30');">UNIT_GBYTES</a></tt> <tt class="py-op">=</tt> <tt class="py-number">4</tt> </tt>
<a name="L126"></a><tt class="py-lineno"> 126</tt> <tt class="py-line"><tt id="link-31" class="py-name" targets="Variable CedarBackup3.util.UNIT_SECTORS=CedarBackup3.util-module.html#UNIT_SECTORS"><a title="CedarBackup3.util.UNIT_SECTORS" class="py-name" href="#" onclick="return doclink('link-31', 'UNIT_SECTORS', 'link-31');">UNIT_SECTORS</a></tt> <tt class="py-op">=</tt> <tt class="py-number">3</tt> </tt>
<a name="L127"></a><tt class="py-lineno"> 127</tt> <tt class="py-line"> </tt>
<a name="L128"></a><tt class="py-lineno"> 128</tt> <tt class="py-line"><tt id="link-32" class="py-name" targets="Variable CedarBackup3.util.MTAB_FILE=CedarBackup3.util-module.html#MTAB_FILE"><a title="CedarBackup3.util.MTAB_FILE" class="py-name" href="#" onclick="return doclink('link-32', 'MTAB_FILE', 'link-32');">MTAB_FILE</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"/etc/mtab"</tt> </tt>
<a name="L129"></a><tt class="py-lineno"> 129</tt> <tt class="py-line"> </tt>
<a name="L130"></a><tt class="py-lineno"> 130</tt> <tt class="py-line"><tt id="link-33" class="py-name" targets="Variable CedarBackup3.util.MOUNT_COMMAND=CedarBackup3.util-module.html#MOUNT_COMMAND"><a title="CedarBackup3.util.MOUNT_COMMAND" class="py-name" href="#" onclick="return doclink('link-33', 'MOUNT_COMMAND', 'link-33');">MOUNT_COMMAND</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> <tt class="py-string">"mount"</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt> </tt>
<a name="L131"></a><tt class="py-lineno"> 131</tt> <tt class="py-line"><tt id="link-34" class="py-name" targets="Variable CedarBackup3.util.UMOUNT_COMMAND=CedarBackup3.util-module.html#UMOUNT_COMMAND"><a title="CedarBackup3.util.UMOUNT_COMMAND" class="py-name" href="#" onclick="return doclink('link-34', 'UMOUNT_COMMAND', 'link-34');">UMOUNT_COMMAND</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> <tt class="py-string">"umount"</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt> </tt>
<a name="L132"></a><tt class="py-lineno"> 132</tt> <tt class="py-line"> </tt>
<a name="L133"></a><tt class="py-lineno"> 133</tt> <tt class="py-line"><tt id="link-35" class="py-name" targets="Variable CedarBackup3.util.DEFAULT_LANGUAGE=CedarBackup3.util-module.html#DEFAULT_LANGUAGE"><a title="CedarBackup3.util.DEFAULT_LANGUAGE" class="py-name" href="#" onclick="return doclink('link-35', 'DEFAULT_LANGUAGE', 'link-35');">DEFAULT_LANGUAGE</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"C"</tt> </tt>
<a name="L134"></a><tt class="py-lineno"> 134</tt> <tt class="py-line"><tt id="link-36" class="py-name" targets="Variable CedarBackup3.util.LANG_VAR=CedarBackup3.util-module.html#LANG_VAR"><a title="CedarBackup3.util.LANG_VAR" class="py-name" href="#" onclick="return doclink('link-36', 'LANG_VAR', 'link-36');">LANG_VAR</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"LANG"</tt> </tt>
<a name="L135"></a><tt class="py-lineno"> 135</tt> <tt class="py-line"><tt id="link-37" class="py-name" targets="Variable CedarBackup3.util.LOCALE_VARS=CedarBackup3.util-module.html#LOCALE_VARS"><a title="CedarBackup3.util.LOCALE_VARS" class="py-name" href="#" onclick="return doclink('link-37', 'LOCALE_VARS', 'link-37');">LOCALE_VARS</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> <tt class="py-string">"LC_ADDRESS"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_ALL"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_COLLATE"</tt><tt class="py-op">,</tt> </tt>
<a name="L136"></a><tt class="py-lineno"> 136</tt> <tt class="py-line"> <tt class="py-string">"LC_CTYPE"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_IDENTIFICATION"</tt><tt class="py-op">,</tt> </tt>
<a name="L137"></a><tt class="py-lineno"> 137</tt> <tt class="py-line"> <tt class="py-string">"LC_MEASUREMENT"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_MESSAGES"</tt><tt class="py-op">,</tt> </tt>
<a name="L138"></a><tt class="py-lineno"> 138</tt> <tt class="py-line"> <tt class="py-string">"LC_MONETARY"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_NAME"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_NUMERIC"</tt><tt class="py-op">,</tt> </tt>
<a name="L139"></a><tt class="py-lineno"> 139</tt> <tt class="py-line"> <tt class="py-string">"LC_PAPER"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_TELEPHONE"</tt><tt class="py-op">,</tt> <tt class="py-string">"LC_TIME"</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt> </tt>
<a name="UnorderedList"></a><div id="UnorderedList-def"><a name="L140"></a><tt class="py-lineno"> 140</tt> <tt class="py-line"> </tt>
<a name="L141"></a><tt class="py-lineno"> 141</tt> <tt class="py-line"> </tt>
<a name="L142"></a><tt class="py-lineno"> 142</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L143"></a><tt class="py-lineno"> 143</tt> <tt class="py-line"><tt class="py-comment"># UnorderedList class definition</tt> </tt>
<a name="L144"></a><tt class="py-lineno"> 144</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L145"></a><tt class="py-lineno"> 145</tt> <tt class="py-line"> </tt>
<a name="L146"></a><tt class="py-lineno"> 146</tt> <a class="py-toggle" href="#" id="UnorderedList-toggle" onclick="return toggle('UnorderedList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html">UnorderedList</a><tt class="py-op">(</tt><tt class="py-base-class">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="UnorderedList-expanded"><a name="L147"></a><tt class="py-lineno"> 147</tt> <tt class="py-line"> </tt>
<a name="L148"></a><tt class="py-lineno"> 148</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L149"></a><tt class="py-lineno"> 149</tt> <tt class="py-line"><tt class="py-docstring"> Class representing an "unordered list".</tt> </tt>
<a name="L150"></a><tt class="py-lineno"> 150</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L151"></a><tt class="py-lineno"> 151</tt> <tt class="py-line"><tt class="py-docstring"> An "unordered list" is a list in which only the contents matter, not the</tt> </tt>
<a name="L152"></a><tt class="py-lineno"> 152</tt> <tt class="py-line"><tt class="py-docstring"> order in which the contents appear in the list.</tt> </tt>
<a name="L153"></a><tt class="py-lineno"> 153</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L154"></a><tt class="py-lineno"> 154</tt> <tt class="py-line"><tt class="py-docstring"> For instance, we might be keeping track of set of paths in a list, because</tt> </tt>
<a name="L155"></a><tt class="py-lineno"> 155</tt> <tt class="py-line"><tt class="py-docstring"> it's convenient to have them in that form. However, for comparison</tt> </tt>
<a name="L156"></a><tt class="py-lineno"> 156</tt> <tt class="py-line"><tt class="py-docstring"> purposes, we would only care that the lists contain exactly the same</tt> </tt>
<a name="L157"></a><tt class="py-lineno"> 157</tt> <tt class="py-line"><tt class="py-docstring"> contents, regardless of order.</tt> </tt>
<a name="L158"></a><tt class="py-lineno"> 158</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L159"></a><tt class="py-lineno"> 159</tt> <tt class="py-line"><tt class="py-docstring"> I have come up with two reasonable ways of doing this, plus a couple more</tt> </tt>
<a name="L160"></a><tt class="py-lineno"> 160</tt> <tt class="py-line"><tt class="py-docstring"> that would work but would be a pain to implement. My first method is to</tt> </tt>
<a name="L161"></a><tt class="py-lineno"> 161</tt> <tt class="py-line"><tt class="py-docstring"> copy and sort each list, comparing the sorted versions. This will only work</tt> </tt>
<a name="L162"></a><tt class="py-lineno"> 162</tt> <tt class="py-line"><tt class="py-docstring"> if two lists with exactly the same members are guaranteed to sort in exactly</tt> </tt>
<a name="L163"></a><tt class="py-lineno"> 163</tt> <tt class="py-line"><tt class="py-docstring"> the same order. The second way would be to create two Sets and then compare</tt> </tt>
<a name="L164"></a><tt class="py-lineno"> 164</tt> <tt class="py-line"><tt class="py-docstring"> the sets. However, this would lose information about any duplicates in</tt> </tt>
<a name="L165"></a><tt class="py-lineno"> 165</tt> <tt class="py-line"><tt class="py-docstring"> either list. I've decided to go with option #1 for now. I'll modify this</tt> </tt>
<a name="L166"></a><tt class="py-lineno"> 166</tt> <tt class="py-line"><tt class="py-docstring"> code if I run into problems in the future.</tt> </tt>
<a name="L167"></a><tt class="py-lineno"> 167</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L168"></a><tt class="py-lineno"> 168</tt> <tt class="py-line"><tt class="py-docstring"> We override the original C{__eq__}, C{__ne__}, C{__ge__}, C{__gt__},</tt> </tt>
<a name="L169"></a><tt class="py-lineno"> 169</tt> <tt class="py-line"><tt class="py-docstring"> C{__le__} and C{__lt__} list methods to change the definition of the various</tt> </tt>
<a name="L170"></a><tt class="py-lineno"> 170</tt> <tt class="py-line"><tt class="py-docstring"> comparison operators. In all cases, the comparison is changed to return the</tt> </tt>
<a name="L171"></a><tt class="py-lineno"> 171</tt> <tt class="py-line"><tt class="py-docstring"> result of the original operation I{but instead comparing sorted lists}.</tt> </tt>
<a name="L172"></a><tt class="py-lineno"> 172</tt> <tt class="py-line"><tt class="py-docstring"> This is going to be quite a bit slower than a normal list, so you probably</tt> </tt>
<a name="L173"></a><tt class="py-lineno"> 173</tt> <tt class="py-line"><tt class="py-docstring"> only want to use it on small lists.</tt> </tt>
<a name="L174"></a><tt class="py-lineno"> 174</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L175"></a><tt class="py-lineno"> 175</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__eq__"></a><div id="UnorderedList.__eq__-def"><a name="L176"></a><tt class="py-lineno"> 176</tt> <a class="py-toggle" href="#" id="UnorderedList.__eq__-toggle" onclick="return toggle('UnorderedList.__eq__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__eq__">__eq__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__eq__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__eq__-expanded"><a name="L177"></a><tt class="py-lineno"> 177</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L178"></a><tt class="py-lineno"> 178</tt> <tt class="py-line"><tt class="py-docstring"> Definition of C{==} operator for this class.</tt> </tt>
<a name="L179"></a><tt class="py-lineno"> 179</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L180"></a><tt class="py-lineno"> 180</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self == other}.</tt> </tt>
<a name="L181"></a><tt class="py-lineno"> 181</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L182"></a><tt class="py-lineno"> 182</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L183"></a><tt class="py-lineno"> 183</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
<a name="L184"></a><tt class="py-lineno"> 184</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-38" class="py-name" targets="Class CedarBackup3.util.UnorderedList=CedarBackup3.util.UnorderedList-class.html"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-38', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Static Method CedarBackup3.util.UnorderedList.mixedsort()=CedarBackup3.util.UnorderedList-class.html#mixedsort"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-39', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L185"></a><tt class="py-lineno"> 185</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-40" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-40', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-41', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L186"></a><tt class="py-lineno"> 186</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name" targets="Method CedarBackup3.cli.Options.__eq__()=CedarBackup3.cli.Options-class.html#__eq__,Method CedarBackup3.cli._ActionItem.__eq__()=CedarBackup3.cli._ActionItem-class.html#__eq__,Method CedarBackup3.cli._ManagedActionItem.__eq__()=CedarBackup3.cli._ManagedActionItem-class.html#__eq__,Method CedarBackup3.config.ActionDependencies.__eq__()=CedarBackup3.config.ActionDependencies-class.html#__eq__,Method CedarBackup3.config.ActionHook.__eq__()=CedarBackup3.config.ActionHook-class.html#__eq__,Method CedarBackup3.config.BlankBehavior.__eq__()=CedarBackup3.config.BlankBehavior-class.html#__eq__,Method CedarBackup3.config.ByteQuantity.__eq__()=CedarBackup3.config.ByteQuantity-class.html#__eq__,Method CedarBackup3.config.CollectConfig.__eq__()=CedarBackup3.config.CollectConfig-class.html#__eq__,Method CedarBackup3.config.CollectDir.__eq__()=CedarBackup3.config.CollectDir-class.html#__eq__,Method CedarBackup3.config.CollectFile.__eq__()=CedarBackup3.config.CollectFile-class.html#__eq__,Method CedarBackup3.config.CommandOverride.__eq__()=CedarBackup3.config.CommandOverride-class.html#__eq__,Method CedarBackup3.config.Config.__eq__()=CedarBackup3.config.Config-class.html#__eq__,Method CedarBackup3.config.ExtendedAction.__eq__()=CedarBackup3.config.ExtendedAction-class.html#__eq__,Method CedarBackup3.config.ExtensionsConfig.__eq__()=CedarBackup3.config.ExtensionsConfig-class.html#__eq__,Method CedarBackup3.config.LocalPeer.__eq__()=CedarBackup3.config.LocalPeer-class.html#__eq__,Method CedarBackup3.config.OptionsConfig.__eq__()=CedarBackup3.config.OptionsConfig-class.html#__eq__,Method CedarBackup3.config.PeersConfig.__eq__()=CedarBackup3.config.PeersConfig-class.html#__eq__,Method CedarBackup3.config.PurgeConfig.__eq__()=CedarBackup3.config.PurgeConfig-class.html#__eq__,Method CedarBackup3.config.PurgeDir.__eq__()=CedarBackup3.config.PurgeDir-class.html#__eq__,Method CedarBackup3.config.ReferenceConfig.__eq__()=CedarBackup3.config.ReferenceConfig-class.html#__eq__,Method CedarBackup3.config.RemotePeer.__eq__()=CedarBackup3.config.RemotePeer-class.html#__eq__,Method CedarBackup3.config.StageConfig.__eq__()=CedarBackup3.config.StageConfig-class.html#__eq__,Method CedarBackup3.config.StoreConfig.__eq__()=CedarBackup3.config.StoreConfig-class.html#__eq__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__eq__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__eq__,Method CedarBackup3.extend.amazons3.LocalConfig.__eq__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.capacity.CapacityConfig.__eq__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__eq__,Method CedarBackup3.extend.capacity.LocalConfig.__eq__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.capacity.PercentageQuantity.__eq__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__eq__,Method CedarBackup3.extend.encrypt.EncryptConfig.__eq__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__eq__,Method CedarBackup3.extend.encrypt.LocalConfig.__eq__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.mbox.LocalConfig.__eq__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.mbox.MboxConfig.__eq__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__eq__,Method CedarBackup3.extend.mbox.MboxDir.__eq__()=CedarBackup3.extend.mbox.MboxDir-class.html#__eq__,Method CedarBackup3.extend.mbox.MboxFile.__eq__()=CedarBackup3.extend.mbox.MboxFile-class.html#__eq__,Method CedarBackup3.extend.mysql.LocalConfig.__eq__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.mysql.MysqlConfig.__eq__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__eq__,Method CedarBackup3.extend.postgresql.LocalConfig.__eq__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__eq__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__eq__,Method CedarBackup3.extend.split.LocalConfig.__eq__()=CedarBackup3.extend.split.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.split.SplitConfig.__eq__()=CedarBackup3.extend.split.SplitConfig-class.html#__eq__,Method CedarBackup3.extend.subversion.LocalConfig.__eq__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__eq__,Method CedarBackup3.extend.subversion.Repository.__eq__()=CedarBackup3.extend.subversion.Repository-class.html#__eq__,Method CedarBackup3.extend.subversion.RepositoryDir.__eq__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__eq__,Method CedarBackup3.extend.subversion.SubversionConfig.__eq__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__eq__,Method CedarBackup3.tools.amazons3.Options.__eq__()=CedarBackup3.tools.amazons3.Options-class.html#__eq__,Method CedarBackup3.util.DirectedGraph.__eq__()=CedarBackup3.util.DirectedGraph-class.html#__eq__,Method CedarBackup3.util.UnorderedList.__eq__()=CedarBackup3.util.UnorderedList-class.html#__eq__"><a title="CedarBackup3.cli.Options.__eq__
CedarBackup3.cli._ActionItem.__eq__
CedarBackup3.cli._ManagedActionItem.__eq__
CedarBackup3.config.ActionDependencies.__eq__
CedarBackup3.config.ActionHook.__eq__
CedarBackup3.config.BlankBehavior.__eq__
CedarBackup3.config.ByteQuantity.__eq__
CedarBackup3.config.CollectConfig.__eq__
CedarBackup3.config.CollectDir.__eq__
CedarBackup3.config.CollectFile.__eq__
CedarBackup3.config.CommandOverride.__eq__
CedarBackup3.config.Config.__eq__
CedarBackup3.config.ExtendedAction.__eq__
CedarBackup3.config.ExtensionsConfig.__eq__
CedarBackup3.config.LocalPeer.__eq__
CedarBackup3.config.OptionsConfig.__eq__
CedarBackup3.config.PeersConfig.__eq__
CedarBackup3.config.PurgeConfig.__eq__
CedarBackup3.config.PurgeDir.__eq__
CedarBackup3.config.ReferenceConfig.__eq__
CedarBackup3.config.RemotePeer.__eq__
CedarBackup3.config.StageConfig.__eq__
CedarBackup3.config.StoreConfig.__eq__
CedarBackup3.extend.amazons3.AmazonS3Config.__eq__
CedarBackup3.extend.amazons3.LocalConfig.__eq__
CedarBackup3.extend.capacity.CapacityConfig.__eq__
CedarBackup3.extend.capacity.LocalConfig.__eq__
CedarBackup3.extend.capacity.PercentageQuantity.__eq__
CedarBackup3.extend.encrypt.EncryptConfig.__eq__
CedarBackup3.extend.encrypt.LocalConfig.__eq__
CedarBackup3.extend.mbox.LocalConfig.__eq__
CedarBackup3.extend.mbox.MboxConfig.__eq__
CedarBackup3.extend.mbox.MboxDir.__eq__
CedarBackup3.extend.mbox.MboxFile.__eq__
CedarBackup3.extend.mysql.LocalConfig.__eq__
CedarBackup3.extend.mysql.MysqlConfig.__eq__
CedarBackup3.extend.postgresql.LocalConfig.__eq__
CedarBackup3.extend.postgresql.PostgresqlConfig.__eq__
CedarBackup3.extend.split.LocalConfig.__eq__
CedarBackup3.extend.split.SplitConfig.__eq__
CedarBackup3.extend.subversion.LocalConfig.__eq__
CedarBackup3.extend.subversion.Repository.__eq__
CedarBackup3.extend.subversion.RepositoryDir.__eq__
CedarBackup3.extend.subversion.SubversionConfig.__eq__
CedarBackup3.tools.amazons3.Options.__eq__
CedarBackup3.util.DirectedGraph.__eq__
CedarBackup3.util.UnorderedList.__eq__" class="py-name" href="#" onclick="return doclink('link-42', '__eq__', 'link-42');">__eq__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L187"></a><tt class="py-lineno"> 187</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__ne__"></a><div id="UnorderedList.__ne__-def"><a name="L188"></a><tt class="py-lineno"> 188</tt> <a class="py-toggle" href="#" id="UnorderedList.__ne__-toggle" onclick="return toggle('UnorderedList.__ne__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__ne__">__ne__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__ne__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__ne__-expanded"><a name="L189"></a><tt class="py-lineno"> 189</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L190"></a><tt class="py-lineno"> 190</tt> <tt class="py-line"><tt class="py-docstring"> Definition of C{!=} operator for this class.</tt> </tt>
<a name="L191"></a><tt class="py-lineno"> 191</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L192"></a><tt class="py-lineno"> 192</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self != other}.</tt> </tt>
<a name="L193"></a><tt class="py-lineno"> 193</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L194"></a><tt class="py-lineno"> 194</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L195"></a><tt class="py-lineno"> 195</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L196"></a><tt class="py-lineno"> 196</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-43" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-43', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-44', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno"> 197</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-45" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-45', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-46', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno"> 198</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name" targets="Method CedarBackup3.util.UnorderedList.__ne__()=CedarBackup3.util.UnorderedList-class.html#__ne__"><a title="CedarBackup3.util.UnorderedList.__ne__" class="py-name" href="#" onclick="return doclink('link-47', '__ne__', 'link-47');">__ne__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L199"></a><tt class="py-lineno"> 199</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__ge__"></a><div id="UnorderedList.__ge__-def"><a name="L200"></a><tt class="py-lineno"> 200</tt> <a class="py-toggle" href="#" id="UnorderedList.__ge__-toggle" onclick="return toggle('UnorderedList.__ge__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__ge__">__ge__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__ge__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__ge__-expanded"><a name="L201"></a><tt class="py-lineno"> 201</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L202"></a><tt class="py-lineno"> 202</tt> <tt class="py-line"><tt class="py-docstring"> Definition of S{>=} operator for this class.</tt> </tt>
<a name="L203"></a><tt class="py-lineno"> 203</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L204"></a><tt class="py-lineno"> 204</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self >= other}.</tt> </tt>
<a name="L205"></a><tt class="py-lineno"> 205</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L206"></a><tt class="py-lineno"> 206</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L207"></a><tt class="py-lineno"> 207</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L208"></a><tt class="py-lineno"> 208</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-48" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-48', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-49', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L209"></a><tt class="py-lineno"> 209</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-50" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-50', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-51', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L210"></a><tt class="py-lineno"> 210</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Method CedarBackup3.cli.Options.__ge__()=CedarBackup3.cli.Options-class.html#__ge__,Method CedarBackup3.cli._ActionItem.__ge__()=CedarBackup3.cli._ActionItem-class.html#__ge__,Method CedarBackup3.cli._ManagedActionItem.__ge__()=CedarBackup3.cli._ManagedActionItem-class.html#__ge__,Method CedarBackup3.config.ActionDependencies.__ge__()=CedarBackup3.config.ActionDependencies-class.html#__ge__,Method CedarBackup3.config.ActionHook.__ge__()=CedarBackup3.config.ActionHook-class.html#__ge__,Method CedarBackup3.config.BlankBehavior.__ge__()=CedarBackup3.config.BlankBehavior-class.html#__ge__,Method CedarBackup3.config.ByteQuantity.__ge__()=CedarBackup3.config.ByteQuantity-class.html#__ge__,Method CedarBackup3.config.CollectConfig.__ge__()=CedarBackup3.config.CollectConfig-class.html#__ge__,Method CedarBackup3.config.CollectDir.__ge__()=CedarBackup3.config.CollectDir-class.html#__ge__,Method CedarBackup3.config.CollectFile.__ge__()=CedarBackup3.config.CollectFile-class.html#__ge__,Method CedarBackup3.config.CommandOverride.__ge__()=CedarBackup3.config.CommandOverride-class.html#__ge__,Method CedarBackup3.config.Config.__ge__()=CedarBackup3.config.Config-class.html#__ge__,Method CedarBackup3.config.ExtendedAction.__ge__()=CedarBackup3.config.ExtendedAction-class.html#__ge__,Method CedarBackup3.config.ExtensionsConfig.__ge__()=CedarBackup3.config.ExtensionsConfig-class.html#__ge__,Method CedarBackup3.config.LocalPeer.__ge__()=CedarBackup3.config.LocalPeer-class.html#__ge__,Method CedarBackup3.config.OptionsConfig.__ge__()=CedarBackup3.config.OptionsConfig-class.html#__ge__,Method CedarBackup3.config.PeersConfig.__ge__()=CedarBackup3.config.PeersConfig-class.html#__ge__,Method CedarBackup3.config.PurgeConfig.__ge__()=CedarBackup3.config.PurgeConfig-class.html#__ge__,Method CedarBackup3.config.PurgeDir.__ge__()=CedarBackup3.config.PurgeDir-class.html#__ge__,Method CedarBackup3.config.ReferenceConfig.__ge__()=CedarBackup3.config.ReferenceConfig-class.html#__ge__,Method CedarBackup3.config.RemotePeer.__ge__()=CedarBackup3.config.RemotePeer-class.html#__ge__,Method CedarBackup3.config.StageConfig.__ge__()=CedarBackup3.config.StageConfig-class.html#__ge__,Method CedarBackup3.config.StoreConfig.__ge__()=CedarBackup3.config.StoreConfig-class.html#__ge__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__ge__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__ge__,Method CedarBackup3.extend.amazons3.LocalConfig.__ge__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.capacity.CapacityConfig.__ge__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__ge__,Method CedarBackup3.extend.capacity.LocalConfig.__ge__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.capacity.PercentageQuantity.__ge__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__ge__,Method CedarBackup3.extend.encrypt.EncryptConfig.__ge__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__ge__,Method CedarBackup3.extend.encrypt.LocalConfig.__ge__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.mbox.LocalConfig.__ge__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.mbox.MboxConfig.__ge__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__ge__,Method CedarBackup3.extend.mbox.MboxDir.__ge__()=CedarBackup3.extend.mbox.MboxDir-class.html#__ge__,Method CedarBackup3.extend.mbox.MboxFile.__ge__()=CedarBackup3.extend.mbox.MboxFile-class.html#__ge__,Method CedarBackup3.extend.mysql.LocalConfig.__ge__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.mysql.MysqlConfig.__ge__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__ge__,Method CedarBackup3.extend.postgresql.LocalConfig.__ge__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__ge__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__ge__,Method CedarBackup3.extend.split.LocalConfig.__ge__()=CedarBackup3.extend.split.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.split.SplitConfig.__ge__()=CedarBackup3.extend.split.SplitConfig-class.html#__ge__,Method CedarBackup3.extend.subversion.LocalConfig.__ge__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__ge__,Method CedarBackup3.extend.subversion.Repository.__ge__()=CedarBackup3.extend.subversion.Repository-class.html#__ge__,Method CedarBackup3.extend.subversion.RepositoryDir.__ge__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__ge__,Method CedarBackup3.extend.subversion.SubversionConfig.__ge__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__ge__,Method CedarBackup3.util.DirectedGraph.__ge__()=CedarBackup3.util.DirectedGraph-class.html#__ge__,Method CedarBackup3.util.UnorderedList.__ge__()=CedarBackup3.util.UnorderedList-class.html#__ge__"><a title="CedarBackup3.cli.Options.__ge__
CedarBackup3.cli._ActionItem.__ge__
CedarBackup3.cli._ManagedActionItem.__ge__
CedarBackup3.config.ActionDependencies.__ge__
CedarBackup3.config.ActionHook.__ge__
CedarBackup3.config.BlankBehavior.__ge__
CedarBackup3.config.ByteQuantity.__ge__
CedarBackup3.config.CollectConfig.__ge__
CedarBackup3.config.CollectDir.__ge__
CedarBackup3.config.CollectFile.__ge__
CedarBackup3.config.CommandOverride.__ge__
CedarBackup3.config.Config.__ge__
CedarBackup3.config.ExtendedAction.__ge__
CedarBackup3.config.ExtensionsConfig.__ge__
CedarBackup3.config.LocalPeer.__ge__
CedarBackup3.config.OptionsConfig.__ge__
CedarBackup3.config.PeersConfig.__ge__
CedarBackup3.config.PurgeConfig.__ge__
CedarBackup3.config.PurgeDir.__ge__
CedarBackup3.config.ReferenceConfig.__ge__
CedarBackup3.config.RemotePeer.__ge__
CedarBackup3.config.StageConfig.__ge__
CedarBackup3.config.StoreConfig.__ge__
CedarBackup3.extend.amazons3.AmazonS3Config.__ge__
CedarBackup3.extend.amazons3.LocalConfig.__ge__
CedarBackup3.extend.capacity.CapacityConfig.__ge__
CedarBackup3.extend.capacity.LocalConfig.__ge__
CedarBackup3.extend.capacity.PercentageQuantity.__ge__
CedarBackup3.extend.encrypt.EncryptConfig.__ge__
CedarBackup3.extend.encrypt.LocalConfig.__ge__
CedarBackup3.extend.mbox.LocalConfig.__ge__
CedarBackup3.extend.mbox.MboxConfig.__ge__
CedarBackup3.extend.mbox.MboxDir.__ge__
CedarBackup3.extend.mbox.MboxFile.__ge__
CedarBackup3.extend.mysql.LocalConfig.__ge__
CedarBackup3.extend.mysql.MysqlConfig.__ge__
CedarBackup3.extend.postgresql.LocalConfig.__ge__
CedarBackup3.extend.postgresql.PostgresqlConfig.__ge__
CedarBackup3.extend.split.LocalConfig.__ge__
CedarBackup3.extend.split.SplitConfig.__ge__
CedarBackup3.extend.subversion.LocalConfig.__ge__
CedarBackup3.extend.subversion.Repository.__ge__
CedarBackup3.extend.subversion.RepositoryDir.__ge__
CedarBackup3.extend.subversion.SubversionConfig.__ge__
CedarBackup3.util.DirectedGraph.__ge__
CedarBackup3.util.UnorderedList.__ge__" class="py-name" href="#" onclick="return doclink('link-52', '__ge__', 'link-52');">__ge__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L211"></a><tt class="py-lineno"> 211</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__gt__"></a><div id="UnorderedList.__gt__-def"><a name="L212"></a><tt class="py-lineno"> 212</tt> <a class="py-toggle" href="#" id="UnorderedList.__gt__-toggle" onclick="return toggle('UnorderedList.__gt__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__gt__">__gt__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__gt__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__gt__-expanded"><a name="L213"></a><tt class="py-lineno"> 213</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L214"></a><tt class="py-lineno"> 214</tt> <tt class="py-line"><tt class="py-docstring"> Definition of C{>} operator for this class.</tt> </tt>
<a name="L215"></a><tt class="py-lineno"> 215</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L216"></a><tt class="py-lineno"> 216</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self > other}.</tt> </tt>
<a name="L217"></a><tt class="py-lineno"> 217</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L218"></a><tt class="py-lineno"> 218</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L219"></a><tt class="py-lineno"> 219</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L220"></a><tt class="py-lineno"> 220</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-53" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-53', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-54', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L221"></a><tt class="py-lineno"> 221</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-55" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-55', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-56', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L222"></a><tt class="py-lineno"> 222</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name" targets="Method CedarBackup3.cli.Options.__gt__()=CedarBackup3.cli.Options-class.html#__gt__,Method CedarBackup3.cli._ActionItem.__gt__()=CedarBackup3.cli._ActionItem-class.html#__gt__,Method CedarBackup3.cli._ManagedActionItem.__gt__()=CedarBackup3.cli._ManagedActionItem-class.html#__gt__,Method CedarBackup3.config.ActionDependencies.__gt__()=CedarBackup3.config.ActionDependencies-class.html#__gt__,Method CedarBackup3.config.ActionHook.__gt__()=CedarBackup3.config.ActionHook-class.html#__gt__,Method CedarBackup3.config.BlankBehavior.__gt__()=CedarBackup3.config.BlankBehavior-class.html#__gt__,Method CedarBackup3.config.ByteQuantity.__gt__()=CedarBackup3.config.ByteQuantity-class.html#__gt__,Method CedarBackup3.config.CollectConfig.__gt__()=CedarBackup3.config.CollectConfig-class.html#__gt__,Method CedarBackup3.config.CollectDir.__gt__()=CedarBackup3.config.CollectDir-class.html#__gt__,Method CedarBackup3.config.CollectFile.__gt__()=CedarBackup3.config.CollectFile-class.html#__gt__,Method CedarBackup3.config.CommandOverride.__gt__()=CedarBackup3.config.CommandOverride-class.html#__gt__,Method CedarBackup3.config.Config.__gt__()=CedarBackup3.config.Config-class.html#__gt__,Method CedarBackup3.config.ExtendedAction.__gt__()=CedarBackup3.config.ExtendedAction-class.html#__gt__,Method CedarBackup3.config.ExtensionsConfig.__gt__()=CedarBackup3.config.ExtensionsConfig-class.html#__gt__,Method CedarBackup3.config.LocalPeer.__gt__()=CedarBackup3.config.LocalPeer-class.html#__gt__,Method CedarBackup3.config.OptionsConfig.__gt__()=CedarBackup3.config.OptionsConfig-class.html#__gt__,Method CedarBackup3.config.PeersConfig.__gt__()=CedarBackup3.config.PeersConfig-class.html#__gt__,Method CedarBackup3.config.PurgeConfig.__gt__()=CedarBackup3.config.PurgeConfig-class.html#__gt__,Method CedarBackup3.config.PurgeDir.__gt__()=CedarBackup3.config.PurgeDir-class.html#__gt__,Method CedarBackup3.config.ReferenceConfig.__gt__()=CedarBackup3.config.ReferenceConfig-class.html#__gt__,Method CedarBackup3.config.RemotePeer.__gt__()=CedarBackup3.config.RemotePeer-class.html#__gt__,Method CedarBackup3.config.StageConfig.__gt__()=CedarBackup3.config.StageConfig-class.html#__gt__,Method CedarBackup3.config.StoreConfig.__gt__()=CedarBackup3.config.StoreConfig-class.html#__gt__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__gt__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__gt__,Method CedarBackup3.extend.amazons3.LocalConfig.__gt__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.capacity.CapacityConfig.__gt__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__gt__,Method CedarBackup3.extend.capacity.LocalConfig.__gt__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.capacity.PercentageQuantity.__gt__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__gt__,Method CedarBackup3.extend.encrypt.EncryptConfig.__gt__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__gt__,Method CedarBackup3.extend.encrypt.LocalConfig.__gt__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.mbox.LocalConfig.__gt__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.mbox.MboxConfig.__gt__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__gt__,Method CedarBackup3.extend.mbox.MboxDir.__gt__()=CedarBackup3.extend.mbox.MboxDir-class.html#__gt__,Method CedarBackup3.extend.mbox.MboxFile.__gt__()=CedarBackup3.extend.mbox.MboxFile-class.html#__gt__,Method CedarBackup3.extend.mysql.LocalConfig.__gt__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.mysql.MysqlConfig.__gt__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__gt__,Method CedarBackup3.extend.postgresql.LocalConfig.__gt__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__gt__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__gt__,Method CedarBackup3.extend.split.LocalConfig.__gt__()=CedarBackup3.extend.split.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.split.SplitConfig.__gt__()=CedarBackup3.extend.split.SplitConfig-class.html#__gt__,Method CedarBackup3.extend.subversion.LocalConfig.__gt__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__gt__,Method CedarBackup3.extend.subversion.Repository.__gt__()=CedarBackup3.extend.subversion.Repository-class.html#__gt__,Method CedarBackup3.extend.subversion.RepositoryDir.__gt__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__gt__,Method CedarBackup3.extend.subversion.SubversionConfig.__gt__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__gt__,Method CedarBackup3.tools.amazons3.Options.__gt__()=CedarBackup3.tools.amazons3.Options-class.html#__gt__,Method CedarBackup3.util.DirectedGraph.__gt__()=CedarBackup3.util.DirectedGraph-class.html#__gt__,Method CedarBackup3.util.UnorderedList.__gt__()=CedarBackup3.util.UnorderedList-class.html#__gt__"><a title="CedarBackup3.cli.Options.__gt__
CedarBackup3.cli._ActionItem.__gt__
CedarBackup3.cli._ManagedActionItem.__gt__
CedarBackup3.config.ActionDependencies.__gt__
CedarBackup3.config.ActionHook.__gt__
CedarBackup3.config.BlankBehavior.__gt__
CedarBackup3.config.ByteQuantity.__gt__
CedarBackup3.config.CollectConfig.__gt__
CedarBackup3.config.CollectDir.__gt__
CedarBackup3.config.CollectFile.__gt__
CedarBackup3.config.CommandOverride.__gt__
CedarBackup3.config.Config.__gt__
CedarBackup3.config.ExtendedAction.__gt__
CedarBackup3.config.ExtensionsConfig.__gt__
CedarBackup3.config.LocalPeer.__gt__
CedarBackup3.config.OptionsConfig.__gt__
CedarBackup3.config.PeersConfig.__gt__
CedarBackup3.config.PurgeConfig.__gt__
CedarBackup3.config.PurgeDir.__gt__
CedarBackup3.config.ReferenceConfig.__gt__
CedarBackup3.config.RemotePeer.__gt__
CedarBackup3.config.StageConfig.__gt__
CedarBackup3.config.StoreConfig.__gt__
CedarBackup3.extend.amazons3.AmazonS3Config.__gt__
CedarBackup3.extend.amazons3.LocalConfig.__gt__
CedarBackup3.extend.capacity.CapacityConfig.__gt__
CedarBackup3.extend.capacity.LocalConfig.__gt__
CedarBackup3.extend.capacity.PercentageQuantity.__gt__
CedarBackup3.extend.encrypt.EncryptConfig.__gt__
CedarBackup3.extend.encrypt.LocalConfig.__gt__
CedarBackup3.extend.mbox.LocalConfig.__gt__
CedarBackup3.extend.mbox.MboxConfig.__gt__
CedarBackup3.extend.mbox.MboxDir.__gt__
CedarBackup3.extend.mbox.MboxFile.__gt__
CedarBackup3.extend.mysql.LocalConfig.__gt__
CedarBackup3.extend.mysql.MysqlConfig.__gt__
CedarBackup3.extend.postgresql.LocalConfig.__gt__
CedarBackup3.extend.postgresql.PostgresqlConfig.__gt__
CedarBackup3.extend.split.LocalConfig.__gt__
CedarBackup3.extend.split.SplitConfig.__gt__
CedarBackup3.extend.subversion.LocalConfig.__gt__
CedarBackup3.extend.subversion.Repository.__gt__
CedarBackup3.extend.subversion.RepositoryDir.__gt__
CedarBackup3.extend.subversion.SubversionConfig.__gt__
CedarBackup3.tools.amazons3.Options.__gt__
CedarBackup3.util.DirectedGraph.__gt__
CedarBackup3.util.UnorderedList.__gt__" class="py-name" href="#" onclick="return doclink('link-57', '__gt__', 'link-57');">__gt__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L223"></a><tt class="py-lineno"> 223</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__le__"></a><div id="UnorderedList.__le__-def"><a name="L224"></a><tt class="py-lineno"> 224</tt> <a class="py-toggle" href="#" id="UnorderedList.__le__-toggle" onclick="return toggle('UnorderedList.__le__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__le__">__le__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__le__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__le__-expanded"><a name="L225"></a><tt class="py-lineno"> 225</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L226"></a><tt class="py-lineno"> 226</tt> <tt class="py-line"><tt class="py-docstring"> Definition of S{<=} operator for this class.</tt> </tt>
<a name="L227"></a><tt class="py-lineno"> 227</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L228"></a><tt class="py-lineno"> 228</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self <= other}.</tt> </tt>
<a name="L229"></a><tt class="py-lineno"> 229</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L230"></a><tt class="py-lineno"> 230</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L231"></a><tt class="py-lineno"> 231</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
<a name="L232"></a><tt class="py-lineno"> 232</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-58" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-58', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-59', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L233"></a><tt class="py-lineno"> 233</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-60" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-60', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-61', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L234"></a><tt class="py-lineno"> 234</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name" targets="Method CedarBackup3.cli.Options.__le__()=CedarBackup3.cli.Options-class.html#__le__,Method CedarBackup3.cli._ActionItem.__le__()=CedarBackup3.cli._ActionItem-class.html#__le__,Method CedarBackup3.cli._ManagedActionItem.__le__()=CedarBackup3.cli._ManagedActionItem-class.html#__le__,Method CedarBackup3.config.ActionDependencies.__le__()=CedarBackup3.config.ActionDependencies-class.html#__le__,Method CedarBackup3.config.ActionHook.__le__()=CedarBackup3.config.ActionHook-class.html#__le__,Method CedarBackup3.config.BlankBehavior.__le__()=CedarBackup3.config.BlankBehavior-class.html#__le__,Method CedarBackup3.config.ByteQuantity.__le__()=CedarBackup3.config.ByteQuantity-class.html#__le__,Method CedarBackup3.config.CollectConfig.__le__()=CedarBackup3.config.CollectConfig-class.html#__le__,Method CedarBackup3.config.CollectDir.__le__()=CedarBackup3.config.CollectDir-class.html#__le__,Method CedarBackup3.config.CollectFile.__le__()=CedarBackup3.config.CollectFile-class.html#__le__,Method CedarBackup3.config.CommandOverride.__le__()=CedarBackup3.config.CommandOverride-class.html#__le__,Method CedarBackup3.config.Config.__le__()=CedarBackup3.config.Config-class.html#__le__,Method CedarBackup3.config.ExtendedAction.__le__()=CedarBackup3.config.ExtendedAction-class.html#__le__,Method CedarBackup3.config.ExtensionsConfig.__le__()=CedarBackup3.config.ExtensionsConfig-class.html#__le__,Method CedarBackup3.config.LocalPeer.__le__()=CedarBackup3.config.LocalPeer-class.html#__le__,Method CedarBackup3.config.OptionsConfig.__le__()=CedarBackup3.config.OptionsConfig-class.html#__le__,Method CedarBackup3.config.PeersConfig.__le__()=CedarBackup3.config.PeersConfig-class.html#__le__,Method CedarBackup3.config.PurgeConfig.__le__()=CedarBackup3.config.PurgeConfig-class.html#__le__,Method CedarBackup3.config.PurgeDir.__le__()=CedarBackup3.config.PurgeDir-class.html#__le__,Method CedarBackup3.config.ReferenceConfig.__le__()=CedarBackup3.config.ReferenceConfig-class.html#__le__,Method CedarBackup3.config.RemotePeer.__le__()=CedarBackup3.config.RemotePeer-class.html#__le__,Method CedarBackup3.config.StageConfig.__le__()=CedarBackup3.config.StageConfig-class.html#__le__,Method CedarBackup3.config.StoreConfig.__le__()=CedarBackup3.config.StoreConfig-class.html#__le__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__le__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__le__,Method CedarBackup3.extend.amazons3.LocalConfig.__le__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__le__,Method CedarBackup3.extend.capacity.CapacityConfig.__le__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__le__,Method CedarBackup3.extend.capacity.LocalConfig.__le__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__le__,Method CedarBackup3.extend.capacity.PercentageQuantity.__le__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__le__,Method CedarBackup3.extend.encrypt.EncryptConfig.__le__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__le__,Method CedarBackup3.extend.encrypt.LocalConfig.__le__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__le__,Method CedarBackup3.extend.mbox.LocalConfig.__le__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__le__,Method CedarBackup3.extend.mbox.MboxConfig.__le__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__le__,Method CedarBackup3.extend.mbox.MboxDir.__le__()=CedarBackup3.extend.mbox.MboxDir-class.html#__le__,Method CedarBackup3.extend.mbox.MboxFile.__le__()=CedarBackup3.extend.mbox.MboxFile-class.html#__le__,Method CedarBackup3.extend.mysql.LocalConfig.__le__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__le__,Method CedarBackup3.extend.mysql.MysqlConfig.__le__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__le__,Method CedarBackup3.extend.postgresql.LocalConfig.__le__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__le__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__le__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__le__,Method CedarBackup3.extend.split.LocalConfig.__le__()=CedarBackup3.extend.split.LocalConfig-class.html#__le__,Method CedarBackup3.extend.split.SplitConfig.__le__()=CedarBackup3.extend.split.SplitConfig-class.html#__le__,Method CedarBackup3.extend.subversion.LocalConfig.__le__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__le__,Method CedarBackup3.extend.subversion.Repository.__le__()=CedarBackup3.extend.subversion.Repository-class.html#__le__,Method CedarBackup3.extend.subversion.RepositoryDir.__le__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__le__,Method CedarBackup3.extend.subversion.SubversionConfig.__le__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__le__,Method CedarBackup3.util.DirectedGraph.__le__()=CedarBackup3.util.DirectedGraph-class.html#__le__,Method CedarBackup3.util.UnorderedList.__le__()=CedarBackup3.util.UnorderedList-class.html#__le__"><a title="CedarBackup3.cli.Options.__le__
CedarBackup3.cli._ActionItem.__le__
CedarBackup3.cli._ManagedActionItem.__le__
CedarBackup3.config.ActionDependencies.__le__
CedarBackup3.config.ActionHook.__le__
CedarBackup3.config.BlankBehavior.__le__
CedarBackup3.config.ByteQuantity.__le__
CedarBackup3.config.CollectConfig.__le__
CedarBackup3.config.CollectDir.__le__
CedarBackup3.config.CollectFile.__le__
CedarBackup3.config.CommandOverride.__le__
CedarBackup3.config.Config.__le__
CedarBackup3.config.ExtendedAction.__le__
CedarBackup3.config.ExtensionsConfig.__le__
CedarBackup3.config.LocalPeer.__le__
CedarBackup3.config.OptionsConfig.__le__
CedarBackup3.config.PeersConfig.__le__
CedarBackup3.config.PurgeConfig.__le__
CedarBackup3.config.PurgeDir.__le__
CedarBackup3.config.ReferenceConfig.__le__
CedarBackup3.config.RemotePeer.__le__
CedarBackup3.config.StageConfig.__le__
CedarBackup3.config.StoreConfig.__le__
CedarBackup3.extend.amazons3.AmazonS3Config.__le__
CedarBackup3.extend.amazons3.LocalConfig.__le__
CedarBackup3.extend.capacity.CapacityConfig.__le__
CedarBackup3.extend.capacity.LocalConfig.__le__
CedarBackup3.extend.capacity.PercentageQuantity.__le__
CedarBackup3.extend.encrypt.EncryptConfig.__le__
CedarBackup3.extend.encrypt.LocalConfig.__le__
CedarBackup3.extend.mbox.LocalConfig.__le__
CedarBackup3.extend.mbox.MboxConfig.__le__
CedarBackup3.extend.mbox.MboxDir.__le__
CedarBackup3.extend.mbox.MboxFile.__le__
CedarBackup3.extend.mysql.LocalConfig.__le__
CedarBackup3.extend.mysql.MysqlConfig.__le__
CedarBackup3.extend.postgresql.LocalConfig.__le__
CedarBackup3.extend.postgresql.PostgresqlConfig.__le__
CedarBackup3.extend.split.LocalConfig.__le__
CedarBackup3.extend.split.SplitConfig.__le__
CedarBackup3.extend.subversion.LocalConfig.__le__
CedarBackup3.extend.subversion.Repository.__le__
CedarBackup3.extend.subversion.RepositoryDir.__le__
CedarBackup3.extend.subversion.SubversionConfig.__le__
CedarBackup3.util.DirectedGraph.__le__
CedarBackup3.util.UnorderedList.__le__" class="py-name" href="#" onclick="return doclink('link-62', '__le__', 'link-62');">__le__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L235"></a><tt class="py-lineno"> 235</tt> <tt class="py-line"> </tt>
<a name="UnorderedList.__lt__"></a><div id="UnorderedList.__lt__-def"><a name="L236"></a><tt class="py-lineno"> 236</tt> <a class="py-toggle" href="#" id="UnorderedList.__lt__-toggle" onclick="return toggle('UnorderedList.__lt__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#__lt__">__lt__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.__lt__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.__lt__-expanded"><a name="L237"></a><tt class="py-lineno"> 237</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L238"></a><tt class="py-lineno"> 238</tt> <tt class="py-line"><tt class="py-docstring"> Definition of C{<} operator for this class.</tt> </tt>
<a name="L239"></a><tt class="py-lineno"> 239</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L240"></a><tt class="py-lineno"> 240</tt> <tt class="py-line"><tt class="py-docstring"> @return: True/false depending on whether C{self < other}.</tt> </tt>
<a name="L241"></a><tt class="py-lineno"> 241</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L242"></a><tt class="py-lineno"> 242</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L243"></a><tt class="py-lineno"> 243</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
<a name="L244"></a><tt class="py-lineno"> 244</tt> <tt class="py-line"> <tt class="py-name">selfSorted</tt> <tt class="py-op">=</tt> <tt id="link-63" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-63', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-64', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L245"></a><tt class="py-lineno"> 245</tt> <tt class="py-line"> <tt class="py-name">otherSorted</tt> <tt class="py-op">=</tt> <tt id="link-65" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-65', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-66" class="py-name"><a title="CedarBackup3.util.UnorderedList.mixedsort" class="py-name" href="#" onclick="return doclink('link-66', 'mixedsort', 'link-39');">mixedsort</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L246"></a><tt class="py-lineno"> 246</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">selfSorted</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name" targets="Method CedarBackup3.cli.Options.__lt__()=CedarBackup3.cli.Options-class.html#__lt__,Method CedarBackup3.cli._ActionItem.__lt__()=CedarBackup3.cli._ActionItem-class.html#__lt__,Method CedarBackup3.cli._ManagedActionItem.__lt__()=CedarBackup3.cli._ManagedActionItem-class.html#__lt__,Method CedarBackup3.config.ActionDependencies.__lt__()=CedarBackup3.config.ActionDependencies-class.html#__lt__,Method CedarBackup3.config.ActionHook.__lt__()=CedarBackup3.config.ActionHook-class.html#__lt__,Method CedarBackup3.config.BlankBehavior.__lt__()=CedarBackup3.config.BlankBehavior-class.html#__lt__,Method CedarBackup3.config.ByteQuantity.__lt__()=CedarBackup3.config.ByteQuantity-class.html#__lt__,Method CedarBackup3.config.CollectConfig.__lt__()=CedarBackup3.config.CollectConfig-class.html#__lt__,Method CedarBackup3.config.CollectDir.__lt__()=CedarBackup3.config.CollectDir-class.html#__lt__,Method CedarBackup3.config.CollectFile.__lt__()=CedarBackup3.config.CollectFile-class.html#__lt__,Method CedarBackup3.config.CommandOverride.__lt__()=CedarBackup3.config.CommandOverride-class.html#__lt__,Method CedarBackup3.config.Config.__lt__()=CedarBackup3.config.Config-class.html#__lt__,Method CedarBackup3.config.ExtendedAction.__lt__()=CedarBackup3.config.ExtendedAction-class.html#__lt__,Method CedarBackup3.config.ExtensionsConfig.__lt__()=CedarBackup3.config.ExtensionsConfig-class.html#__lt__,Method CedarBackup3.config.LocalPeer.__lt__()=CedarBackup3.config.LocalPeer-class.html#__lt__,Method CedarBackup3.config.OptionsConfig.__lt__()=CedarBackup3.config.OptionsConfig-class.html#__lt__,Method CedarBackup3.config.PeersConfig.__lt__()=CedarBackup3.config.PeersConfig-class.html#__lt__,Method CedarBackup3.config.PurgeConfig.__lt__()=CedarBackup3.config.PurgeConfig-class.html#__lt__,Method CedarBackup3.config.PurgeDir.__lt__()=CedarBackup3.config.PurgeDir-class.html#__lt__,Method CedarBackup3.config.ReferenceConfig.__lt__()=CedarBackup3.config.ReferenceConfig-class.html#__lt__,Method CedarBackup3.config.RemotePeer.__lt__()=CedarBackup3.config.RemotePeer-class.html#__lt__,Method CedarBackup3.config.StageConfig.__lt__()=CedarBackup3.config.StageConfig-class.html#__lt__,Method CedarBackup3.config.StoreConfig.__lt__()=CedarBackup3.config.StoreConfig-class.html#__lt__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__lt__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__lt__,Method CedarBackup3.extend.amazons3.LocalConfig.__lt__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.capacity.CapacityConfig.__lt__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__lt__,Method CedarBackup3.extend.capacity.LocalConfig.__lt__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.capacity.PercentageQuantity.__lt__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__lt__,Method CedarBackup3.extend.encrypt.EncryptConfig.__lt__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__lt__,Method CedarBackup3.extend.encrypt.LocalConfig.__lt__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.mbox.LocalConfig.__lt__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.mbox.MboxConfig.__lt__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__lt__,Method CedarBackup3.extend.mbox.MboxDir.__lt__()=CedarBackup3.extend.mbox.MboxDir-class.html#__lt__,Method CedarBackup3.extend.mbox.MboxFile.__lt__()=CedarBackup3.extend.mbox.MboxFile-class.html#__lt__,Method CedarBackup3.extend.mysql.LocalConfig.__lt__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.mysql.MysqlConfig.__lt__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__lt__,Method CedarBackup3.extend.postgresql.LocalConfig.__lt__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__lt__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__lt__,Method CedarBackup3.extend.split.LocalConfig.__lt__()=CedarBackup3.extend.split.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.split.SplitConfig.__lt__()=CedarBackup3.extend.split.SplitConfig-class.html#__lt__,Method CedarBackup3.extend.subversion.LocalConfig.__lt__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__lt__,Method CedarBackup3.extend.subversion.Repository.__lt__()=CedarBackup3.extend.subversion.Repository-class.html#__lt__,Method CedarBackup3.extend.subversion.RepositoryDir.__lt__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__lt__,Method CedarBackup3.extend.subversion.SubversionConfig.__lt__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__lt__,Method CedarBackup3.tools.amazons3.Options.__lt__()=CedarBackup3.tools.amazons3.Options-class.html#__lt__,Method CedarBackup3.util.DirectedGraph.__lt__()=CedarBackup3.util.DirectedGraph-class.html#__lt__,Method CedarBackup3.util.UnorderedList.__lt__()=CedarBackup3.util.UnorderedList-class.html#__lt__"><a title="CedarBackup3.cli.Options.__lt__
CedarBackup3.cli._ActionItem.__lt__
CedarBackup3.cli._ManagedActionItem.__lt__
CedarBackup3.config.ActionDependencies.__lt__
CedarBackup3.config.ActionHook.__lt__
CedarBackup3.config.BlankBehavior.__lt__
CedarBackup3.config.ByteQuantity.__lt__
CedarBackup3.config.CollectConfig.__lt__
CedarBackup3.config.CollectDir.__lt__
CedarBackup3.config.CollectFile.__lt__
CedarBackup3.config.CommandOverride.__lt__
CedarBackup3.config.Config.__lt__
CedarBackup3.config.ExtendedAction.__lt__
CedarBackup3.config.ExtensionsConfig.__lt__
CedarBackup3.config.LocalPeer.__lt__
CedarBackup3.config.OptionsConfig.__lt__
CedarBackup3.config.PeersConfig.__lt__
CedarBackup3.config.PurgeConfig.__lt__
CedarBackup3.config.PurgeDir.__lt__
CedarBackup3.config.ReferenceConfig.__lt__
CedarBackup3.config.RemotePeer.__lt__
CedarBackup3.config.StageConfig.__lt__
CedarBackup3.config.StoreConfig.__lt__
CedarBackup3.extend.amazons3.AmazonS3Config.__lt__
CedarBackup3.extend.amazons3.LocalConfig.__lt__
CedarBackup3.extend.capacity.CapacityConfig.__lt__
CedarBackup3.extend.capacity.LocalConfig.__lt__
CedarBackup3.extend.capacity.PercentageQuantity.__lt__
CedarBackup3.extend.encrypt.EncryptConfig.__lt__
CedarBackup3.extend.encrypt.LocalConfig.__lt__
CedarBackup3.extend.mbox.LocalConfig.__lt__
CedarBackup3.extend.mbox.MboxConfig.__lt__
CedarBackup3.extend.mbox.MboxDir.__lt__
CedarBackup3.extend.mbox.MboxFile.__lt__
CedarBackup3.extend.mysql.LocalConfig.__lt__
CedarBackup3.extend.mysql.MysqlConfig.__lt__
CedarBackup3.extend.postgresql.LocalConfig.__lt__
CedarBackup3.extend.postgresql.PostgresqlConfig.__lt__
CedarBackup3.extend.split.LocalConfig.__lt__
CedarBackup3.extend.split.SplitConfig.__lt__
CedarBackup3.extend.subversion.LocalConfig.__lt__
CedarBackup3.extend.subversion.Repository.__lt__
CedarBackup3.extend.subversion.RepositoryDir.__lt__
CedarBackup3.extend.subversion.SubversionConfig.__lt__
CedarBackup3.tools.amazons3.Options.__lt__
CedarBackup3.util.DirectedGraph.__lt__
CedarBackup3.util.UnorderedList.__lt__" class="py-name" href="#" onclick="return doclink('link-67', '__lt__', 'link-67');">__lt__</a></tt><tt class="py-op">(</tt><tt class="py-name">otherSorted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L247"></a><tt class="py-lineno"> 247</tt> <tt class="py-line"> </tt>
<a name="L248"></a><tt class="py-lineno"> 248</tt> <tt class="py-line"> <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="UnorderedList.mixedsort"></a><div id="UnorderedList.mixedsort-def"><a name="L249"></a><tt class="py-lineno"> 249</tt> <a class="py-toggle" href="#" id="UnorderedList.mixedsort-toggle" onclick="return toggle('UnorderedList.mixedsort');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#mixedsort">mixedsort</a><tt class="py-op">(</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.mixedsort-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.mixedsort-expanded"><a name="L250"></a><tt class="py-lineno"> 250</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L251"></a><tt class="py-lineno"> 251</tt> <tt class="py-line"><tt class="py-docstring"> Sort a list, making sure we don't blow up if the list happens to include mixed values.</tt> </tt>
<a name="L252"></a><tt class="py-lineno"> 252</tt> <tt class="py-line"><tt class="py-docstring"> @see: http://stackoverflow.com/questions/26575183/how-can-i-get-2-x-like-sorting-behaviour-in-python-3-x</tt> </tt>
<a name="L253"></a><tt class="py-lineno"> 253</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L254"></a><tt class="py-lineno"> 254</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">=</tt><tt id="link-68" class="py-name"><a title="CedarBackup3.util.UnorderedList" class="py-name" href="#" onclick="return doclink('link-68', 'UnorderedList', 'link-38');">UnorderedList</a></tt><tt class="py-op">.</tt><tt id="link-69" class="py-name" targets="Static Method CedarBackup3.util.UnorderedList.mixedkey()=CedarBackup3.util.UnorderedList-class.html#mixedkey"><a title="CedarBackup3.util.UnorderedList.mixedkey" class="py-name" href="#" onclick="return doclink('link-69', 'mixedkey', 'link-69');">mixedkey</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L255"></a><tt class="py-lineno"> 255</tt> <tt class="py-line"> </tt>
<a name="L256"></a><tt class="py-lineno"> 256</tt> <tt class="py-line"> <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="L257"></a><tt class="py-lineno"> 257</tt> <tt class="py-line"> <tt class="py-comment">#pylint: disable=R0204</tt> </tt>
<a name="UnorderedList.mixedkey"></a><div id="UnorderedList.mixedkey-def"><a name="L258"></a><tt class="py-lineno"> 258</tt> <a class="py-toggle" href="#" id="UnorderedList.mixedkey-toggle" onclick="return toggle('UnorderedList.mixedkey');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.UnorderedList-class.html#mixedkey">mixedkey</a><tt class="py-op">(</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnorderedList.mixedkey-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="UnorderedList.mixedkey-expanded"><a name="L259"></a><tt class="py-lineno"> 259</tt> <tt class="py-line"> <tt class="py-docstring">"""Provide a key for use by mixedsort()"""</tt> </tt>
<a name="L260"></a><tt class="py-lineno"> 260</tt> <tt class="py-line"> <tt class="py-name">numeric</tt> <tt class="py-op">=</tt> <tt class="py-name">Real</tt><tt class="py-op">,</tt> <tt class="py-name">Decimal</tt> </tt>
<a name="L261"></a><tt class="py-lineno"> 261</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-name">numeric</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L262"></a><tt class="py-lineno"> 262</tt> <tt class="py-line"> <tt class="py-name">typeinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">numeric</tt> </tt>
<a name="L263"></a><tt class="py-lineno"> 263</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L264"></a><tt class="py-lineno"> 264</tt> <tt class="py-line"> <tt class="py-name">typeinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L265"></a><tt class="py-lineno"> 265</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L266"></a><tt class="py-lineno"> 266</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">value</tt> <tt class="py-op"><</tt> <tt class="py-name">value</tt> </tt>
<a name="L267"></a><tt class="py-lineno"> 267</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">TypeError</tt><tt class="py-op">:</tt> </tt>
<a name="L268"></a><tt class="py-lineno"> 268</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L269"></a><tt class="py-lineno"> 269</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">typeinfo</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt> </tt>
</div></div><a name="L270"></a><tt class="py-lineno"> 270</tt> <tt class="py-line"> </tt>
<a name="AbsolutePathList"></a><div id="AbsolutePathList-def"><a name="L271"></a><tt class="py-lineno"> 271</tt> <tt class="py-line"> </tt>
<a name="L272"></a><tt class="py-lineno"> 272</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L273"></a><tt class="py-lineno"> 273</tt> <tt class="py-line"><tt class="py-comment"># AbsolutePathList class definition</tt> </tt>
<a name="L274"></a><tt class="py-lineno"> 274</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L275"></a><tt class="py-lineno"> 275</tt> <tt class="py-line"> </tt>
<a name="L276"></a><tt class="py-lineno"> 276</tt> <a class="py-toggle" href="#" id="AbsolutePathList-toggle" onclick="return toggle('AbsolutePathList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.AbsolutePathList-class.html">AbsolutePathList</a><tt class="py-op">(</tt><tt class="py-base-class">UnorderedList</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AbsolutePathList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="AbsolutePathList-expanded"><a name="L277"></a><tt class="py-lineno"> 277</tt> <tt class="py-line"> </tt>
<a name="L278"></a><tt class="py-lineno"> 278</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L279"></a><tt class="py-lineno"> 279</tt> <tt class="py-line"><tt class="py-docstring"> Class representing a list of absolute paths.</tt> </tt>
<a name="L280"></a><tt class="py-lineno"> 280</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L281"></a><tt class="py-lineno"> 281</tt> <tt class="py-line"><tt class="py-docstring"> This is an unordered list.</tt> </tt>
<a name="L282"></a><tt class="py-lineno"> 282</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L283"></a><tt class="py-lineno"> 283</tt> <tt class="py-line"><tt class="py-docstring"> We override the C{append}, C{insert} and C{extend} methods to ensure that</tt> </tt>
<a name="L284"></a><tt class="py-lineno"> 284</tt> <tt class="py-line"><tt class="py-docstring"> any item added to the list is an absolute path.</tt> </tt>
<a name="L285"></a><tt class="py-lineno"> 285</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L286"></a><tt class="py-lineno"> 286</tt> <tt class="py-line"><tt class="py-docstring"> Each item added to the list is encoded using L{encodePath}. If we don't do</tt> </tt>
<a name="L287"></a><tt class="py-lineno"> 287</tt> <tt class="py-line"><tt class="py-docstring"> this, we have problems trying certain operations between strings and unicode</tt> </tt>
<a name="L288"></a><tt class="py-lineno"> 288</tt> <tt class="py-line"><tt class="py-docstring"> objects, particularly for "odd" filenames that can't be encoded in standard</tt> </tt>
<a name="L289"></a><tt class="py-lineno"> 289</tt> <tt class="py-line"><tt class="py-docstring"> ASCII.</tt> </tt>
<a name="L290"></a><tt class="py-lineno"> 290</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L291"></a><tt class="py-lineno"> 291</tt> <tt class="py-line"> </tt>
<a name="AbsolutePathList.append"></a><div id="AbsolutePathList.append-def"><a name="L292"></a><tt class="py-lineno"> 292</tt> <a class="py-toggle" href="#" id="AbsolutePathList.append-toggle" onclick="return toggle('AbsolutePathList.append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.AbsolutePathList-class.html#append">append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AbsolutePathList.append-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="AbsolutePathList.append-expanded"><a name="L293"></a><tt class="py-lineno"> 293</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L294"></a><tt class="py-lineno"> 294</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{append} method.</tt> </tt>
<a name="L295"></a><tt class="py-lineno"> 295</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not an absolute path.</tt> </tt>
<a name="L296"></a><tt class="py-lineno"> 296</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L297"></a><tt class="py-lineno"> 297</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">isabs</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L298"></a><tt class="py-lineno"> 298</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not an absolute path: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L299"></a><tt class="py-lineno"> 299</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name" targets="Method CedarBackup3.util.AbsolutePathList.append()=CedarBackup3.util.AbsolutePathList-class.html#append,Method CedarBackup3.util.ObjectTypeList.append()=CedarBackup3.util.ObjectTypeList-class.html#append,Method CedarBackup3.util.RegexList.append()=CedarBackup3.util.RegexList-class.html#append,Method CedarBackup3.util.RegexMatchList.append()=CedarBackup3.util.RegexMatchList-class.html#append,Method CedarBackup3.util.RestrictedContentList.append()=CedarBackup3.util.RestrictedContentList-class.html#append"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-70', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-71" class="py-name" targets="Function CedarBackup3.util.encodePath()=CedarBackup3.util-module.html#encodePath"><a title="CedarBackup3.util.encodePath" class="py-name" href="#" onclick="return doclink('link-71', 'encodePath', 'link-71');">encodePath</a></tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L300"></a><tt class="py-lineno"> 300</tt> <tt class="py-line"> </tt>
<a name="AbsolutePathList.insert"></a><div id="AbsolutePathList.insert-def"><a name="L301"></a><tt class="py-lineno"> 301</tt> <a class="py-toggle" href="#" id="AbsolutePathList.insert-toggle" onclick="return toggle('AbsolutePathList.insert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.AbsolutePathList-class.html#insert">insert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AbsolutePathList.insert-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="AbsolutePathList.insert-expanded"><a name="L302"></a><tt class="py-lineno"> 302</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L303"></a><tt class="py-lineno"> 303</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L304"></a><tt class="py-lineno"> 304</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not an absolute path.</tt> </tt>
<a name="L305"></a><tt class="py-lineno"> 305</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L306"></a><tt class="py-lineno"> 306</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">isabs</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L307"></a><tt class="py-lineno"> 307</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not an absolute path: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L308"></a><tt class="py-lineno"> 308</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-72" class="py-name" targets="Method CedarBackup3.util.AbsolutePathList.insert()=CedarBackup3.util.AbsolutePathList-class.html#insert,Method CedarBackup3.util.ObjectTypeList.insert()=CedarBackup3.util.ObjectTypeList-class.html#insert,Method CedarBackup3.util.RegexList.insert()=CedarBackup3.util.RegexList-class.html#insert,Method CedarBackup3.util.RegexMatchList.insert()=CedarBackup3.util.RegexMatchList-class.html#insert,Method CedarBackup3.util.RestrictedContentList.insert()=CedarBackup3.util.RestrictedContentList-class.html#insert"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-72', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-73" class="py-name" targets="Variable CedarBackup3.config.ExtendedAction.index=CedarBackup3.config.ExtendedAction-class.html#index"><a title="CedarBackup3.config.ExtendedAction.index" class="py-name" href="#" onclick="return doclink('link-73', 'index', 'link-73');">index</a></tt><tt class="py-op">,</tt> <tt id="link-74" class="py-name"><a title="CedarBackup3.util.encodePath" class="py-name" href="#" onclick="return doclink('link-74', 'encodePath', 'link-71');">encodePath</a></tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L309"></a><tt class="py-lineno"> 309</tt> <tt class="py-line"> </tt>
<a name="AbsolutePathList.extend"></a><div id="AbsolutePathList.extend-def"><a name="L310"></a><tt class="py-lineno"> 310</tt> <a class="py-toggle" href="#" id="AbsolutePathList.extend-toggle" onclick="return toggle('AbsolutePathList.extend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.AbsolutePathList-class.html#extend">extend</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AbsolutePathList.extend-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="AbsolutePathList.extend-expanded"><a name="L311"></a><tt class="py-lineno"> 311</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L312"></a><tt class="py-lineno"> 312</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L313"></a><tt class="py-lineno"> 313</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If any item is not an absolute path.</tt> </tt>
<a name="L314"></a><tt class="py-lineno"> 314</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L315"></a><tt class="py-lineno"> 315</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L316"></a><tt class="py-lineno"> 316</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">isabs</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L317"></a><tt class="py-lineno"> 317</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not an absolute path: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L318"></a><tt class="py-lineno"> 318</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L319"></a><tt class="py-lineno"> 319</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-75', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-76" class="py-name"><a title="CedarBackup3.util.encodePath" class="py-name" href="#" onclick="return doclink('link-76', 'encodePath', 'link-71');">encodePath</a></tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L320"></a><tt class="py-lineno"> 320</tt> <tt class="py-line"> </tt>
<a name="ObjectTypeList"></a><div id="ObjectTypeList-def"><a name="L321"></a><tt class="py-lineno"> 321</tt> <tt class="py-line"> </tt>
<a name="L322"></a><tt class="py-lineno"> 322</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L323"></a><tt class="py-lineno"> 323</tt> <tt class="py-line"><tt class="py-comment"># ObjectTypeList class definition</tt> </tt>
<a name="L324"></a><tt class="py-lineno"> 324</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L325"></a><tt class="py-lineno"> 325</tt> <tt class="py-line"> </tt>
<a name="L326"></a><tt class="py-lineno"> 326</tt> <a class="py-toggle" href="#" id="ObjectTypeList-toggle" onclick="return toggle('ObjectTypeList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.ObjectTypeList-class.html">ObjectTypeList</a><tt class="py-op">(</tt><tt class="py-base-class">UnorderedList</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ObjectTypeList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ObjectTypeList-expanded"><a name="L327"></a><tt class="py-lineno"> 327</tt> <tt class="py-line"> </tt>
<a name="L328"></a><tt class="py-lineno"> 328</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L329"></a><tt class="py-lineno"> 329</tt> <tt class="py-line"><tt class="py-docstring"> Class representing a list containing only objects with a certain type.</tt> </tt>
<a name="L330"></a><tt class="py-lineno"> 330</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L331"></a><tt class="py-lineno"> 331</tt> <tt class="py-line"><tt class="py-docstring"> This is an unordered list.</tt> </tt>
<a name="L332"></a><tt class="py-lineno"> 332</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L333"></a><tt class="py-lineno"> 333</tt> <tt class="py-line"><tt class="py-docstring"> We override the C{append}, C{insert} and C{extend} methods to ensure that</tt> </tt>
<a name="L334"></a><tt class="py-lineno"> 334</tt> <tt class="py-line"><tt class="py-docstring"> any item added to the list matches the type that is requested. The</tt> </tt>
<a name="L335"></a><tt class="py-lineno"> 335</tt> <tt class="py-line"><tt class="py-docstring"> comparison uses the built-in C{isinstance}, which should allow subclasses of</tt> </tt>
<a name="L336"></a><tt class="py-lineno"> 336</tt> <tt class="py-line"><tt class="py-docstring"> of the requested type to be added to the list as well.</tt> </tt>
<a name="L337"></a><tt class="py-lineno"> 337</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L338"></a><tt class="py-lineno"> 338</tt> <tt class="py-line"><tt class="py-docstring"> The C{objectName} value will be used in exceptions, i.e. C{"Item must be a</tt> </tt>
<a name="L339"></a><tt class="py-lineno"> 339</tt> <tt class="py-line"><tt class="py-docstring"> CollectDir object."} if C{objectName} is C{"CollectDir"}.</tt> </tt>
<a name="L340"></a><tt class="py-lineno"> 340</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L341"></a><tt class="py-lineno"> 341</tt> <tt class="py-line"> </tt>
<a name="ObjectTypeList.__init__"></a><div id="ObjectTypeList.__init__-def"><a name="L342"></a><tt class="py-lineno"> 342</tt> <a class="py-toggle" href="#" id="ObjectTypeList.__init__-toggle" onclick="return toggle('ObjectTypeList.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.ObjectTypeList-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">objectType</tt><tt class="py-op">,</tt> <tt class="py-param">objectName</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ObjectTypeList.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="ObjectTypeList.__init__-expanded"><a name="L343"></a><tt class="py-lineno"> 343</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L344"></a><tt class="py-lineno"> 344</tt> <tt class="py-line"><tt class="py-docstring"> Initializes a typed list for a particular type.</tt> </tt>
<a name="L345"></a><tt class="py-lineno"> 345</tt> <tt class="py-line"><tt class="py-docstring"> @param objectType: Type that the list elements must match.</tt> </tt>
<a name="L346"></a><tt class="py-lineno"> 346</tt> <tt class="py-line"><tt class="py-docstring"> @param objectName: Short string containing the "name" of the type.</tt> </tt>
<a name="L347"></a><tt class="py-lineno"> 347</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L348"></a><tt class="py-lineno"> 348</tt> <tt class="py-line"> <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-77" class="py-name" targets="Class CedarBackup3.util.ObjectTypeList=CedarBackup3.util.ObjectTypeList-class.html"><a title="CedarBackup3.util.ObjectTypeList" class="py-name" href="#" onclick="return doclink('link-77', 'ObjectTypeList', 'link-77');">ObjectTypeList</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name" targets="Method CedarBackup3.cli.Options.__init__()=CedarBackup3.cli.Options-class.html#__init__,Method CedarBackup3.cli._ActionItem.__init__()=CedarBackup3.cli._ActionItem-class.html#__init__,Method CedarBackup3.cli._ActionSet.__init__()=CedarBackup3.cli._ActionSet-class.html#__init__,Method CedarBackup3.cli._ManagedActionItem.__init__()=CedarBackup3.cli._ManagedActionItem-class.html#__init__,Method CedarBackup3.config.ActionDependencies.__init__()=CedarBackup3.config.ActionDependencies-class.html#__init__,Method CedarBackup3.config.ActionHook.__init__()=CedarBackup3.config.ActionHook-class.html#__init__,Method CedarBackup3.config.BlankBehavior.__init__()=CedarBackup3.config.BlankBehavior-class.html#__init__,Method CedarBackup3.config.ByteQuantity.__init__()=CedarBackup3.config.ByteQuantity-class.html#__init__,Method CedarBackup3.config.CollectConfig.__init__()=CedarBackup3.config.CollectConfig-class.html#__init__,Method CedarBackup3.config.CollectDir.__init__()=CedarBackup3.config.CollectDir-class.html#__init__,Method CedarBackup3.config.CollectFile.__init__()=CedarBackup3.config.CollectFile-class.html#__init__,Method CedarBackup3.config.CommandOverride.__init__()=CedarBackup3.config.CommandOverride-class.html#__init__,Method CedarBackup3.config.Config.__init__()=CedarBackup3.config.Config-class.html#__init__,Method CedarBackup3.config.ExtendedAction.__init__()=CedarBackup3.config.ExtendedAction-class.html#__init__,Method CedarBackup3.config.ExtensionsConfig.__init__()=CedarBackup3.config.ExtensionsConfig-class.html#__init__,Method CedarBackup3.config.LocalPeer.__init__()=CedarBackup3.config.LocalPeer-class.html#__init__,Method CedarBackup3.config.OptionsConfig.__init__()=CedarBackup3.config.OptionsConfig-class.html#__init__,Method CedarBackup3.config.PeersConfig.__init__()=CedarBackup3.config.PeersConfig-class.html#__init__,Method CedarBackup3.config.PostActionHook.__init__()=CedarBackup3.config.PostActionHook-class.html#__init__,Method CedarBackup3.config.PreActionHook.__init__()=CedarBackup3.config.PreActionHook-class.html#__init__,Method CedarBackup3.config.PurgeConfig.__init__()=CedarBackup3.config.PurgeConfig-class.html#__init__,Method CedarBackup3.config.PurgeDir.__init__()=CedarBackup3.config.PurgeDir-class.html#__init__,Method CedarBackup3.config.ReferenceConfig.__init__()=CedarBackup3.config.ReferenceConfig-class.html#__init__,Method CedarBackup3.config.RemotePeer.__init__()=CedarBackup3.config.RemotePeer-class.html#__init__,Method CedarBackup3.config.StageConfig.__init__()=CedarBackup3.config.StageConfig-class.html#__init__,Method CedarBackup3.config.StoreConfig.__init__()=CedarBackup3.config.StoreConfig-class.html#__init__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__init__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__init__,Method CedarBackup3.extend.amazons3.LocalConfig.__init__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__init__,Method CedarBackup3.extend.capacity.CapacityConfig.__init__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__init__,Method CedarBackup3.extend.capacity.LocalConfig.__init__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__init__,Method CedarBackup3.extend.capacity.PercentageQuantity.__init__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__init__,Method CedarBackup3.extend.encrypt.EncryptConfig.__init__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__init__,Method CedarBackup3.extend.encrypt.LocalConfig.__init__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__init__,Method CedarBackup3.extend.mbox.LocalConfig.__init__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__init__,Method CedarBackup3.extend.mbox.MboxConfig.__init__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__init__,Method CedarBackup3.extend.mbox.MboxDir.__init__()=CedarBackup3.extend.mbox.MboxDir-class.html#__init__,Method CedarBackup3.extend.mbox.MboxFile.__init__()=CedarBackup3.extend.mbox.MboxFile-class.html#__init__,Method CedarBackup3.extend.mysql.LocalConfig.__init__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__init__,Method CedarBackup3.extend.mysql.MysqlConfig.__init__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__init__,Method CedarBackup3.extend.postgresql.LocalConfig.__init__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__init__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__init__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__init__,Method CedarBackup3.extend.split.LocalConfig.__init__()=CedarBackup3.extend.split.LocalConfig-class.html#__init__,Method CedarBackup3.extend.split.SplitConfig.__init__()=CedarBackup3.extend.split.SplitConfig-class.html#__init__,Method CedarBackup3.extend.subversion.BDBRepository.__init__()=CedarBackup3.extend.subversion.BDBRepository-class.html#__init__,Method CedarBackup3.extend.subversion.FSFSRepository.__init__()=CedarBackup3.extend.subversion.FSFSRepository-class.html#__init__,Method CedarBackup3.extend.subversion.LocalConfig.__init__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__init__,Method CedarBackup3.extend.subversion.Repository.__init__()=CedarBackup3.extend.subversion.Repository-class.html#__init__,Method CedarBackup3.extend.subversion.RepositoryDir.__init__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__init__,Method CedarBackup3.extend.subversion.SubversionConfig.__init__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__init__,Method CedarBackup3.filesystem.BackupFileList.__init__()=CedarBackup3.filesystem.BackupFileList-class.html#__init__,Method CedarBackup3.filesystem.FilesystemList.__init__()=CedarBackup3.filesystem.FilesystemList-class.html#__init__,Method CedarBackup3.filesystem.PurgeItemList.__init__()=CedarBackup3.filesystem.PurgeItemList-class.html#__init__,Method CedarBackup3.filesystem.SpanItem.__init__()=CedarBackup3.filesystem.SpanItem-class.html#__init__,Method CedarBackup3.peer.LocalPeer.__init__()=CedarBackup3.peer.LocalPeer-class.html#__init__,Method CedarBackup3.peer.RemotePeer.__init__()=CedarBackup3.peer.RemotePeer-class.html#__init__,Method CedarBackup3.tools.amazons3.Options.__init__()=CedarBackup3.tools.amazons3.Options-class.html#__init__,Method CedarBackup3.util.Diagnostics.__init__()=CedarBackup3.util.Diagnostics-class.html#__init__,Method CedarBackup3.util.DirectedGraph.__init__()=CedarBackup3.util.DirectedGraph-class.html#__init__,Method CedarBackup3.util.ObjectTypeList.__init__()=CedarBackup3.util.ObjectTypeList-class.html#__init__,Method CedarBackup3.util.PathResolverSingleton._Helper.__init__()=CedarBackup3.util.PathResolverSingleton._Helper-class.html#__init__,Method CedarBackup3.util.PathResolverSingleton.__init__()=CedarBackup3.util.PathResolverSingleton-class.html#__init__,Method CedarBackup3.util.Pipe.__init__()=CedarBackup3.util.Pipe-class.html#__init__,Method CedarBackup3.util.RegexMatchList.__init__()=CedarBackup3.util.RegexMatchList-class.html#__init__,Method CedarBackup3.util.RestrictedContentList.__init__()=CedarBackup3.util.RestrictedContentList-class.html#__init__,Method CedarBackup3.util._Vertex.__init__()=CedarBackup3.util._Vertex-class.html#__init__,Method CedarBackup3.writers.cdwriter.CdWriter.__init__()=CedarBackup3.writers.cdwriter.CdWriter-class.html#__init__,Method CedarBackup3.writers.cdwriter.MediaCapacity.__init__()=CedarBackup3.writers.cdwriter.MediaCapacity-class.html#__init__,Method CedarBackup3.writers.cdwriter.MediaDefinition.__init__()=CedarBackup3.writers.cdwriter.MediaDefinition-class.html#__init__,Method CedarBackup3.writers.cdwriter._ImageProperties.__init__()=CedarBackup3.writers.cdwriter._ImageProperties-class.html#__init__,Method CedarBackup3.writers.dvdwriter.DvdWriter.__init__()=CedarBackup3.writers.dvdwriter.DvdWriter-class.html#__init__,Method CedarBackup3.writers.dvdwriter.MediaCapacity.__init__()=CedarBackup3.writers.dvdwriter.MediaCapacity-class.html#__init__,Method CedarBackup3.writers.dvdwriter.MediaDefinition.__init__()=CedarBackup3.writers.dvdwriter.MediaDefinition-class.html#__init__,Method CedarBackup3.writers.dvdwriter._ImageProperties.__init__()=CedarBackup3.writers.dvdwriter._ImageProperties-class.html#__init__,Method CedarBackup3.writers.util.IsoImage.__init__()=CedarBackup3.writers.util.IsoImage-class.html#__init__,Method CedarBackup3.xmlutil.Serializer.__init__()=CedarBackup3.xmlutil.Serializer-class.html#__init__"><a title="CedarBackup3.cli.Options.__init__
CedarBackup3.cli._ActionItem.__init__
CedarBackup3.cli._ActionSet.__init__
CedarBackup3.cli._ManagedActionItem.__init__
CedarBackup3.config.ActionDependencies.__init__
CedarBackup3.config.ActionHook.__init__
CedarBackup3.config.BlankBehavior.__init__
CedarBackup3.config.ByteQuantity.__init__
CedarBackup3.config.CollectConfig.__init__
CedarBackup3.config.CollectDir.__init__
CedarBackup3.config.CollectFile.__init__
CedarBackup3.config.CommandOverride.__init__
CedarBackup3.config.Config.__init__
CedarBackup3.config.ExtendedAction.__init__
CedarBackup3.config.ExtensionsConfig.__init__
CedarBackup3.config.LocalPeer.__init__
CedarBackup3.config.OptionsConfig.__init__
CedarBackup3.config.PeersConfig.__init__
CedarBackup3.config.PostActionHook.__init__
CedarBackup3.config.PreActionHook.__init__
CedarBackup3.config.PurgeConfig.__init__
CedarBackup3.config.PurgeDir.__init__
CedarBackup3.config.ReferenceConfig.__init__
CedarBackup3.config.RemotePeer.__init__
CedarBackup3.config.StageConfig.__init__
CedarBackup3.config.StoreConfig.__init__
CedarBackup3.extend.amazons3.AmazonS3Config.__init__
CedarBackup3.extend.amazons3.LocalConfig.__init__
CedarBackup3.extend.capacity.CapacityConfig.__init__
CedarBackup3.extend.capacity.LocalConfig.__init__
CedarBackup3.extend.capacity.PercentageQuantity.__init__
CedarBackup3.extend.encrypt.EncryptConfig.__init__
CedarBackup3.extend.encrypt.LocalConfig.__init__
CedarBackup3.extend.mbox.LocalConfig.__init__
CedarBackup3.extend.mbox.MboxConfig.__init__
CedarBackup3.extend.mbox.MboxDir.__init__
CedarBackup3.extend.mbox.MboxFile.__init__
CedarBackup3.extend.mysql.LocalConfig.__init__
CedarBackup3.extend.mysql.MysqlConfig.__init__
CedarBackup3.extend.postgresql.LocalConfig.__init__
CedarBackup3.extend.postgresql.PostgresqlConfig.__init__
CedarBackup3.extend.split.LocalConfig.__init__
CedarBackup3.extend.split.SplitConfig.__init__
CedarBackup3.extend.subversion.BDBRepository.__init__
CedarBackup3.extend.subversion.FSFSRepository.__init__
CedarBackup3.extend.subversion.LocalConfig.__init__
CedarBackup3.extend.subversion.Repository.__init__
CedarBackup3.extend.subversion.RepositoryDir.__init__
CedarBackup3.extend.subversion.SubversionConfig.__init__
CedarBackup3.filesystem.BackupFileList.__init__
CedarBackup3.filesystem.FilesystemList.__init__
CedarBackup3.filesystem.PurgeItemList.__init__
CedarBackup3.filesystem.SpanItem.__init__
CedarBackup3.peer.LocalPeer.__init__
CedarBackup3.peer.RemotePeer.__init__
CedarBackup3.tools.amazons3.Options.__init__
CedarBackup3.util.Diagnostics.__init__
CedarBackup3.util.DirectedGraph.__init__
CedarBackup3.util.ObjectTypeList.__init__
CedarBackup3.util.PathResolverSingleton._Helper.__init__
CedarBackup3.util.PathResolverSingleton.__init__
CedarBackup3.util.Pipe.__init__
CedarBackup3.util.RegexMatchList.__init__
CedarBackup3.util.RestrictedContentList.__init__
CedarBackup3.util._Vertex.__init__
CedarBackup3.writers.cdwriter.CdWriter.__init__
CedarBackup3.writers.cdwriter.MediaCapacity.__init__
CedarBackup3.writers.cdwriter.MediaDefinition.__init__
CedarBackup3.writers.cdwriter._ImageProperties.__init__
CedarBackup3.writers.dvdwriter.DvdWriter.__init__
CedarBackup3.writers.dvdwriter.MediaCapacity.__init__
CedarBackup3.writers.dvdwriter.MediaDefinition.__init__
CedarBackup3.writers.dvdwriter._ImageProperties.__init__
CedarBackup3.writers.util.IsoImage.__init__
CedarBackup3.xmlutil.Serializer.__init__" class="py-name" href="#" onclick="return doclink('link-78', '__init__', 'link-78');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L349"></a><tt class="py-lineno"> 349</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectType</tt> <tt class="py-op">=</tt> <tt class="py-name">objectType</tt> </tt>
<a name="L350"></a><tt class="py-lineno"> 350</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectName</tt> <tt class="py-op">=</tt> <tt class="py-name">objectName</tt> </tt>
</div><a name="L351"></a><tt class="py-lineno"> 351</tt> <tt class="py-line"> </tt>
<a name="ObjectTypeList.append"></a><div id="ObjectTypeList.append-def"><a name="L352"></a><tt class="py-lineno"> 352</tt> <a class="py-toggle" href="#" id="ObjectTypeList.append-toggle" onclick="return toggle('ObjectTypeList.append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.ObjectTypeList-class.html#append">append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ObjectTypeList.append-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="ObjectTypeList.append-expanded"><a name="L353"></a><tt class="py-lineno"> 353</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L354"></a><tt class="py-lineno"> 354</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{append} method.</tt> </tt>
<a name="L355"></a><tt class="py-lineno"> 355</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item does not match requested type.</tt> </tt>
<a name="L356"></a><tt class="py-lineno"> 356</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L357"></a><tt class="py-lineno"> 357</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectType</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L358"></a><tt class="py-lineno"> 358</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Item must be a %s object."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectName</tt><tt class="py-op">)</tt> </tt>
<a name="L359"></a><tt class="py-lineno"> 359</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-79', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L360"></a><tt class="py-lineno"> 360</tt> <tt class="py-line"> </tt>
<a name="ObjectTypeList.insert"></a><div id="ObjectTypeList.insert-def"><a name="L361"></a><tt class="py-lineno"> 361</tt> <a class="py-toggle" href="#" id="ObjectTypeList.insert-toggle" onclick="return toggle('ObjectTypeList.insert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.ObjectTypeList-class.html#insert">insert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ObjectTypeList.insert-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="ObjectTypeList.insert-expanded"><a name="L362"></a><tt class="py-lineno"> 362</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L363"></a><tt class="py-lineno"> 363</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L364"></a><tt class="py-lineno"> 364</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item does not match requested type.</tt> </tt>
<a name="L365"></a><tt class="py-lineno"> 365</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L366"></a><tt class="py-lineno"> 366</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectType</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L367"></a><tt class="py-lineno"> 367</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Item must be a %s object."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectName</tt><tt class="py-op">)</tt> </tt>
<a name="L368"></a><tt class="py-lineno"> 368</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-80" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-80', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-81" class="py-name"><a title="CedarBackup3.config.ExtendedAction.index" class="py-name" href="#" onclick="return doclink('link-81', 'index', 'link-73');">index</a></tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L369"></a><tt class="py-lineno"> 369</tt> <tt class="py-line"> </tt>
<a name="ObjectTypeList.extend"></a><div id="ObjectTypeList.extend-def"><a name="L370"></a><tt class="py-lineno"> 370</tt> <a class="py-toggle" href="#" id="ObjectTypeList.extend-toggle" onclick="return toggle('ObjectTypeList.extend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.ObjectTypeList-class.html#extend">extend</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ObjectTypeList.extend-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="ObjectTypeList.extend-expanded"><a name="L371"></a><tt class="py-lineno"> 371</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L372"></a><tt class="py-lineno"> 372</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L373"></a><tt class="py-lineno"> 373</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item does not match requested type.</tt> </tt>
<a name="L374"></a><tt class="py-lineno"> 374</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L375"></a><tt class="py-lineno"> 375</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L376"></a><tt class="py-lineno"> 376</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectType</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L377"></a><tt class="py-lineno"> 377</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"All items must be %s objects."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">objectName</tt><tt class="py-op">)</tt> </tt>
<a name="L378"></a><tt class="py-lineno"> 378</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name" targets="Package CedarBackup3.extend=CedarBackup3.extend-module.html,Method CedarBackup3.util.AbsolutePathList.extend()=CedarBackup3.util.AbsolutePathList-class.html#extend,Method CedarBackup3.util.ObjectTypeList.extend()=CedarBackup3.util.ObjectTypeList-class.html#extend,Method CedarBackup3.util.RegexList.extend()=CedarBackup3.util.RegexList-class.html#extend,Method CedarBackup3.util.RegexMatchList.extend()=CedarBackup3.util.RegexMatchList-class.html#extend,Method CedarBackup3.util.RestrictedContentList.extend()=CedarBackup3.util.RestrictedContentList-class.html#extend"><a title="CedarBackup3.extend
CedarBackup3.util.AbsolutePathList.extend
CedarBackup3.util.ObjectTypeList.extend
CedarBackup3.util.RegexList.extend
CedarBackup3.util.RegexMatchList.extend
CedarBackup3.util.RestrictedContentList.extend" class="py-name" href="#" onclick="return doclink('link-82', 'extend', 'link-82');">extend</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L379"></a><tt class="py-lineno"> 379</tt> <tt class="py-line"> </tt>
<a name="RestrictedContentList"></a><div id="RestrictedContentList-def"><a name="L380"></a><tt class="py-lineno"> 380</tt> <tt class="py-line"> </tt>
<a name="L381"></a><tt class="py-lineno"> 381</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L382"></a><tt class="py-lineno"> 382</tt> <tt class="py-line"><tt class="py-comment"># RestrictedContentList class definition</tt> </tt>
<a name="L383"></a><tt class="py-lineno"> 383</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L384"></a><tt class="py-lineno"> 384</tt> <tt class="py-line"> </tt>
<a name="L385"></a><tt class="py-lineno"> 385</tt> <a class="py-toggle" href="#" id="RestrictedContentList-toggle" onclick="return toggle('RestrictedContentList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.RestrictedContentList-class.html">RestrictedContentList</a><tt class="py-op">(</tt><tt class="py-base-class">UnorderedList</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RestrictedContentList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="RestrictedContentList-expanded"><a name="L386"></a><tt class="py-lineno"> 386</tt> <tt class="py-line"> </tt>
<a name="L387"></a><tt class="py-lineno"> 387</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L388"></a><tt class="py-lineno"> 388</tt> <tt class="py-line"><tt class="py-docstring"> Class representing a list containing only object with certain values.</tt> </tt>
<a name="L389"></a><tt class="py-lineno"> 389</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L390"></a><tt class="py-lineno"> 390</tt> <tt class="py-line"><tt class="py-docstring"> This is an unordered list.</tt> </tt>
<a name="L391"></a><tt class="py-lineno"> 391</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L392"></a><tt class="py-lineno"> 392</tt> <tt class="py-line"><tt class="py-docstring"> We override the C{append}, C{insert} and C{extend} methods to ensure that</tt> </tt>
<a name="L393"></a><tt class="py-lineno"> 393</tt> <tt class="py-line"><tt class="py-docstring"> any item added to the list is among the valid values. We use a standard</tt> </tt>
<a name="L394"></a><tt class="py-lineno"> 394</tt> <tt class="py-line"><tt class="py-docstring"> comparison, so pretty much anything can be in the list of valid values.</tt> </tt>
<a name="L395"></a><tt class="py-lineno"> 395</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L396"></a><tt class="py-lineno"> 396</tt> <tt class="py-line"><tt class="py-docstring"> The C{valuesDescr} value will be used in exceptions, i.e. C{"Item must be</tt> </tt>
<a name="L397"></a><tt class="py-lineno"> 397</tt> <tt class="py-line"><tt class="py-docstring"> one of values in VALID_ACTIONS"} if C{valuesDescr} is C{"VALID_ACTIONS"}.</tt> </tt>
<a name="L398"></a><tt class="py-lineno"> 398</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L399"></a><tt class="py-lineno"> 399</tt> <tt class="py-line"><tt class="py-docstring"> @note: This class doesn't make any attempt to trap for nonsensical</tt> </tt>
<a name="L400"></a><tt class="py-lineno"> 400</tt> <tt class="py-line"><tt class="py-docstring"> arguments. All of the values in the values list should be of the same type</tt> </tt>
<a name="L401"></a><tt class="py-lineno"> 401</tt> <tt class="py-line"><tt class="py-docstring"> (i.e. strings). Then, all list operations also need to be of that type</tt> </tt>
<a name="L402"></a><tt class="py-lineno"> 402</tt> <tt class="py-line"><tt class="py-docstring"> (i.e. you should always insert or append just strings). If you mix types --</tt> </tt>
<a name="L403"></a><tt class="py-lineno"> 403</tt> <tt class="py-line"><tt class="py-docstring"> for instance lists and strings -- you will likely see AttributeError</tt> </tt>
<a name="L404"></a><tt class="py-lineno"> 404</tt> <tt class="py-line"><tt class="py-docstring"> exceptions or other problems.</tt> </tt>
<a name="L405"></a><tt class="py-lineno"> 405</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L406"></a><tt class="py-lineno"> 406</tt> <tt class="py-line"> </tt>
<a name="RestrictedContentList.__init__"></a><div id="RestrictedContentList.__init__-def"><a name="L407"></a><tt class="py-lineno"> 407</tt> <a class="py-toggle" href="#" id="RestrictedContentList.__init__-toggle" onclick="return toggle('RestrictedContentList.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RestrictedContentList-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">valuesList</tt><tt class="py-op">,</tt> <tt class="py-param">valuesDescr</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RestrictedContentList.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RestrictedContentList.__init__-expanded"><a name="L408"></a><tt class="py-lineno"> 408</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L409"></a><tt class="py-lineno"> 409</tt> <tt class="py-line"><tt class="py-docstring"> Initializes a list restricted to containing certain values.</tt> </tt>
<a name="L410"></a><tt class="py-lineno"> 410</tt> <tt class="py-line"><tt class="py-docstring"> @param valuesList: List of valid values.</tt> </tt>
<a name="L411"></a><tt class="py-lineno"> 411</tt> <tt class="py-line"><tt class="py-docstring"> @param valuesDescr: Short string describing list of values.</tt> </tt>
<a name="L412"></a><tt class="py-lineno"> 412</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix to use in error messages (None results in prefix "Item")</tt> </tt>
<a name="L413"></a><tt class="py-lineno"> 413</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L414"></a><tt class="py-lineno"> 414</tt> <tt class="py-line"> <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-83" class="py-name" targets="Class CedarBackup3.util.RestrictedContentList=CedarBackup3.util.RestrictedContentList-class.html"><a title="CedarBackup3.util.RestrictedContentList" class="py-name" href="#" onclick="return doclink('link-83', 'RestrictedContentList', 'link-83');">RestrictedContentList</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name"><a title="CedarBackup3.cli.Options.__init__
CedarBackup3.cli._ActionItem.__init__
CedarBackup3.cli._ActionSet.__init__
CedarBackup3.cli._ManagedActionItem.__init__
CedarBackup3.config.ActionDependencies.__init__
CedarBackup3.config.ActionHook.__init__
CedarBackup3.config.BlankBehavior.__init__
CedarBackup3.config.ByteQuantity.__init__
CedarBackup3.config.CollectConfig.__init__
CedarBackup3.config.CollectDir.__init__
CedarBackup3.config.CollectFile.__init__
CedarBackup3.config.CommandOverride.__init__
CedarBackup3.config.Config.__init__
CedarBackup3.config.ExtendedAction.__init__
CedarBackup3.config.ExtensionsConfig.__init__
CedarBackup3.config.LocalPeer.__init__
CedarBackup3.config.OptionsConfig.__init__
CedarBackup3.config.PeersConfig.__init__
CedarBackup3.config.PostActionHook.__init__
CedarBackup3.config.PreActionHook.__init__
CedarBackup3.config.PurgeConfig.__init__
CedarBackup3.config.PurgeDir.__init__
CedarBackup3.config.ReferenceConfig.__init__
CedarBackup3.config.RemotePeer.__init__
CedarBackup3.config.StageConfig.__init__
CedarBackup3.config.StoreConfig.__init__
CedarBackup3.extend.amazons3.AmazonS3Config.__init__
CedarBackup3.extend.amazons3.LocalConfig.__init__
CedarBackup3.extend.capacity.CapacityConfig.__init__
CedarBackup3.extend.capacity.LocalConfig.__init__
CedarBackup3.extend.capacity.PercentageQuantity.__init__
CedarBackup3.extend.encrypt.EncryptConfig.__init__
CedarBackup3.extend.encrypt.LocalConfig.__init__
CedarBackup3.extend.mbox.LocalConfig.__init__
CedarBackup3.extend.mbox.MboxConfig.__init__
CedarBackup3.extend.mbox.MboxDir.__init__
CedarBackup3.extend.mbox.MboxFile.__init__
CedarBackup3.extend.mysql.LocalConfig.__init__
CedarBackup3.extend.mysql.MysqlConfig.__init__
CedarBackup3.extend.postgresql.LocalConfig.__init__
CedarBackup3.extend.postgresql.PostgresqlConfig.__init__
CedarBackup3.extend.split.LocalConfig.__init__
CedarBackup3.extend.split.SplitConfig.__init__
CedarBackup3.extend.subversion.BDBRepository.__init__
CedarBackup3.extend.subversion.FSFSRepository.__init__
CedarBackup3.extend.subversion.LocalConfig.__init__
CedarBackup3.extend.subversion.Repository.__init__
CedarBackup3.extend.subversion.RepositoryDir.__init__
CedarBackup3.extend.subversion.SubversionConfig.__init__
CedarBackup3.filesystem.BackupFileList.__init__
CedarBackup3.filesystem.FilesystemList.__init__
CedarBackup3.filesystem.PurgeItemList.__init__
CedarBackup3.filesystem.SpanItem.__init__
CedarBackup3.peer.LocalPeer.__init__
CedarBackup3.peer.RemotePeer.__init__
CedarBackup3.tools.amazons3.Options.__init__
CedarBackup3.util.Diagnostics.__init__
CedarBackup3.util.DirectedGraph.__init__
CedarBackup3.util.ObjectTypeList.__init__
CedarBackup3.util.PathResolverSingleton._Helper.__init__
CedarBackup3.util.PathResolverSingleton.__init__
CedarBackup3.util.Pipe.__init__
CedarBackup3.util.RegexMatchList.__init__
CedarBackup3.util.RestrictedContentList.__init__
CedarBackup3.util._Vertex.__init__
CedarBackup3.writers.cdwriter.CdWriter.__init__
CedarBackup3.writers.cdwriter.MediaCapacity.__init__
CedarBackup3.writers.cdwriter.MediaDefinition.__init__
CedarBackup3.writers.cdwriter._ImageProperties.__init__
CedarBackup3.writers.dvdwriter.DvdWriter.__init__
CedarBackup3.writers.dvdwriter.MediaCapacity.__init__
CedarBackup3.writers.dvdwriter.MediaDefinition.__init__
CedarBackup3.writers.dvdwriter._ImageProperties.__init__
CedarBackup3.writers.util.IsoImage.__init__
CedarBackup3.xmlutil.Serializer.__init__" class="py-name" href="#" onclick="return doclink('link-84', '__init__', 'link-78');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L415"></a><tt class="py-lineno"> 415</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt> <tt class="py-op">=</tt> <tt class="py-string">"Item"</tt> </tt>
<a name="L416"></a><tt class="py-lineno"> 416</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">prefix</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt> <tt class="py-op">=</tt> <tt class="py-name">prefix</tt> </tt>
<a name="L417"></a><tt class="py-lineno"> 417</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesList</tt> <tt class="py-op">=</tt> <tt class="py-name">valuesList</tt> </tt>
<a name="L418"></a><tt class="py-lineno"> 418</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesDescr</tt> <tt class="py-op">=</tt> <tt class="py-name">valuesDescr</tt> </tt>
</div><a name="L419"></a><tt class="py-lineno"> 419</tt> <tt class="py-line"> </tt>
<a name="RestrictedContentList.append"></a><div id="RestrictedContentList.append-def"><a name="L420"></a><tt class="py-lineno"> 420</tt> <a class="py-toggle" href="#" id="RestrictedContentList.append-toggle" onclick="return toggle('RestrictedContentList.append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RestrictedContentList-class.html#append">append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RestrictedContentList.append-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RestrictedContentList.append-expanded"><a name="L421"></a><tt class="py-lineno"> 421</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L422"></a><tt class="py-lineno"> 422</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{append} method.</tt> </tt>
<a name="L423"></a><tt class="py-lineno"> 423</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not in the values list.</tt> </tt>
<a name="L424"></a><tt class="py-lineno"> 424</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L425"></a><tt class="py-lineno"> 425</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesList</tt><tt class="py-op">:</tt> </tt>
<a name="L426"></a><tt class="py-lineno"> 426</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s must be one of the values in %s."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesDescr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L427"></a><tt class="py-lineno"> 427</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-85', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L428"></a><tt class="py-lineno"> 428</tt> <tt class="py-line"> </tt>
<a name="RestrictedContentList.insert"></a><div id="RestrictedContentList.insert-def"><a name="L429"></a><tt class="py-lineno"> 429</tt> <a class="py-toggle" href="#" id="RestrictedContentList.insert-toggle" onclick="return toggle('RestrictedContentList.insert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RestrictedContentList-class.html#insert">insert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RestrictedContentList.insert-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RestrictedContentList.insert-expanded"><a name="L430"></a><tt class="py-lineno"> 430</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L431"></a><tt class="py-lineno"> 431</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L432"></a><tt class="py-lineno"> 432</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not in the values list.</tt> </tt>
<a name="L433"></a><tt class="py-lineno"> 433</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L434"></a><tt class="py-lineno"> 434</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesList</tt><tt class="py-op">:</tt> </tt>
<a name="L435"></a><tt class="py-lineno"> 435</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s must be one of the values in %s."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesDescr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L436"></a><tt class="py-lineno"> 436</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-86', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-87" class="py-name"><a title="CedarBackup3.config.ExtendedAction.index" class="py-name" href="#" onclick="return doclink('link-87', 'index', 'link-73');">index</a></tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L437"></a><tt class="py-lineno"> 437</tt> <tt class="py-line"> </tt>
<a name="RestrictedContentList.extend"></a><div id="RestrictedContentList.extend-def"><a name="L438"></a><tt class="py-lineno"> 438</tt> <a class="py-toggle" href="#" id="RestrictedContentList.extend-toggle" onclick="return toggle('RestrictedContentList.extend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RestrictedContentList-class.html#extend">extend</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RestrictedContentList.extend-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RestrictedContentList.extend-expanded"><a name="L439"></a><tt class="py-lineno"> 439</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L440"></a><tt class="py-lineno"> 440</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L441"></a><tt class="py-lineno"> 441</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not in the values list.</tt> </tt>
<a name="L442"></a><tt class="py-lineno"> 442</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L443"></a><tt class="py-lineno"> 443</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L444"></a><tt class="py-lineno"> 444</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesList</tt><tt class="py-op">:</tt> </tt>
<a name="L445"></a><tt class="py-lineno"> 445</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s must be one of the values in %s."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesDescr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L446"></a><tt class="py-lineno"> 446</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-88" class="py-name"><a title="CedarBackup3.extend
CedarBackup3.util.AbsolutePathList.extend
CedarBackup3.util.ObjectTypeList.extend
CedarBackup3.util.RegexList.extend
CedarBackup3.util.RegexMatchList.extend
CedarBackup3.util.RestrictedContentList.extend" class="py-name" href="#" onclick="return doclink('link-88', 'extend', 'link-82');">extend</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L447"></a><tt class="py-lineno"> 447</tt> <tt class="py-line"> </tt>
<a name="RegexMatchList"></a><div id="RegexMatchList-def"><a name="L448"></a><tt class="py-lineno"> 448</tt> <tt class="py-line"> </tt>
<a name="L449"></a><tt class="py-lineno"> 449</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L450"></a><tt class="py-lineno"> 450</tt> <tt class="py-line"><tt class="py-comment"># RegexMatchList class definition</tt> </tt>
<a name="L451"></a><tt class="py-lineno"> 451</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L452"></a><tt class="py-lineno"> 452</tt> <tt class="py-line"> </tt>
<a name="L453"></a><tt class="py-lineno"> 453</tt> <a class="py-toggle" href="#" id="RegexMatchList-toggle" onclick="return toggle('RegexMatchList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.RegexMatchList-class.html">RegexMatchList</a><tt class="py-op">(</tt><tt class="py-base-class">UnorderedList</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexMatchList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="RegexMatchList-expanded"><a name="L454"></a><tt class="py-lineno"> 454</tt> <tt class="py-line"> </tt>
<a name="L455"></a><tt class="py-lineno"> 455</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L456"></a><tt class="py-lineno"> 456</tt> <tt class="py-line"><tt class="py-docstring"> Class representing a list containing only strings that match a regular expression.</tt> </tt>
<a name="L457"></a><tt class="py-lineno"> 457</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L458"></a><tt class="py-lineno"> 458</tt> <tt class="py-line"><tt class="py-docstring"> If C{emptyAllowed} is passed in as C{False}, then empty strings are</tt> </tt>
<a name="L459"></a><tt class="py-lineno"> 459</tt> <tt class="py-line"><tt class="py-docstring"> explicitly disallowed, even if they happen to match the regular expression.</tt> </tt>
<a name="L460"></a><tt class="py-lineno"> 460</tt> <tt class="py-line"><tt class="py-docstring"> (C{None} values are always disallowed, since string operations are not</tt> </tt>
<a name="L461"></a><tt class="py-lineno"> 461</tt> <tt class="py-line"><tt class="py-docstring"> permitted on C{None}.)</tt> </tt>
<a name="L462"></a><tt class="py-lineno"> 462</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L463"></a><tt class="py-lineno"> 463</tt> <tt class="py-line"><tt class="py-docstring"> This is an unordered list.</tt> </tt>
<a name="L464"></a><tt class="py-lineno"> 464</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L465"></a><tt class="py-lineno"> 465</tt> <tt class="py-line"><tt class="py-docstring"> We override the C{append}, C{insert} and C{extend} methods to ensure that</tt> </tt>
<a name="L466"></a><tt class="py-lineno"> 466</tt> <tt class="py-line"><tt class="py-docstring"> any item added to the list matches the indicated regular expression.</tt> </tt>
<a name="L467"></a><tt class="py-lineno"> 467</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L468"></a><tt class="py-lineno"> 468</tt> <tt class="py-line"><tt class="py-docstring"> @note: If you try to put values that are not strings into the list, you will</tt> </tt>
<a name="L469"></a><tt class="py-lineno"> 469</tt> <tt class="py-line"><tt class="py-docstring"> likely get either TypeError or AttributeError exceptions as a result.</tt> </tt>
<a name="L470"></a><tt class="py-lineno"> 470</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L471"></a><tt class="py-lineno"> 471</tt> <tt class="py-line"> </tt>
<a name="RegexMatchList.__init__"></a><div id="RegexMatchList.__init__-def"><a name="L472"></a><tt class="py-lineno"> 472</tt> <a class="py-toggle" href="#" id="RegexMatchList.__init__-toggle" onclick="return toggle('RegexMatchList.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexMatchList-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">valuesRegex</tt><tt class="py-op">,</tt> <tt class="py-param">emptyAllowed</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexMatchList.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexMatchList.__init__-expanded"><a name="L473"></a><tt class="py-lineno"> 473</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L474"></a><tt class="py-lineno"> 474</tt> <tt class="py-line"><tt class="py-docstring"> Initializes a list restricted to containing certain values.</tt> </tt>
<a name="L475"></a><tt class="py-lineno"> 475</tt> <tt class="py-line"><tt class="py-docstring"> @param valuesRegex: Regular expression that must be matched, as a string</tt> </tt>
<a name="L476"></a><tt class="py-lineno"> 476</tt> <tt class="py-line"><tt class="py-docstring"> @param emptyAllowed: Indicates whether empty or None values are allowed.</tt> </tt>
<a name="L477"></a><tt class="py-lineno"> 477</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix to use in error messages (None results in prefix "Item")</tt> </tt>
<a name="L478"></a><tt class="py-lineno"> 478</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L479"></a><tt class="py-lineno"> 479</tt> <tt class="py-line"> <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-89" class="py-name" targets="Class CedarBackup3.util.RegexMatchList=CedarBackup3.util.RegexMatchList-class.html"><a title="CedarBackup3.util.RegexMatchList" class="py-name" href="#" onclick="return doclink('link-89', 'RegexMatchList', 'link-89');">RegexMatchList</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="CedarBackup3.cli.Options.__init__
CedarBackup3.cli._ActionItem.__init__
CedarBackup3.cli._ActionSet.__init__
CedarBackup3.cli._ManagedActionItem.__init__
CedarBackup3.config.ActionDependencies.__init__
CedarBackup3.config.ActionHook.__init__
CedarBackup3.config.BlankBehavior.__init__
CedarBackup3.config.ByteQuantity.__init__
CedarBackup3.config.CollectConfig.__init__
CedarBackup3.config.CollectDir.__init__
CedarBackup3.config.CollectFile.__init__
CedarBackup3.config.CommandOverride.__init__
CedarBackup3.config.Config.__init__
CedarBackup3.config.ExtendedAction.__init__
CedarBackup3.config.ExtensionsConfig.__init__
CedarBackup3.config.LocalPeer.__init__
CedarBackup3.config.OptionsConfig.__init__
CedarBackup3.config.PeersConfig.__init__
CedarBackup3.config.PostActionHook.__init__
CedarBackup3.config.PreActionHook.__init__
CedarBackup3.config.PurgeConfig.__init__
CedarBackup3.config.PurgeDir.__init__
CedarBackup3.config.ReferenceConfig.__init__
CedarBackup3.config.RemotePeer.__init__
CedarBackup3.config.StageConfig.__init__
CedarBackup3.config.StoreConfig.__init__
CedarBackup3.extend.amazons3.AmazonS3Config.__init__
CedarBackup3.extend.amazons3.LocalConfig.__init__
CedarBackup3.extend.capacity.CapacityConfig.__init__
CedarBackup3.extend.capacity.LocalConfig.__init__
CedarBackup3.extend.capacity.PercentageQuantity.__init__
CedarBackup3.extend.encrypt.EncryptConfig.__init__
CedarBackup3.extend.encrypt.LocalConfig.__init__
CedarBackup3.extend.mbox.LocalConfig.__init__
CedarBackup3.extend.mbox.MboxConfig.__init__
CedarBackup3.extend.mbox.MboxDir.__init__
CedarBackup3.extend.mbox.MboxFile.__init__
CedarBackup3.extend.mysql.LocalConfig.__init__
CedarBackup3.extend.mysql.MysqlConfig.__init__
CedarBackup3.extend.postgresql.LocalConfig.__init__
CedarBackup3.extend.postgresql.PostgresqlConfig.__init__
CedarBackup3.extend.split.LocalConfig.__init__
CedarBackup3.extend.split.SplitConfig.__init__
CedarBackup3.extend.subversion.BDBRepository.__init__
CedarBackup3.extend.subversion.FSFSRepository.__init__
CedarBackup3.extend.subversion.LocalConfig.__init__
CedarBackup3.extend.subversion.Repository.__init__
CedarBackup3.extend.subversion.RepositoryDir.__init__
CedarBackup3.extend.subversion.SubversionConfig.__init__
CedarBackup3.filesystem.BackupFileList.__init__
CedarBackup3.filesystem.FilesystemList.__init__
CedarBackup3.filesystem.PurgeItemList.__init__
CedarBackup3.filesystem.SpanItem.__init__
CedarBackup3.peer.LocalPeer.__init__
CedarBackup3.peer.RemotePeer.__init__
CedarBackup3.tools.amazons3.Options.__init__
CedarBackup3.util.Diagnostics.__init__
CedarBackup3.util.DirectedGraph.__init__
CedarBackup3.util.ObjectTypeList.__init__
CedarBackup3.util.PathResolverSingleton._Helper.__init__
CedarBackup3.util.PathResolverSingleton.__init__
CedarBackup3.util.Pipe.__init__
CedarBackup3.util.RegexMatchList.__init__
CedarBackup3.util.RestrictedContentList.__init__
CedarBackup3.util._Vertex.__init__
CedarBackup3.writers.cdwriter.CdWriter.__init__
CedarBackup3.writers.cdwriter.MediaCapacity.__init__
CedarBackup3.writers.cdwriter.MediaDefinition.__init__
CedarBackup3.writers.cdwriter._ImageProperties.__init__
CedarBackup3.writers.dvdwriter.DvdWriter.__init__
CedarBackup3.writers.dvdwriter.MediaCapacity.__init__
CedarBackup3.writers.dvdwriter.MediaDefinition.__init__
CedarBackup3.writers.dvdwriter._ImageProperties.__init__
CedarBackup3.writers.util.IsoImage.__init__
CedarBackup3.xmlutil.Serializer.__init__" class="py-name" href="#" onclick="return doclink('link-90', '__init__', 'link-78');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L480"></a><tt class="py-lineno"> 480</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt> <tt class="py-op">=</tt> <tt class="py-string">"Item"</tt> </tt>
<a name="L481"></a><tt class="py-lineno"> 481</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">prefix</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt> <tt class="py-op">=</tt> <tt class="py-name">prefix</tt> </tt>
<a name="L482"></a><tt class="py-lineno"> 482</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesRegex</tt> <tt class="py-op">=</tt> <tt class="py-name">valuesRegex</tt> </tt>
<a name="L483"></a><tt class="py-lineno"> 483</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">emptyAllowed</tt> <tt class="py-op">=</tt> <tt class="py-name">emptyAllowed</tt> </tt>
<a name="L484"></a><tt class="py-lineno"> 484</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pattern</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">valuesRegex</tt><tt class="py-op">)</tt> </tt>
</div><a name="L485"></a><tt class="py-lineno"> 485</tt> <tt class="py-line"> </tt>
<a name="RegexMatchList.append"></a><div id="RegexMatchList.append-def"><a name="L486"></a><tt class="py-lineno"> 486</tt> <a class="py-toggle" href="#" id="RegexMatchList.append-toggle" onclick="return toggle('RegexMatchList.append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexMatchList-class.html#append">append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexMatchList.append-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexMatchList.append-expanded"><a name="L487"></a><tt class="py-lineno"> 487</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L488"></a><tt class="py-lineno"> 488</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{append} method.</tt> </tt>
<a name="L489"></a><tt class="py-lineno"> 489</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is None</tt> </tt>
<a name="L490"></a><tt class="py-lineno"> 490</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is empty and empty values are not allowed</tt> </tt>
<a name="L491"></a><tt class="py-lineno"> 491</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item does not match the configured regular expression</tt> </tt>
<a name="L492"></a><tt class="py-lineno"> 492</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L493"></a><tt class="py-lineno"> 493</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">emptyAllowed</tt> <tt class="py-keyword">and</tt> <tt class="py-name">item</tt> <tt class="py-op">==</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L494"></a><tt class="py-lineno"> 494</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s cannot be empty."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">)</tt> </tt>
<a name="L495"></a><tt class="py-lineno"> 495</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pattern</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L496"></a><tt class="py-lineno"> 496</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s is not valid: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L497"></a><tt class="py-lineno"> 497</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-91', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L498"></a><tt class="py-lineno"> 498</tt> <tt class="py-line"> </tt>
<a name="RegexMatchList.insert"></a><div id="RegexMatchList.insert-def"><a name="L499"></a><tt class="py-lineno"> 499</tt> <a class="py-toggle" href="#" id="RegexMatchList.insert-toggle" onclick="return toggle('RegexMatchList.insert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexMatchList-class.html#insert">insert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexMatchList.insert-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexMatchList.insert-expanded"><a name="L500"></a><tt class="py-lineno"> 500</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L501"></a><tt class="py-lineno"> 501</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L502"></a><tt class="py-lineno"> 502</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is None</tt> </tt>
<a name="L503"></a><tt class="py-lineno"> 503</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is empty and empty values are not allowed</tt> </tt>
<a name="L504"></a><tt class="py-lineno"> 504</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item does not match the configured regular expression</tt> </tt>
<a name="L505"></a><tt class="py-lineno"> 505</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L506"></a><tt class="py-lineno"> 506</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">emptyAllowed</tt> <tt class="py-keyword">and</tt> <tt class="py-name">item</tt> <tt class="py-op">==</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L507"></a><tt class="py-lineno"> 507</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s cannot be empty."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">)</tt> </tt>
<a name="L508"></a><tt class="py-lineno"> 508</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pattern</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L509"></a><tt class="py-lineno"> 509</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s is not valid [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L510"></a><tt class="py-lineno"> 510</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-92', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-93" class="py-name"><a title="CedarBackup3.config.ExtendedAction.index" class="py-name" href="#" onclick="return doclink('link-93', 'index', 'link-73');">index</a></tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L511"></a><tt class="py-lineno"> 511</tt> <tt class="py-line"> </tt>
<a name="RegexMatchList.extend"></a><div id="RegexMatchList.extend-def"><a name="L512"></a><tt class="py-lineno"> 512</tt> <a class="py-toggle" href="#" id="RegexMatchList.extend-toggle" onclick="return toggle('RegexMatchList.extend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexMatchList-class.html#extend">extend</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexMatchList.extend-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexMatchList.extend-expanded"><a name="L513"></a><tt class="py-lineno"> 513</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L514"></a><tt class="py-lineno"> 514</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L515"></a><tt class="py-lineno"> 515</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If any item is None</tt> </tt>
<a name="L516"></a><tt class="py-lineno"> 516</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If any item is empty and empty values are not allowed</tt> </tt>
<a name="L517"></a><tt class="py-lineno"> 517</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If any item does not match the configured regular expression</tt> </tt>
<a name="L518"></a><tt class="py-lineno"> 518</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L519"></a><tt class="py-lineno"> 519</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L520"></a><tt class="py-lineno"> 520</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">item</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">emptyAllowed</tt> <tt class="py-keyword">and</tt> <tt class="py-name">item</tt> <tt class="py-op">==</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L521"></a><tt class="py-lineno"> 521</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s cannot be empty."</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">)</tt> </tt>
<a name="L522"></a><tt class="py-lineno"> 522</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">pattern</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L523"></a><tt class="py-lineno"> 523</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s is not valid: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L524"></a><tt class="py-lineno"> 524</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="CedarBackup3.extend
CedarBackup3.util.AbsolutePathList.extend
CedarBackup3.util.ObjectTypeList.extend
CedarBackup3.util.RegexList.extend
CedarBackup3.util.RegexMatchList.extend
CedarBackup3.util.RestrictedContentList.extend" class="py-name" href="#" onclick="return doclink('link-94', 'extend', 'link-82');">extend</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L525"></a><tt class="py-lineno"> 525</tt> <tt class="py-line"> </tt>
<a name="RegexList"></a><div id="RegexList-def"><a name="L526"></a><tt class="py-lineno"> 526</tt> <tt class="py-line"> </tt>
<a name="L527"></a><tt class="py-lineno"> 527</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L528"></a><tt class="py-lineno"> 528</tt> <tt class="py-line"><tt class="py-comment"># RegexList class definition</tt> </tt>
<a name="L529"></a><tt class="py-lineno"> 529</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L530"></a><tt class="py-lineno"> 530</tt> <tt class="py-line"> </tt>
<a name="L531"></a><tt class="py-lineno"> 531</tt> <a class="py-toggle" href="#" id="RegexList-toggle" onclick="return toggle('RegexList');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.RegexList-class.html">RegexList</a><tt class="py-op">(</tt><tt class="py-base-class">UnorderedList</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexList-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="RegexList-expanded"><a name="L532"></a><tt class="py-lineno"> 532</tt> <tt class="py-line"> </tt>
<a name="L533"></a><tt class="py-lineno"> 533</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L534"></a><tt class="py-lineno"> 534</tt> <tt class="py-line"><tt class="py-docstring"> Class representing a list of valid regular expression strings.</tt> </tt>
<a name="L535"></a><tt class="py-lineno"> 535</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L536"></a><tt class="py-lineno"> 536</tt> <tt class="py-line"><tt class="py-docstring"> This is an unordered list.</tt> </tt>
<a name="L537"></a><tt class="py-lineno"> 537</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L538"></a><tt class="py-lineno"> 538</tt> <tt class="py-line"><tt class="py-docstring"> We override the C{append}, C{insert} and C{extend} methods to ensure that</tt> </tt>
<a name="L539"></a><tt class="py-lineno"> 539</tt> <tt class="py-line"><tt class="py-docstring"> any item added to the list is a valid regular expression.</tt> </tt>
<a name="L540"></a><tt class="py-lineno"> 540</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L541"></a><tt class="py-lineno"> 541</tt> <tt class="py-line"> </tt>
<a name="RegexList.append"></a><div id="RegexList.append-def"><a name="L542"></a><tt class="py-lineno"> 542</tt> <a class="py-toggle" href="#" id="RegexList.append-toggle" onclick="return toggle('RegexList.append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexList-class.html#append">append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexList.append-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexList.append-expanded"><a name="L543"></a><tt class="py-lineno"> 543</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L544"></a><tt class="py-lineno"> 544</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{append} method.</tt> </tt>
<a name="L545"></a><tt class="py-lineno"> 545</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not an absolute path.</tt> </tt>
<a name="L546"></a><tt class="py-lineno"> 546</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L547"></a><tt class="py-lineno"> 547</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L548"></a><tt class="py-lineno"> 548</tt> <tt class="py-line"> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L549"></a><tt class="py-lineno"> 549</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">:</tt> </tt>
<a name="L550"></a><tt class="py-lineno"> 550</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not a valid regular expression: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L551"></a><tt class="py-lineno"> 551</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-95', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L552"></a><tt class="py-lineno"> 552</tt> <tt class="py-line"> </tt>
<a name="RegexList.insert"></a><div id="RegexList.insert-def"><a name="L553"></a><tt class="py-lineno"> 553</tt> <a class="py-toggle" href="#" id="RegexList.insert-toggle" onclick="return toggle('RegexList.insert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexList-class.html#insert">insert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexList.insert-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexList.insert-expanded"><a name="L554"></a><tt class="py-lineno"> 554</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L555"></a><tt class="py-lineno"> 555</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L556"></a><tt class="py-lineno"> 556</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If item is not an absolute path.</tt> </tt>
<a name="L557"></a><tt class="py-lineno"> 557</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L558"></a><tt class="py-lineno"> 558</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L559"></a><tt class="py-lineno"> 559</tt> <tt class="py-line"> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L560"></a><tt class="py-lineno"> 560</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">:</tt> </tt>
<a name="L561"></a><tt class="py-lineno"> 561</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not a valid regular expression: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L562"></a><tt class="py-lineno"> 562</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-96', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-97" class="py-name"><a title="CedarBackup3.config.ExtendedAction.index" class="py-name" href="#" onclick="return doclink('link-97', 'index', 'link-73');">index</a></tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div><a name="L563"></a><tt class="py-lineno"> 563</tt> <tt class="py-line"> </tt>
<a name="RegexList.extend"></a><div id="RegexList.extend-def"><a name="L564"></a><tt class="py-lineno"> 564</tt> <a class="py-toggle" href="#" id="RegexList.extend-toggle" onclick="return toggle('RegexList.extend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.RegexList-class.html#extend">extend</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RegexList.extend-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="RegexList.extend-expanded"><a name="L565"></a><tt class="py-lineno"> 565</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L566"></a><tt class="py-lineno"> 566</tt> <tt class="py-line"><tt class="py-docstring"> Overrides the standard C{insert} method.</tt> </tt>
<a name="L567"></a><tt class="py-lineno"> 567</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If any item is not an absolute path.</tt> </tt>
<a name="L568"></a><tt class="py-lineno"> 568</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L569"></a><tt class="py-lineno"> 569</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L570"></a><tt class="py-lineno"> 570</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L571"></a><tt class="py-lineno"> 571</tt> <tt class="py-line"> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L572"></a><tt class="py-lineno"> 572</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">:</tt> </tt>
<a name="L573"></a><tt class="py-lineno"> 573</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Not a valid regular expression: [%s]"</tt> <tt class="py-op">%</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L574"></a><tt class="py-lineno"> 574</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</tt><tt class="py-op">:</tt> </tt>
<a name="L575"></a><tt class="py-lineno"> 575</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-98" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-98', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L576"></a><tt class="py-lineno"> 576</tt> <tt class="py-line"> </tt>
<a name="_Vertex"></a><div id="_Vertex-def"><a name="L577"></a><tt class="py-lineno"> 577</tt> <tt class="py-line"> </tt>
<a name="L578"></a><tt class="py-lineno"> 578</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L579"></a><tt class="py-lineno"> 579</tt> <tt class="py-line"><tt class="py-comment"># Directed graph implementation</tt> </tt>
<a name="L580"></a><tt class="py-lineno"> 580</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L581"></a><tt class="py-lineno"> 581</tt> <tt class="py-line"> </tt>
<a name="L582"></a><tt class="py-lineno"> 582</tt> <a class="py-toggle" href="#" id="_Vertex-toggle" onclick="return toggle('_Vertex');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util._Vertex-class.html">_Vertex</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Vertex-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_Vertex-expanded"><a name="L583"></a><tt class="py-lineno"> 583</tt> <tt class="py-line"> </tt>
<a name="L584"></a><tt class="py-lineno"> 584</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L585"></a><tt class="py-lineno"> 585</tt> <tt class="py-line"><tt class="py-docstring"> Represents a vertex (or node) in a directed graph.</tt> </tt>
<a name="L586"></a><tt class="py-lineno"> 586</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L587"></a><tt class="py-lineno"> 587</tt> <tt class="py-line"> </tt>
<a name="_Vertex.__init__"></a><div id="_Vertex.__init__-def"><a name="L588"></a><tt class="py-lineno"> 588</tt> <a class="py-toggle" href="#" id="_Vertex.__init__-toggle" onclick="return toggle('_Vertex.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util._Vertex-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Vertex.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="_Vertex.__init__-expanded"><a name="L589"></a><tt class="py-lineno"> 589</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L590"></a><tt class="py-lineno"> 590</tt> <tt class="py-line"><tt class="py-docstring"> Constructor.</tt> </tt>
<a name="L591"></a><tt class="py-lineno"> 591</tt> <tt class="py-line"><tt class="py-docstring"> @param name: Name of this graph vertex.</tt> </tt>
<a name="L592"></a><tt class="py-lineno"> 592</tt> <tt class="py-line"><tt class="py-docstring"> @type name: String value.</tt> </tt>
<a name="L593"></a><tt class="py-lineno"> 593</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L594"></a><tt class="py-lineno"> 594</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-99" class="py-name" targets="Variable CedarBackup3.config.ExtendedAction.name=CedarBackup3.config.ExtendedAction-class.html#name,Variable CedarBackup3.config.LocalPeer.name=CedarBackup3.config.LocalPeer-class.html#name,Variable CedarBackup3.config.RemotePeer.name=CedarBackup3.config.RemotePeer-class.html#name,Variable CedarBackup3.peer.LocalPeer.name=CedarBackup3.peer.LocalPeer-class.html#name,Variable CedarBackup3.peer.RemotePeer.name=CedarBackup3.peer.RemotePeer-class.html#name,Variable CedarBackup3.util.DirectedGraph.name=CedarBackup3.util.DirectedGraph-class.html#name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-99', 'name', 'link-99');">name</a></tt> <tt class="py-op">=</tt> <tt id="link-100" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-100', 'name', 'link-99');">name</a></tt> </tt>
<a name="L595"></a><tt class="py-lineno"> 595</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">endpoints</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L596"></a><tt class="py-lineno"> 596</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
</div></div><a name="L597"></a><tt class="py-lineno"> 597</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph"></a><div id="DirectedGraph-def"><a name="L598"></a><tt class="py-lineno"> 598</tt> <tt class="py-line"><tt class="py-decorator">@</tt><tt class="py-decorator">total_ordering</tt> </tt>
<a name="L599"></a><tt class="py-lineno"> 599</tt> <a class="py-toggle" href="#" id="DirectedGraph-toggle" onclick="return toggle('DirectedGraph');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html">DirectedGraph</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="DirectedGraph-expanded"><a name="L600"></a><tt class="py-lineno"> 600</tt> <tt class="py-line"> </tt>
<a name="L601"></a><tt class="py-lineno"> 601</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L602"></a><tt class="py-lineno"> 602</tt> <tt class="py-line"><tt class="py-docstring"> Represents a directed graph.</tt> </tt>
<a name="L603"></a><tt class="py-lineno"> 603</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L604"></a><tt class="py-lineno"> 604</tt> <tt class="py-line"><tt class="py-docstring"> A graph B{G=(V,E)} consists of a set of vertices B{V} together with a set</tt> </tt>
<a name="L605"></a><tt class="py-lineno"> 605</tt> <tt class="py-line"><tt class="py-docstring"> B{E} of vertex pairs or edges. In a directed graph, each edge also has an</tt> </tt>
<a name="L606"></a><tt class="py-lineno"> 606</tt> <tt class="py-line"><tt class="py-docstring"> associated direction (from vertext B{v1} to vertex B{v2}). A C{DirectedGraph}</tt> </tt>
<a name="L607"></a><tt class="py-lineno"> 607</tt> <tt class="py-line"><tt class="py-docstring"> object provides a way to construct a directed graph and execute a depth-</tt> </tt>
<a name="L608"></a><tt class="py-lineno"> 608</tt> <tt class="py-line"><tt class="py-docstring"> first search.</tt> </tt>
<a name="L609"></a><tt class="py-lineno"> 609</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L610"></a><tt class="py-lineno"> 610</tt> <tt class="py-line"><tt class="py-docstring"> This data structure was designed based on the graphing chapter in</tt> </tt>
<a name="L611"></a><tt class="py-lineno"> 611</tt> <tt class="py-line"><tt class="py-docstring"> U{The Algorithm Design Manual<http://www2.toki.or.id/book/AlgDesignManual/>},</tt> </tt>
<a name="L612"></a><tt class="py-lineno"> 612</tt> <tt class="py-line"><tt class="py-docstring"> by Steven S. Skiena.</tt> </tt>
<a name="L613"></a><tt class="py-lineno"> 613</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L614"></a><tt class="py-lineno"> 614</tt> <tt class="py-line"><tt class="py-docstring"> This class is intended to be used by Cedar Backup for dependency ordering.</tt> </tt>
<a name="L615"></a><tt class="py-lineno"> 615</tt> <tt class="py-line"><tt class="py-docstring"> Because of this, it's not quite general-purpose. Unlike a "general" graph,</tt> </tt>
<a name="L616"></a><tt class="py-lineno"> 616</tt> <tt class="py-line"><tt class="py-docstring"> every vertex in this graph has at least one edge pointing to it, from a</tt> </tt>
<a name="L617"></a><tt class="py-lineno"> 617</tt> <tt class="py-line"><tt class="py-docstring"> special "start" vertex. This is so no vertices get "lost" either because</tt> </tt>
<a name="L618"></a><tt class="py-lineno"> 618</tt> <tt class="py-line"><tt class="py-docstring"> they have no dependencies or because nothing depends on them.</tt> </tt>
<a name="L619"></a><tt class="py-lineno"> 619</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L620"></a><tt class="py-lineno"> 620</tt> <tt class="py-line"> </tt>
<a name="L621"></a><tt class="py-lineno"> 621</tt> <tt class="py-line"> <tt id="link-101" class="py-name" targets="Variable CedarBackup3.util.DirectedGraph._UNDISCOVERED=CedarBackup3.util.DirectedGraph-class.html#_UNDISCOVERED"><a title="CedarBackup3.util.DirectedGraph._UNDISCOVERED" class="py-name" href="#" onclick="return doclink('link-101', '_UNDISCOVERED', 'link-101');">_UNDISCOVERED</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L622"></a><tt class="py-lineno"> 622</tt> <tt class="py-line"> <tt id="link-102" class="py-name" targets="Variable CedarBackup3.util.DirectedGraph._DISCOVERED=CedarBackup3.util.DirectedGraph-class.html#_DISCOVERED"><a title="CedarBackup3.util.DirectedGraph._DISCOVERED" class="py-name" href="#" onclick="return doclink('link-102', '_DISCOVERED', 'link-102');">_DISCOVERED</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L623"></a><tt class="py-lineno"> 623</tt> <tt class="py-line"> <tt id="link-103" class="py-name" targets="Variable CedarBackup3.util.DirectedGraph._EXPLORED=CedarBackup3.util.DirectedGraph-class.html#_EXPLORED"><a title="CedarBackup3.util.DirectedGraph._EXPLORED" class="py-name" href="#" onclick="return doclink('link-103', '_EXPLORED', 'link-103');">_EXPLORED</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L624"></a><tt class="py-lineno"> 624</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__init__"></a><div id="DirectedGraph.__init__-def"><a name="L625"></a><tt class="py-lineno"> 625</tt> <a class="py-toggle" href="#" id="DirectedGraph.__init__-toggle" onclick="return toggle('DirectedGraph.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__init__-expanded"><a name="L626"></a><tt class="py-lineno"> 626</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L627"></a><tt class="py-lineno"> 627</tt> <tt class="py-line"><tt class="py-docstring"> Directed graph constructor.</tt> </tt>
<a name="L628"></a><tt class="py-lineno"> 628</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L629"></a><tt class="py-lineno"> 629</tt> <tt class="py-line"><tt class="py-docstring"> @param name: Name of this graph.</tt> </tt>
<a name="L630"></a><tt class="py-lineno"> 630</tt> <tt class="py-line"><tt class="py-docstring"> @type name: String value.</tt> </tt>
<a name="L631"></a><tt class="py-lineno"> 631</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L632"></a><tt class="py-lineno"> 632</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-104" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-104', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt id="link-105" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-105', 'name', 'link-99');">name</a></tt> <tt class="py-op">==</tt> <tt class="py-string">""</tt><tt class="py-op">:</tt> </tt>
<a name="L633"></a><tt class="py-lineno"> 633</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Graph name must be non-empty."</tt><tt class="py-op">)</tt> </tt>
<a name="L634"></a><tt class="py-lineno"> 634</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_name</tt> <tt class="py-op">=</tt> <tt id="link-106" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-106', 'name', 'link-99');">name</a></tt> </tt>
<a name="L635"></a><tt class="py-lineno"> 635</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L636"></a><tt class="py-lineno"> 636</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_startVertex</tt> <tt class="py-op">=</tt> <tt id="link-107" class="py-name" targets="Class CedarBackup3.util._Vertex=CedarBackup3.util._Vertex-class.html"><a title="CedarBackup3.util._Vertex" class="py-name" href="#" onclick="return doclink('link-107', '_Vertex', 'link-107');">_Vertex</a></tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt> <tt class="py-comment"># start vertex is only vertex with no name</tt> </tt>
</div><a name="L637"></a><tt class="py-lineno"> 637</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__repr__"></a><div id="DirectedGraph.__repr__-def"><a name="L638"></a><tt class="py-lineno"> 638</tt> <a class="py-toggle" href="#" id="DirectedGraph.__repr__-toggle" onclick="return toggle('DirectedGraph.__repr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__repr__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__repr__-expanded"><a name="L639"></a><tt class="py-lineno"> 639</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L640"></a><tt class="py-lineno"> 640</tt> <tt class="py-line"><tt class="py-docstring"> Official string representation for class instance.</tt> </tt>
<a name="L641"></a><tt class="py-lineno"> 641</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L642"></a><tt class="py-lineno"> 642</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"DirectedGraph(%s)"</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-108" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-108', 'name', 'link-99');">name</a></tt> </tt>
</div><a name="L643"></a><tt class="py-lineno"> 643</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__str__"></a><div id="DirectedGraph.__str__-def"><a name="L644"></a><tt class="py-lineno"> 644</tt> <a class="py-toggle" href="#" id="DirectedGraph.__str__-toggle" onclick="return toggle('DirectedGraph.__str__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__str__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__str__-expanded"><a name="L645"></a><tt class="py-lineno"> 645</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L646"></a><tt class="py-lineno"> 646</tt> <tt class="py-line"><tt class="py-docstring"> Informal string representation for class instance.</tt> </tt>
<a name="L647"></a><tt class="py-lineno"> 647</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L648"></a><tt class="py-lineno"> 648</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-109" class="py-name" targets="Method CedarBackup3.cli.Options.__repr__()=CedarBackup3.cli.Options-class.html#__repr__,Method CedarBackup3.config.ActionDependencies.__repr__()=CedarBackup3.config.ActionDependencies-class.html#__repr__,Method CedarBackup3.config.ActionHook.__repr__()=CedarBackup3.config.ActionHook-class.html#__repr__,Method CedarBackup3.config.BlankBehavior.__repr__()=CedarBackup3.config.BlankBehavior-class.html#__repr__,Method CedarBackup3.config.ByteQuantity.__repr__()=CedarBackup3.config.ByteQuantity-class.html#__repr__,Method CedarBackup3.config.CollectConfig.__repr__()=CedarBackup3.config.CollectConfig-class.html#__repr__,Method CedarBackup3.config.CollectDir.__repr__()=CedarBackup3.config.CollectDir-class.html#__repr__,Method CedarBackup3.config.CollectFile.__repr__()=CedarBackup3.config.CollectFile-class.html#__repr__,Method CedarBackup3.config.CommandOverride.__repr__()=CedarBackup3.config.CommandOverride-class.html#__repr__,Method CedarBackup3.config.Config.__repr__()=CedarBackup3.config.Config-class.html#__repr__,Method CedarBackup3.config.ExtendedAction.__repr__()=CedarBackup3.config.ExtendedAction-class.html#__repr__,Method CedarBackup3.config.ExtensionsConfig.__repr__()=CedarBackup3.config.ExtensionsConfig-class.html#__repr__,Method CedarBackup3.config.LocalPeer.__repr__()=CedarBackup3.config.LocalPeer-class.html#__repr__,Method CedarBackup3.config.OptionsConfig.__repr__()=CedarBackup3.config.OptionsConfig-class.html#__repr__,Method CedarBackup3.config.PeersConfig.__repr__()=CedarBackup3.config.PeersConfig-class.html#__repr__,Method CedarBackup3.config.PostActionHook.__repr__()=CedarBackup3.config.PostActionHook-class.html#__repr__,Method CedarBackup3.config.PreActionHook.__repr__()=CedarBackup3.config.PreActionHook-class.html#__repr__,Method CedarBackup3.config.PurgeConfig.__repr__()=CedarBackup3.config.PurgeConfig-class.html#__repr__,Method CedarBackup3.config.PurgeDir.__repr__()=CedarBackup3.config.PurgeDir-class.html#__repr__,Method CedarBackup3.config.ReferenceConfig.__repr__()=CedarBackup3.config.ReferenceConfig-class.html#__repr__,Method CedarBackup3.config.RemotePeer.__repr__()=CedarBackup3.config.RemotePeer-class.html#__repr__,Method CedarBackup3.config.StageConfig.__repr__()=CedarBackup3.config.StageConfig-class.html#__repr__,Method CedarBackup3.config.StoreConfig.__repr__()=CedarBackup3.config.StoreConfig-class.html#__repr__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__repr__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__repr__,Method CedarBackup3.extend.amazons3.LocalConfig.__repr__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.capacity.CapacityConfig.__repr__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__repr__,Method CedarBackup3.extend.capacity.LocalConfig.__repr__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.capacity.PercentageQuantity.__repr__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__repr__,Method CedarBackup3.extend.encrypt.EncryptConfig.__repr__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__repr__,Method CedarBackup3.extend.encrypt.LocalConfig.__repr__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.mbox.LocalConfig.__repr__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.mbox.MboxConfig.__repr__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__repr__,Method CedarBackup3.extend.mbox.MboxDir.__repr__()=CedarBackup3.extend.mbox.MboxDir-class.html#__repr__,Method CedarBackup3.extend.mbox.MboxFile.__repr__()=CedarBackup3.extend.mbox.MboxFile-class.html#__repr__,Method CedarBackup3.extend.mysql.LocalConfig.__repr__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.mysql.MysqlConfig.__repr__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__repr__,Method CedarBackup3.extend.postgresql.LocalConfig.__repr__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__repr__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__repr__,Method CedarBackup3.extend.split.LocalConfig.__repr__()=CedarBackup3.extend.split.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.split.SplitConfig.__repr__()=CedarBackup3.extend.split.SplitConfig-class.html#__repr__,Method CedarBackup3.extend.subversion.BDBRepository.__repr__()=CedarBackup3.extend.subversion.BDBRepository-class.html#__repr__,Method CedarBackup3.extend.subversion.FSFSRepository.__repr__()=CedarBackup3.extend.subversion.FSFSRepository-class.html#__repr__,Method CedarBackup3.extend.subversion.LocalConfig.__repr__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__repr__,Method CedarBackup3.extend.subversion.Repository.__repr__()=CedarBackup3.extend.subversion.Repository-class.html#__repr__,Method CedarBackup3.extend.subversion.RepositoryDir.__repr__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__repr__,Method CedarBackup3.extend.subversion.SubversionConfig.__repr__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__repr__,Method CedarBackup3.tools.amazons3.Options.__repr__()=CedarBackup3.tools.amazons3.Options-class.html#__repr__,Method CedarBackup3.util.Diagnostics.__repr__()=CedarBackup3.util.Diagnostics-class.html#__repr__,Method CedarBackup3.util.DirectedGraph.__repr__()=CedarBackup3.util.DirectedGraph-class.html#__repr__"><a title="CedarBackup3.cli.Options.__repr__
CedarBackup3.config.ActionDependencies.__repr__
CedarBackup3.config.ActionHook.__repr__
CedarBackup3.config.BlankBehavior.__repr__
CedarBackup3.config.ByteQuantity.__repr__
CedarBackup3.config.CollectConfig.__repr__
CedarBackup3.config.CollectDir.__repr__
CedarBackup3.config.CollectFile.__repr__
CedarBackup3.config.CommandOverride.__repr__
CedarBackup3.config.Config.__repr__
CedarBackup3.config.ExtendedAction.__repr__
CedarBackup3.config.ExtensionsConfig.__repr__
CedarBackup3.config.LocalPeer.__repr__
CedarBackup3.config.OptionsConfig.__repr__
CedarBackup3.config.PeersConfig.__repr__
CedarBackup3.config.PostActionHook.__repr__
CedarBackup3.config.PreActionHook.__repr__
CedarBackup3.config.PurgeConfig.__repr__
CedarBackup3.config.PurgeDir.__repr__
CedarBackup3.config.ReferenceConfig.__repr__
CedarBackup3.config.RemotePeer.__repr__
CedarBackup3.config.StageConfig.__repr__
CedarBackup3.config.StoreConfig.__repr__
CedarBackup3.extend.amazons3.AmazonS3Config.__repr__
CedarBackup3.extend.amazons3.LocalConfig.__repr__
CedarBackup3.extend.capacity.CapacityConfig.__repr__
CedarBackup3.extend.capacity.LocalConfig.__repr__
CedarBackup3.extend.capacity.PercentageQuantity.__repr__
CedarBackup3.extend.encrypt.EncryptConfig.__repr__
CedarBackup3.extend.encrypt.LocalConfig.__repr__
CedarBackup3.extend.mbox.LocalConfig.__repr__
CedarBackup3.extend.mbox.MboxConfig.__repr__
CedarBackup3.extend.mbox.MboxDir.__repr__
CedarBackup3.extend.mbox.MboxFile.__repr__
CedarBackup3.extend.mysql.LocalConfig.__repr__
CedarBackup3.extend.mysql.MysqlConfig.__repr__
CedarBackup3.extend.postgresql.LocalConfig.__repr__
CedarBackup3.extend.postgresql.PostgresqlConfig.__repr__
CedarBackup3.extend.split.LocalConfig.__repr__
CedarBackup3.extend.split.SplitConfig.__repr__
CedarBackup3.extend.subversion.BDBRepository.__repr__
CedarBackup3.extend.subversion.FSFSRepository.__repr__
CedarBackup3.extend.subversion.LocalConfig.__repr__
CedarBackup3.extend.subversion.Repository.__repr__
CedarBackup3.extend.subversion.RepositoryDir.__repr__
CedarBackup3.extend.subversion.SubversionConfig.__repr__
CedarBackup3.tools.amazons3.Options.__repr__
CedarBackup3.util.Diagnostics.__repr__
CedarBackup3.util.DirectedGraph.__repr__" class="py-name" href="#" onclick="return doclink('link-109', '__repr__', 'link-109');">__repr__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L649"></a><tt class="py-lineno"> 649</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__eq__"></a><div id="DirectedGraph.__eq__-def"><a name="L650"></a><tt class="py-lineno"> 650</tt> <a class="py-toggle" href="#" id="DirectedGraph.__eq__-toggle" onclick="return toggle('DirectedGraph.__eq__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__eq__">__eq__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__eq__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__eq__-expanded"><a name="L651"></a><tt class="py-lineno"> 651</tt> <tt class="py-line"> <tt class="py-docstring">"""Equals operator, implemented in terms of original Python 2 compare operator."""</tt> </tt>
<a name="L652"></a><tt class="py-lineno"> 652</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-110" class="py-name" targets="Method CedarBackup3.cli.Options.__cmp__()=CedarBackup3.cli.Options-class.html#__cmp__,Method CedarBackup3.cli._ActionItem.__cmp__()=CedarBackup3.cli._ActionItem-class.html#__cmp__,Method CedarBackup3.cli._ManagedActionItem.__cmp__()=CedarBackup3.cli._ManagedActionItem-class.html#__cmp__,Method CedarBackup3.config.ActionDependencies.__cmp__()=CedarBackup3.config.ActionDependencies-class.html#__cmp__,Method CedarBackup3.config.ActionHook.__cmp__()=CedarBackup3.config.ActionHook-class.html#__cmp__,Method CedarBackup3.config.BlankBehavior.__cmp__()=CedarBackup3.config.BlankBehavior-class.html#__cmp__,Method CedarBackup3.config.ByteQuantity.__cmp__()=CedarBackup3.config.ByteQuantity-class.html#__cmp__,Method CedarBackup3.config.CollectConfig.__cmp__()=CedarBackup3.config.CollectConfig-class.html#__cmp__,Method CedarBackup3.config.CollectDir.__cmp__()=CedarBackup3.config.CollectDir-class.html#__cmp__,Method CedarBackup3.config.CollectFile.__cmp__()=CedarBackup3.config.CollectFile-class.html#__cmp__,Method CedarBackup3.config.CommandOverride.__cmp__()=CedarBackup3.config.CommandOverride-class.html#__cmp__,Method CedarBackup3.config.Config.__cmp__()=CedarBackup3.config.Config-class.html#__cmp__,Method CedarBackup3.config.ExtendedAction.__cmp__()=CedarBackup3.config.ExtendedAction-class.html#__cmp__,Method CedarBackup3.config.ExtensionsConfig.__cmp__()=CedarBackup3.config.ExtensionsConfig-class.html#__cmp__,Method CedarBackup3.config.LocalPeer.__cmp__()=CedarBackup3.config.LocalPeer-class.html#__cmp__,Method CedarBackup3.config.OptionsConfig.__cmp__()=CedarBackup3.config.OptionsConfig-class.html#__cmp__,Method CedarBackup3.config.PeersConfig.__cmp__()=CedarBackup3.config.PeersConfig-class.html#__cmp__,Method CedarBackup3.config.PurgeConfig.__cmp__()=CedarBackup3.config.PurgeConfig-class.html#__cmp__,Method CedarBackup3.config.PurgeDir.__cmp__()=CedarBackup3.config.PurgeDir-class.html#__cmp__,Method CedarBackup3.config.ReferenceConfig.__cmp__()=CedarBackup3.config.ReferenceConfig-class.html#__cmp__,Method CedarBackup3.config.RemotePeer.__cmp__()=CedarBackup3.config.RemotePeer-class.html#__cmp__,Method CedarBackup3.config.StageConfig.__cmp__()=CedarBackup3.config.StageConfig-class.html#__cmp__,Method CedarBackup3.config.StoreConfig.__cmp__()=CedarBackup3.config.StoreConfig-class.html#__cmp__,Method CedarBackup3.extend.amazons3.AmazonS3Config.__cmp__()=CedarBackup3.extend.amazons3.AmazonS3Config-class.html#__cmp__,Method CedarBackup3.extend.amazons3.LocalConfig.__cmp__()=CedarBackup3.extend.amazons3.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.capacity.CapacityConfig.__cmp__()=CedarBackup3.extend.capacity.CapacityConfig-class.html#__cmp__,Method CedarBackup3.extend.capacity.LocalConfig.__cmp__()=CedarBackup3.extend.capacity.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.capacity.PercentageQuantity.__cmp__()=CedarBackup3.extend.capacity.PercentageQuantity-class.html#__cmp__,Method CedarBackup3.extend.encrypt.EncryptConfig.__cmp__()=CedarBackup3.extend.encrypt.EncryptConfig-class.html#__cmp__,Method CedarBackup3.extend.encrypt.LocalConfig.__cmp__()=CedarBackup3.extend.encrypt.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.mbox.LocalConfig.__cmp__()=CedarBackup3.extend.mbox.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.mbox.MboxConfig.__cmp__()=CedarBackup3.extend.mbox.MboxConfig-class.html#__cmp__,Method CedarBackup3.extend.mbox.MboxDir.__cmp__()=CedarBackup3.extend.mbox.MboxDir-class.html#__cmp__,Method CedarBackup3.extend.mbox.MboxFile.__cmp__()=CedarBackup3.extend.mbox.MboxFile-class.html#__cmp__,Method CedarBackup3.extend.mysql.LocalConfig.__cmp__()=CedarBackup3.extend.mysql.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.mysql.MysqlConfig.__cmp__()=CedarBackup3.extend.mysql.MysqlConfig-class.html#__cmp__,Method CedarBackup3.extend.postgresql.LocalConfig.__cmp__()=CedarBackup3.extend.postgresql.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.postgresql.PostgresqlConfig.__cmp__()=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#__cmp__,Method CedarBackup3.extend.split.LocalConfig.__cmp__()=CedarBackup3.extend.split.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.split.SplitConfig.__cmp__()=CedarBackup3.extend.split.SplitConfig-class.html#__cmp__,Method CedarBackup3.extend.subversion.LocalConfig.__cmp__()=CedarBackup3.extend.subversion.LocalConfig-class.html#__cmp__,Method CedarBackup3.extend.subversion.Repository.__cmp__()=CedarBackup3.extend.subversion.Repository-class.html#__cmp__,Method CedarBackup3.extend.subversion.RepositoryDir.__cmp__()=CedarBackup3.extend.subversion.RepositoryDir-class.html#__cmp__,Method CedarBackup3.extend.subversion.SubversionConfig.__cmp__()=CedarBackup3.extend.subversion.SubversionConfig-class.html#__cmp__,Method CedarBackup3.tools.amazons3.Options.__cmp__()=CedarBackup3.tools.amazons3.Options-class.html#__cmp__,Method CedarBackup3.util.DirectedGraph.__cmp__()=CedarBackup3.util.DirectedGraph-class.html#__cmp__"><a title="CedarBackup3.cli.Options.__cmp__
CedarBackup3.cli._ActionItem.__cmp__
CedarBackup3.cli._ManagedActionItem.__cmp__
CedarBackup3.config.ActionDependencies.__cmp__
CedarBackup3.config.ActionHook.__cmp__
CedarBackup3.config.BlankBehavior.__cmp__
CedarBackup3.config.ByteQuantity.__cmp__
CedarBackup3.config.CollectConfig.__cmp__
CedarBackup3.config.CollectDir.__cmp__
CedarBackup3.config.CollectFile.__cmp__
CedarBackup3.config.CommandOverride.__cmp__
CedarBackup3.config.Config.__cmp__
CedarBackup3.config.ExtendedAction.__cmp__
CedarBackup3.config.ExtensionsConfig.__cmp__
CedarBackup3.config.LocalPeer.__cmp__
CedarBackup3.config.OptionsConfig.__cmp__
CedarBackup3.config.PeersConfig.__cmp__
CedarBackup3.config.PurgeConfig.__cmp__
CedarBackup3.config.PurgeDir.__cmp__
CedarBackup3.config.ReferenceConfig.__cmp__
CedarBackup3.config.RemotePeer.__cmp__
CedarBackup3.config.StageConfig.__cmp__
CedarBackup3.config.StoreConfig.__cmp__
CedarBackup3.extend.amazons3.AmazonS3Config.__cmp__
CedarBackup3.extend.amazons3.LocalConfig.__cmp__
CedarBackup3.extend.capacity.CapacityConfig.__cmp__
CedarBackup3.extend.capacity.LocalConfig.__cmp__
CedarBackup3.extend.capacity.PercentageQuantity.__cmp__
CedarBackup3.extend.encrypt.EncryptConfig.__cmp__
CedarBackup3.extend.encrypt.LocalConfig.__cmp__
CedarBackup3.extend.mbox.LocalConfig.__cmp__
CedarBackup3.extend.mbox.MboxConfig.__cmp__
CedarBackup3.extend.mbox.MboxDir.__cmp__
CedarBackup3.extend.mbox.MboxFile.__cmp__
CedarBackup3.extend.mysql.LocalConfig.__cmp__
CedarBackup3.extend.mysql.MysqlConfig.__cmp__
CedarBackup3.extend.postgresql.LocalConfig.__cmp__
CedarBackup3.extend.postgresql.PostgresqlConfig.__cmp__
CedarBackup3.extend.split.LocalConfig.__cmp__
CedarBackup3.extend.split.SplitConfig.__cmp__
CedarBackup3.extend.subversion.LocalConfig.__cmp__
CedarBackup3.extend.subversion.Repository.__cmp__
CedarBackup3.extend.subversion.RepositoryDir.__cmp__
CedarBackup3.extend.subversion.SubversionConfig.__cmp__
CedarBackup3.tools.amazons3.Options.__cmp__
CedarBackup3.util.DirectedGraph.__cmp__" class="py-name" href="#" onclick="return doclink('link-110', '__cmp__', 'link-110');">__cmp__</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L653"></a><tt class="py-lineno"> 653</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__lt__"></a><div id="DirectedGraph.__lt__-def"><a name="L654"></a><tt class="py-lineno"> 654</tt> <a class="py-toggle" href="#" id="DirectedGraph.__lt__-toggle" onclick="return toggle('DirectedGraph.__lt__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__lt__">__lt__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__lt__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__lt__-expanded"><a name="L655"></a><tt class="py-lineno"> 655</tt> <tt class="py-line"> <tt class="py-docstring">"""Less-than operator, implemented in terms of original Python 2 compare operator."""</tt> </tt>
<a name="L656"></a><tt class="py-lineno"> 656</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-111" class="py-name"><a title="CedarBackup3.cli.Options.__cmp__
CedarBackup3.cli._ActionItem.__cmp__
CedarBackup3.cli._ManagedActionItem.__cmp__
CedarBackup3.config.ActionDependencies.__cmp__
CedarBackup3.config.ActionHook.__cmp__
CedarBackup3.config.BlankBehavior.__cmp__
CedarBackup3.config.ByteQuantity.__cmp__
CedarBackup3.config.CollectConfig.__cmp__
CedarBackup3.config.CollectDir.__cmp__
CedarBackup3.config.CollectFile.__cmp__
CedarBackup3.config.CommandOverride.__cmp__
CedarBackup3.config.Config.__cmp__
CedarBackup3.config.ExtendedAction.__cmp__
CedarBackup3.config.ExtensionsConfig.__cmp__
CedarBackup3.config.LocalPeer.__cmp__
CedarBackup3.config.OptionsConfig.__cmp__
CedarBackup3.config.PeersConfig.__cmp__
CedarBackup3.config.PurgeConfig.__cmp__
CedarBackup3.config.PurgeDir.__cmp__
CedarBackup3.config.ReferenceConfig.__cmp__
CedarBackup3.config.RemotePeer.__cmp__
CedarBackup3.config.StageConfig.__cmp__
CedarBackup3.config.StoreConfig.__cmp__
CedarBackup3.extend.amazons3.AmazonS3Config.__cmp__
CedarBackup3.extend.amazons3.LocalConfig.__cmp__
CedarBackup3.extend.capacity.CapacityConfig.__cmp__
CedarBackup3.extend.capacity.LocalConfig.__cmp__
CedarBackup3.extend.capacity.PercentageQuantity.__cmp__
CedarBackup3.extend.encrypt.EncryptConfig.__cmp__
CedarBackup3.extend.encrypt.LocalConfig.__cmp__
CedarBackup3.extend.mbox.LocalConfig.__cmp__
CedarBackup3.extend.mbox.MboxConfig.__cmp__
CedarBackup3.extend.mbox.MboxDir.__cmp__
CedarBackup3.extend.mbox.MboxFile.__cmp__
CedarBackup3.extend.mysql.LocalConfig.__cmp__
CedarBackup3.extend.mysql.MysqlConfig.__cmp__
CedarBackup3.extend.postgresql.LocalConfig.__cmp__
CedarBackup3.extend.postgresql.PostgresqlConfig.__cmp__
CedarBackup3.extend.split.LocalConfig.__cmp__
CedarBackup3.extend.split.SplitConfig.__cmp__
CedarBackup3.extend.subversion.LocalConfig.__cmp__
CedarBackup3.extend.subversion.Repository.__cmp__
CedarBackup3.extend.subversion.RepositoryDir.__cmp__
CedarBackup3.extend.subversion.SubversionConfig.__cmp__
CedarBackup3.tools.amazons3.Options.__cmp__
CedarBackup3.util.DirectedGraph.__cmp__" class="py-name" href="#" onclick="return doclink('link-111', '__cmp__', 'link-110');">__cmp__</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L657"></a><tt class="py-lineno"> 657</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__gt__"></a><div id="DirectedGraph.__gt__-def"><a name="L658"></a><tt class="py-lineno"> 658</tt> <a class="py-toggle" href="#" id="DirectedGraph.__gt__-toggle" onclick="return toggle('DirectedGraph.__gt__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__gt__">__gt__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__gt__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__gt__-expanded"><a name="L659"></a><tt class="py-lineno"> 659</tt> <tt class="py-line"> <tt class="py-docstring">"""Greater-than operator, implemented in terms of original Python 2 compare operator."""</tt> </tt>
<a name="L660"></a><tt class="py-lineno"> 660</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-112" class="py-name"><a title="CedarBackup3.cli.Options.__cmp__
CedarBackup3.cli._ActionItem.__cmp__
CedarBackup3.cli._ManagedActionItem.__cmp__
CedarBackup3.config.ActionDependencies.__cmp__
CedarBackup3.config.ActionHook.__cmp__
CedarBackup3.config.BlankBehavior.__cmp__
CedarBackup3.config.ByteQuantity.__cmp__
CedarBackup3.config.CollectConfig.__cmp__
CedarBackup3.config.CollectDir.__cmp__
CedarBackup3.config.CollectFile.__cmp__
CedarBackup3.config.CommandOverride.__cmp__
CedarBackup3.config.Config.__cmp__
CedarBackup3.config.ExtendedAction.__cmp__
CedarBackup3.config.ExtensionsConfig.__cmp__
CedarBackup3.config.LocalPeer.__cmp__
CedarBackup3.config.OptionsConfig.__cmp__
CedarBackup3.config.PeersConfig.__cmp__
CedarBackup3.config.PurgeConfig.__cmp__
CedarBackup3.config.PurgeDir.__cmp__
CedarBackup3.config.ReferenceConfig.__cmp__
CedarBackup3.config.RemotePeer.__cmp__
CedarBackup3.config.StageConfig.__cmp__
CedarBackup3.config.StoreConfig.__cmp__
CedarBackup3.extend.amazons3.AmazonS3Config.__cmp__
CedarBackup3.extend.amazons3.LocalConfig.__cmp__
CedarBackup3.extend.capacity.CapacityConfig.__cmp__
CedarBackup3.extend.capacity.LocalConfig.__cmp__
CedarBackup3.extend.capacity.PercentageQuantity.__cmp__
CedarBackup3.extend.encrypt.EncryptConfig.__cmp__
CedarBackup3.extend.encrypt.LocalConfig.__cmp__
CedarBackup3.extend.mbox.LocalConfig.__cmp__
CedarBackup3.extend.mbox.MboxConfig.__cmp__
CedarBackup3.extend.mbox.MboxDir.__cmp__
CedarBackup3.extend.mbox.MboxFile.__cmp__
CedarBackup3.extend.mysql.LocalConfig.__cmp__
CedarBackup3.extend.mysql.MysqlConfig.__cmp__
CedarBackup3.extend.postgresql.LocalConfig.__cmp__
CedarBackup3.extend.postgresql.PostgresqlConfig.__cmp__
CedarBackup3.extend.split.LocalConfig.__cmp__
CedarBackup3.extend.split.SplitConfig.__cmp__
CedarBackup3.extend.subversion.LocalConfig.__cmp__
CedarBackup3.extend.subversion.Repository.__cmp__
CedarBackup3.extend.subversion.RepositoryDir.__cmp__
CedarBackup3.extend.subversion.SubversionConfig.__cmp__
CedarBackup3.tools.amazons3.Options.__cmp__
CedarBackup3.util.DirectedGraph.__cmp__" class="py-name" href="#" onclick="return doclink('link-112', '__cmp__', 'link-110');">__cmp__</a></tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">)</tt> <tt class="py-op">></tt> <tt class="py-number">0</tt> </tt>
</div><a name="L661"></a><tt class="py-lineno"> 661</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.__cmp__"></a><div id="DirectedGraph.__cmp__-def"><a name="L662"></a><tt class="py-lineno"> 662</tt> <a class="py-toggle" href="#" id="DirectedGraph.__cmp__-toggle" onclick="return toggle('DirectedGraph.__cmp__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#__cmp__">__cmp__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.__cmp__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.__cmp__-expanded"><a name="L663"></a><tt class="py-lineno"> 663</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L664"></a><tt class="py-lineno"> 664</tt> <tt class="py-line"><tt class="py-docstring"> Original Python 2 comparison operator.</tt> </tt>
<a name="L665"></a><tt class="py-lineno"> 665</tt> <tt class="py-line"><tt class="py-docstring"> @param other: Other object to compare to.</tt> </tt>
<a name="L666"></a><tt class="py-lineno"> 666</tt> <tt class="py-line"><tt class="py-docstring"> @return: -1/0/1 depending on whether self is C{<}, C{=} or C{>} other.</tt> </tt>
<a name="L667"></a><tt class="py-lineno"> 667</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L668"></a><tt class="py-lineno"> 668</tt> <tt class="py-line"> <tt class="py-comment"># pylint: disable=W0212</tt> </tt>
<a name="L669"></a><tt class="py-lineno"> 669</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L670"></a><tt class="py-lineno"> 670</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
<a name="L671"></a><tt class="py-lineno"> 671</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-113" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-113', 'name', 'link-99');">name</a></tt> <tt class="py-op">!=</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-114', 'name', 'link-99');">name</a></tt><tt class="py-op">:</tt> </tt>
<a name="L672"></a><tt class="py-lineno"> 672</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-115', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">other</tt><tt class="py-op">.</tt><tt id="link-116" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-116', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L673"></a><tt class="py-lineno"> 673</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
<a name="L674"></a><tt class="py-lineno"> 674</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L675"></a><tt class="py-lineno"> 675</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
<a name="L676"></a><tt class="py-lineno"> 676</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt> <tt class="py-op">!=</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">:</tt> </tt>
<a name="L677"></a><tt class="py-lineno"> 677</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt> <tt class="py-op"><</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">:</tt> </tt>
<a name="L678"></a><tt class="py-lineno"> 678</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
<a name="L679"></a><tt class="py-lineno"> 679</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L680"></a><tt class="py-lineno"> 680</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
<a name="L681"></a><tt class="py-lineno"> 681</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L682"></a><tt class="py-lineno"> 682</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph._getName"></a><div id="DirectedGraph._getName-def"><a name="L683"></a><tt class="py-lineno"> 683</tt> <a class="py-toggle" href="#" id="DirectedGraph._getName-toggle" onclick="return toggle('DirectedGraph._getName');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#_getName">_getName</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph._getName-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph._getName-expanded"><a name="L684"></a><tt class="py-lineno"> 684</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L685"></a><tt class="py-lineno"> 685</tt> <tt class="py-line"><tt class="py-docstring"> Property target used to get the graph name.</tt> </tt>
<a name="L686"></a><tt class="py-lineno"> 686</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L687"></a><tt class="py-lineno"> 687</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_name</tt> </tt>
</div><a name="L688"></a><tt class="py-lineno"> 688</tt> <tt class="py-line"> </tt>
<a name="L689"></a><tt class="py-lineno"> 689</tt> <tt class="py-line"> <tt id="link-117" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-117', 'name', 'link-99');">name</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-118" class="py-name" targets="Method CedarBackup3.config.ExtendedAction._getName()=CedarBackup3.config.ExtendedAction-class.html#_getName,Method CedarBackup3.config.LocalPeer._getName()=CedarBackup3.config.LocalPeer-class.html#_getName,Method CedarBackup3.config.RemotePeer._getName()=CedarBackup3.config.RemotePeer-class.html#_getName,Method CedarBackup3.peer.LocalPeer._getName()=CedarBackup3.peer.LocalPeer-class.html#_getName,Method CedarBackup3.peer.RemotePeer._getName()=CedarBackup3.peer.RemotePeer-class.html#_getName,Method CedarBackup3.util.DirectedGraph._getName()=CedarBackup3.util.DirectedGraph-class.html#_getName"><a title="CedarBackup3.config.ExtendedAction._getName
CedarBackup3.config.LocalPeer._getName
CedarBackup3.config.RemotePeer._getName
CedarBackup3.peer.LocalPeer._getName
CedarBackup3.peer.RemotePeer._getName
CedarBackup3.util.DirectedGraph._getName" class="py-name" href="#" onclick="return doclink('link-118', '_getName', 'link-118');">_getName</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Name of the graph."</tt><tt class="py-op">)</tt> </tt>
<a name="L690"></a><tt class="py-lineno"> 690</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.createVertex"></a><div id="DirectedGraph.createVertex-def"><a name="L691"></a><tt class="py-lineno"> 691</tt> <a class="py-toggle" href="#" id="DirectedGraph.createVertex-toggle" onclick="return toggle('DirectedGraph.createVertex');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#createVertex">createVertex</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.createVertex-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.createVertex-expanded"><a name="L692"></a><tt class="py-lineno"> 692</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L693"></a><tt class="py-lineno"> 693</tt> <tt class="py-line"><tt class="py-docstring"> Creates a named vertex.</tt> </tt>
<a name="L694"></a><tt class="py-lineno"> 694</tt> <tt class="py-line"><tt class="py-docstring"> @param name: vertex name</tt> </tt>
<a name="L695"></a><tt class="py-lineno"> 695</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the vertex name is C{None} or empty.</tt> </tt>
<a name="L696"></a><tt class="py-lineno"> 696</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L697"></a><tt class="py-lineno"> 697</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-119" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-119', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt id="link-120" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-120', 'name', 'link-99');">name</a></tt> <tt class="py-op">==</tt> <tt class="py-string">""</tt><tt class="py-op">:</tt> </tt>
<a name="L698"></a><tt class="py-lineno"> 698</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Vertex name must be non-empty."</tt><tt class="py-op">)</tt> </tt>
<a name="L699"></a><tt class="py-lineno"> 699</tt> <tt class="py-line"> <tt class="py-name">vertex</tt> <tt class="py-op">=</tt> <tt id="link-121" class="py-name"><a title="CedarBackup3.util._Vertex" class="py-name" href="#" onclick="return doclink('link-121', '_Vertex', 'link-107');">_Vertex</a></tt><tt class="py-op">(</tt><tt id="link-122" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-122', 'name', 'link-99');">name</a></tt><tt class="py-op">)</tt> </tt>
<a name="L700"></a><tt class="py-lineno"> 700</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_startVertex</tt><tt class="py-op">.</tt><tt class="py-name">endpoints</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-123', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">vertex</tt><tt class="py-op">)</tt> <tt class="py-comment"># so every vertex is connected at least once</tt> </tt>
<a name="L701"></a><tt class="py-lineno"> 701</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">[</tt><tt id="link-124" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-124', 'name', 'link-99');">name</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">vertex</tt> </tt>
</div><a name="L702"></a><tt class="py-lineno"> 702</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.createEdge"></a><div id="DirectedGraph.createEdge-def"><a name="L703"></a><tt class="py-lineno"> 703</tt> <a class="py-toggle" href="#" id="DirectedGraph.createEdge-toggle" onclick="return toggle('DirectedGraph.createEdge');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#createEdge">createEdge</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">start</tt><tt class="py-op">,</tt> <tt class="py-param">finish</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.createEdge-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.createEdge-expanded"><a name="L704"></a><tt class="py-lineno"> 704</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L705"></a><tt class="py-lineno"> 705</tt> <tt class="py-line"><tt class="py-docstring"> Adds an edge with an associated direction, from C{start} vertex to C{finish} vertex.</tt> </tt>
<a name="L706"></a><tt class="py-lineno"> 706</tt> <tt class="py-line"><tt class="py-docstring"> @param start: Name of start vertex.</tt> </tt>
<a name="L707"></a><tt class="py-lineno"> 707</tt> <tt class="py-line"><tt class="py-docstring"> @param finish: Name of finish vertex.</tt> </tt>
<a name="L708"></a><tt class="py-lineno"> 708</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If one of the named vertices is unknown.</tt> </tt>
<a name="L709"></a><tt class="py-lineno"> 709</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L710"></a><tt class="py-lineno"> 710</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L711"></a><tt class="py-lineno"> 711</tt> <tt class="py-line"> <tt class="py-name">startVertex</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">[</tt><tt class="py-name">start</tt><tt class="py-op">]</tt> </tt>
<a name="L712"></a><tt class="py-lineno"> 712</tt> <tt class="py-line"> <tt class="py-name">finishVertex</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">[</tt><tt class="py-name">finish</tt><tt class="py-op">]</tt> </tt>
<a name="L713"></a><tt class="py-lineno"> 713</tt> <tt class="py-line"> <tt class="py-name">startVertex</tt><tt class="py-op">.</tt><tt class="py-name">endpoints</tt><tt class="py-op">.</tt><tt id="link-125" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-125', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">finishVertex</tt><tt class="py-op">)</tt> </tt>
<a name="L714"></a><tt class="py-lineno"> 714</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt> <tt class="py-keyword">as</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L715"></a><tt class="py-lineno"> 715</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Vertex [%s] could not be found."</tt> <tt class="py-op">%</tt> <tt class="py-name">e</tt><tt class="py-op">)</tt> </tt>
</div><a name="L716"></a><tt class="py-lineno"> 716</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph.topologicalSort"></a><div id="DirectedGraph.topologicalSort-def"><a name="L717"></a><tt class="py-lineno"> 717</tt> <a class="py-toggle" href="#" id="DirectedGraph.topologicalSort-toggle" onclick="return toggle('DirectedGraph.topologicalSort');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#topologicalSort">topologicalSort</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph.topologicalSort-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph.topologicalSort-expanded"><a name="L718"></a><tt class="py-lineno"> 718</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L719"></a><tt class="py-lineno"> 719</tt> <tt class="py-line"><tt class="py-docstring"> Implements a topological sort of the graph.</tt> </tt>
<a name="L720"></a><tt class="py-lineno"> 720</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L721"></a><tt class="py-lineno"> 721</tt> <tt class="py-line"><tt class="py-docstring"> This method also enforces that the graph is a directed acyclic graph,</tt> </tt>
<a name="L722"></a><tt class="py-lineno"> 722</tt> <tt class="py-line"><tt class="py-docstring"> which is a requirement of a topological sort.</tt> </tt>
<a name="L723"></a><tt class="py-lineno"> 723</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L724"></a><tt class="py-lineno"> 724</tt> <tt class="py-line"><tt class="py-docstring"> A directed acyclic graph (or "DAG") is a directed graph with no directed</tt> </tt>
<a name="L725"></a><tt class="py-lineno"> 725</tt> <tt class="py-line"><tt class="py-docstring"> cycles. A topological sort of a DAG is an ordering on the vertices such</tt> </tt>
<a name="L726"></a><tt class="py-lineno"> 726</tt> <tt class="py-line"><tt class="py-docstring"> that all edges go from left to right. Only an acyclic graph can have a</tt> </tt>
<a name="L727"></a><tt class="py-lineno"> 727</tt> <tt class="py-line"><tt class="py-docstring"> topological sort, but any DAG has at least one topological sort.</tt> </tt>
<a name="L728"></a><tt class="py-lineno"> 728</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L729"></a><tt class="py-lineno"> 729</tt> <tt class="py-line"><tt class="py-docstring"> Since a topological sort only makes sense for an acyclic graph, this</tt> </tt>
<a name="L730"></a><tt class="py-lineno"> 730</tt> <tt class="py-line"><tt class="py-docstring"> method throws an exception if a cycle is found.</tt> </tt>
<a name="L731"></a><tt class="py-lineno"> 731</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L732"></a><tt class="py-lineno"> 732</tt> <tt class="py-line"><tt class="py-docstring"> A depth-first search only makes sense if the graph is acyclic. If the</tt> </tt>
<a name="L733"></a><tt class="py-lineno"> 733</tt> <tt class="py-line"><tt class="py-docstring"> graph contains any cycles, it is not possible to determine a consistent</tt> </tt>
<a name="L734"></a><tt class="py-lineno"> 734</tt> <tt class="py-line"><tt class="py-docstring"> ordering for the vertices.</tt> </tt>
<a name="L735"></a><tt class="py-lineno"> 735</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L736"></a><tt class="py-lineno"> 736</tt> <tt class="py-line"><tt class="py-docstring"> @note: If a particular vertex has no edges, then its position in the</tt> </tt>
<a name="L737"></a><tt class="py-lineno"> 737</tt> <tt class="py-line"><tt class="py-docstring"> final list depends on the order in which the vertices were created in the</tt> </tt>
<a name="L738"></a><tt class="py-lineno"> 738</tt> <tt class="py-line"><tt class="py-docstring"> graph. If you're using this method to determine a dependency order, this</tt> </tt>
<a name="L739"></a><tt class="py-lineno"> 739</tt> <tt class="py-line"><tt class="py-docstring"> makes sense: a vertex with no dependencies can go anywhere (and will).</tt> </tt>
<a name="L740"></a><tt class="py-lineno"> 740</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L741"></a><tt class="py-lineno"> 741</tt> <tt class="py-line"><tt class="py-docstring"> @return: Ordering on the vertices so that all edges go from left to right.</tt> </tt>
<a name="L742"></a><tt class="py-lineno"> 742</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L743"></a><tt class="py-lineno"> 743</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If a cycle is found in the graph.</tt> </tt>
<a name="L744"></a><tt class="py-lineno"> 744</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L745"></a><tt class="py-lineno"> 745</tt> <tt class="py-line"> <tt class="py-name">ordering</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L746"></a><tt class="py-lineno"> 746</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">:</tt> </tt>
<a name="L747"></a><tt class="py-lineno"> 747</tt> <tt class="py-line"> <tt class="py-name">vertex</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
<a name="L748"></a><tt class="py-lineno"> 748</tt> <tt class="py-line"> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-126" class="py-name"><a title="CedarBackup3.util.DirectedGraph._UNDISCOVERED" class="py-name" href="#" onclick="return doclink('link-126', '_UNDISCOVERED', 'link-101');">_UNDISCOVERED</a></tt> </tt>
<a name="L749"></a><tt class="py-lineno"> 749</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">:</tt> </tt>
<a name="L750"></a><tt class="py-lineno"> 750</tt> <tt class="py-line"> <tt class="py-name">vertex</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_vertices</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
<a name="L751"></a><tt class="py-lineno"> 751</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-127" class="py-name"><a title="CedarBackup3.util.DirectedGraph._UNDISCOVERED" class="py-name" href="#" onclick="return doclink('link-127', '_UNDISCOVERED', 'link-101');">_UNDISCOVERED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L752"></a><tt class="py-lineno"> 752</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-128" class="py-name" targets="Method CedarBackup3.util.DirectedGraph._topologicalSort()=CedarBackup3.util.DirectedGraph-class.html#_topologicalSort"><a title="CedarBackup3.util.DirectedGraph._topologicalSort" class="py-name" href="#" onclick="return doclink('link-128', '_topologicalSort', 'link-128');">_topologicalSort</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_startVertex</tt><tt class="py-op">,</tt> <tt class="py-name">ordering</tt><tt class="py-op">)</tt> </tt>
<a name="L753"></a><tt class="py-lineno"> 753</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">ordering</tt> </tt>
</div><a name="L754"></a><tt class="py-lineno"> 754</tt> <tt class="py-line"> </tt>
<a name="DirectedGraph._topologicalSort"></a><div id="DirectedGraph._topologicalSort-def"><a name="L755"></a><tt class="py-lineno"> 755</tt> <a class="py-toggle" href="#" id="DirectedGraph._topologicalSort-toggle" onclick="return toggle('DirectedGraph._topologicalSort');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.DirectedGraph-class.html#_topologicalSort">_topologicalSort</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">vertex</tt><tt class="py-op">,</tt> <tt class="py-param">ordering</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DirectedGraph._topologicalSort-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="DirectedGraph._topologicalSort-expanded"><a name="L756"></a><tt class="py-lineno"> 756</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L757"></a><tt class="py-lineno"> 757</tt> <tt class="py-line"><tt class="py-docstring"> Recursive depth first search function implementing topological sort.</tt> </tt>
<a name="L758"></a><tt class="py-lineno"> 758</tt> <tt class="py-line"><tt class="py-docstring"> @param vertex: Vertex to search</tt> </tt>
<a name="L759"></a><tt class="py-lineno"> 759</tt> <tt class="py-line"><tt class="py-docstring"> @param ordering: List of vertices in proper order</tt> </tt>
<a name="L760"></a><tt class="py-lineno"> 760</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L761"></a><tt class="py-lineno"> 761</tt> <tt class="py-line"> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-129" class="py-name"><a title="CedarBackup3.util.DirectedGraph._DISCOVERED" class="py-name" href="#" onclick="return doclink('link-129', '_DISCOVERED', 'link-102');">_DISCOVERED</a></tt> </tt>
<a name="L762"></a><tt class="py-lineno"> 762</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">endpoint</tt> <tt class="py-keyword">in</tt> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt class="py-name">endpoints</tt><tt class="py-op">:</tt> </tt>
<a name="L763"></a><tt class="py-lineno"> 763</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">endpoint</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-130" class="py-name"><a title="CedarBackup3.util.DirectedGraph._UNDISCOVERED" class="py-name" href="#" onclick="return doclink('link-130', '_UNDISCOVERED', 'link-101');">_UNDISCOVERED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L764"></a><tt class="py-lineno"> 764</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-131" class="py-name"><a title="CedarBackup3.util.DirectedGraph._topologicalSort" class="py-name" href="#" onclick="return doclink('link-131', '_topologicalSort', 'link-128');">_topologicalSort</a></tt><tt class="py-op">(</tt><tt class="py-name">endpoint</tt><tt class="py-op">,</tt> <tt class="py-name">ordering</tt><tt class="py-op">)</tt> </tt>
<a name="L765"></a><tt class="py-lineno"> 765</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">endpoint</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">!=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-132" class="py-name"><a title="CedarBackup3.util.DirectedGraph._EXPLORED" class="py-name" href="#" onclick="return doclink('link-132', '_EXPLORED', 'link-103');">_EXPLORED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L766"></a><tt class="py-lineno"> 766</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Cycle found in graph (found '%s' while searching '%s')."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt id="link-133" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-133', 'name', 'link-99');">name</a></tt><tt class="py-op">,</tt> <tt class="py-name">endpoint</tt><tt class="py-op">.</tt><tt id="link-134" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-134', 'name', 'link-99');">name</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L767"></a><tt class="py-lineno"> 767</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt id="link-135" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-135', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L768"></a><tt class="py-lineno"> 768</tt> <tt class="py-line"> <tt class="py-name">ordering</tt><tt class="py-op">.</tt><tt id="link-136" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.insert
CedarBackup3.util.ObjectTypeList.insert
CedarBackup3.util.RegexList.insert
CedarBackup3.util.RegexMatchList.insert
CedarBackup3.util.RestrictedContentList.insert" class="py-name" href="#" onclick="return doclink('link-136', 'insert', 'link-72');">insert</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt id="link-137" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-137', 'name', 'link-99');">name</a></tt><tt class="py-op">)</tt> </tt>
<a name="L769"></a><tt class="py-lineno"> 769</tt> <tt class="py-line"> <tt class="py-name">vertex</tt><tt class="py-op">.</tt><tt class="py-name">state</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-138" class="py-name"><a title="CedarBackup3.util.DirectedGraph._EXPLORED" class="py-name" href="#" onclick="return doclink('link-138', '_EXPLORED', 'link-103');">_EXPLORED</a></tt> </tt>
</div></div><a name="L770"></a><tt class="py-lineno"> 770</tt> <tt class="py-line"> </tt>
<a name="PathResolverSingleton"></a><div id="PathResolverSingleton-def"><a name="L771"></a><tt class="py-lineno"> 771</tt> <tt class="py-line"> </tt>
<a name="L772"></a><tt class="py-lineno"> 772</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L773"></a><tt class="py-lineno"> 773</tt> <tt class="py-line"><tt class="py-comment"># PathResolverSingleton class definition</tt> </tt>
<a name="L774"></a><tt class="py-lineno"> 774</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L775"></a><tt class="py-lineno"> 775</tt> <tt class="py-line"> </tt>
<a name="L776"></a><tt class="py-lineno"> 776</tt> <a class="py-toggle" href="#" id="PathResolverSingleton-toggle" onclick="return toggle('PathResolverSingleton');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton-class.html">PathResolverSingleton</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="PathResolverSingleton-expanded"><a name="L777"></a><tt class="py-lineno"> 777</tt> <tt class="py-line"> </tt>
<a name="L778"></a><tt class="py-lineno"> 778</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L779"></a><tt class="py-lineno"> 779</tt> <tt class="py-line"><tt class="py-docstring"> Singleton used for resolving executable paths.</tt> </tt>
<a name="L780"></a><tt class="py-lineno"> 780</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L781"></a><tt class="py-lineno"> 781</tt> <tt class="py-line"><tt class="py-docstring"> Various functions throughout Cedar Backup (including extensions) need a way</tt> </tt>
<a name="L782"></a><tt class="py-lineno"> 782</tt> <tt class="py-line"><tt class="py-docstring"> to resolve the path of executables that they use. For instance, the image</tt> </tt>
<a name="L783"></a><tt class="py-lineno"> 783</tt> <tt class="py-line"><tt class="py-docstring"> functionality needs to find the C{mkisofs} executable, and the Subversion</tt> </tt>
<a name="L784"></a><tt class="py-lineno"> 784</tt> <tt class="py-line"><tt class="py-docstring"> extension needs to find the C{svnlook} executable. Cedar Backup's original</tt> </tt>
<a name="L785"></a><tt class="py-lineno"> 785</tt> <tt class="py-line"><tt class="py-docstring"> behavior was to assume that the simple name (C{"svnlook"} or whatever) was</tt> </tt>
<a name="L786"></a><tt class="py-lineno"> 786</tt> <tt class="py-line"><tt class="py-docstring"> available on the caller's C{$PATH}, and to fail otherwise. However, this</tt> </tt>
<a name="L787"></a><tt class="py-lineno"> 787</tt> <tt class="py-line"><tt class="py-docstring"> turns out to be less than ideal, since for instance the root user might not</tt> </tt>
<a name="L788"></a><tt class="py-lineno"> 788</tt> <tt class="py-line"><tt class="py-docstring"> always have executables like C{svnlook} in its path.</tt> </tt>
<a name="L789"></a><tt class="py-lineno"> 789</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L790"></a><tt class="py-lineno"> 790</tt> <tt class="py-line"><tt class="py-docstring"> One solution is to specify a path (either via an absolute path or some sort</tt> </tt>
<a name="L791"></a><tt class="py-lineno"> 791</tt> <tt class="py-line"><tt class="py-docstring"> of path insertion or path appending mechanism) that would apply to the</tt> </tt>
<a name="L792"></a><tt class="py-lineno"> 792</tt> <tt class="py-line"><tt class="py-docstring"> C{executeCommand()} function. This is not difficult to implement, but it</tt> </tt>
<a name="L793"></a><tt class="py-lineno"> 793</tt> <tt class="py-line"><tt class="py-docstring"> seem like kind of a "big hammer" solution. Besides that, it might also</tt> </tt>
<a name="L794"></a><tt class="py-lineno"> 794</tt> <tt class="py-line"><tt class="py-docstring"> represent a security flaw (for instance, I prefer not to mess with root's</tt> </tt>
<a name="L795"></a><tt class="py-lineno"> 795</tt> <tt class="py-line"><tt class="py-docstring"> C{$PATH} on the application level if I don't have to).</tt> </tt>
<a name="L796"></a><tt class="py-lineno"> 796</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L797"></a><tt class="py-lineno"> 797</tt> <tt class="py-line"><tt class="py-docstring"> The alternative is to set up some sort of configuration for the path to</tt> </tt>
<a name="L798"></a><tt class="py-lineno"> 798</tt> <tt class="py-line"><tt class="py-docstring"> certain executables, i.e. "find C{svnlook} in C{/usr/local/bin/svnlook}" or</tt> </tt>
<a name="L799"></a><tt class="py-lineno"> 799</tt> <tt class="py-line"><tt class="py-docstring"> whatever. This PathResolverSingleton aims to provide a good solution to the</tt> </tt>
<a name="L800"></a><tt class="py-lineno"> 800</tt> <tt class="py-line"><tt class="py-docstring"> mapping problem. Callers of all sorts (extensions or not) can get an</tt> </tt>
<a name="L801"></a><tt class="py-lineno"> 801</tt> <tt class="py-line"><tt class="py-docstring"> instance of the singleton. Then, they call the C{lookup} method to try and</tt> </tt>
<a name="L802"></a><tt class="py-lineno"> 802</tt> <tt class="py-line"><tt class="py-docstring"> resolve the executable they are looking for. Through the C{lookup} method,</tt> </tt>
<a name="L803"></a><tt class="py-lineno"> 803</tt> <tt class="py-line"><tt class="py-docstring"> the caller can also specify a default to use if a mapping is not found.</tt> </tt>
<a name="L804"></a><tt class="py-lineno"> 804</tt> <tt class="py-line"><tt class="py-docstring"> This way, with no real effort on the part of the caller, behavior can neatly</tt> </tt>
<a name="L805"></a><tt class="py-lineno"> 805</tt> <tt class="py-line"><tt class="py-docstring"> degrade to something equivalent to the current behavior if there is no</tt> </tt>
<a name="L806"></a><tt class="py-lineno"> 806</tt> <tt class="py-line"><tt class="py-docstring"> special mapping or if the singleton was never initialized in the first</tt> </tt>
<a name="L807"></a><tt class="py-lineno"> 807</tt> <tt class="py-line"><tt class="py-docstring"> place.</tt> </tt>
<a name="L808"></a><tt class="py-lineno"> 808</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L809"></a><tt class="py-lineno"> 809</tt> <tt class="py-line"><tt class="py-docstring"> Even better, extensions automagically get access to the same resolver</tt> </tt>
<a name="L810"></a><tt class="py-lineno"> 810</tt> <tt class="py-line"><tt class="py-docstring"> functionality, and they don't even need to understand how the mapping</tt> </tt>
<a name="L811"></a><tt class="py-lineno"> 811</tt> <tt class="py-line"><tt class="py-docstring"> happens. All extension authors need to do is document what executables</tt> </tt>
<a name="L812"></a><tt class="py-lineno"> 812</tt> <tt class="py-line"><tt class="py-docstring"> their code requires, and the standard resolver configuration section will</tt> </tt>
<a name="L813"></a><tt class="py-lineno"> 813</tt> <tt class="py-line"><tt class="py-docstring"> meet their needs.</tt> </tt>
<a name="L814"></a><tt class="py-lineno"> 814</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L815"></a><tt class="py-lineno"> 815</tt> <tt class="py-line"><tt class="py-docstring"> The class should be initialized once through the constructor somewhere in</tt> </tt>
<a name="L816"></a><tt class="py-lineno"> 816</tt> <tt class="py-line"><tt class="py-docstring"> the main routine. Then, the main routine should call the L{fill} method to</tt> </tt>
<a name="L817"></a><tt class="py-lineno"> 817</tt> <tt class="py-line"><tt class="py-docstring"> fill in the resolver's internal structures. Everyone else who needs to</tt> </tt>
<a name="L818"></a><tt class="py-lineno"> 818</tt> <tt class="py-line"><tt class="py-docstring"> resolve a path will get an instance of the class using L{getInstance} and</tt> </tt>
<a name="L819"></a><tt class="py-lineno"> 819</tt> <tt class="py-line"><tt class="py-docstring"> will then just call the L{lookup} method.</tt> </tt>
<a name="L820"></a><tt class="py-lineno"> 820</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L821"></a><tt class="py-lineno"> 821</tt> <tt class="py-line"><tt class="py-docstring"> @cvar _instance: Holds a reference to the singleton</tt> </tt>
<a name="L822"></a><tt class="py-lineno"> 822</tt> <tt class="py-line"><tt class="py-docstring"> @ivar _mapping: Internal mapping from resource name to path.</tt> </tt>
<a name="L823"></a><tt class="py-lineno"> 823</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L824"></a><tt class="py-lineno"> 824</tt> <tt class="py-line"> </tt>
<a name="L825"></a><tt class="py-lineno"> 825</tt> <tt class="py-line"> <tt id="link-139" class="py-name" targets="Variable CedarBackup3.util.PathResolverSingleton._instance=CedarBackup3.util.PathResolverSingleton-class.html#_instance"><a title="CedarBackup3.util.PathResolverSingleton._instance" class="py-name" href="#" onclick="return doclink('link-139', '_instance', 'link-139');">_instance</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> <tt class="py-comment"># Holds a reference to singleton instance</tt> </tt>
<a name="L826"></a><tt class="py-lineno"> 826</tt> <tt class="py-line"> </tt>
<a name="PathResolverSingleton._Helper"></a><div id="PathResolverSingleton._Helper-def"><a name="L827"></a><tt class="py-lineno"> 827</tt> <a class="py-toggle" href="#" id="PathResolverSingleton._Helper-toggle" onclick="return toggle('PathResolverSingleton._Helper');">-</a><tt class="py-line"> <tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton._Helper-class.html">_Helper</a><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton._Helper-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="PathResolverSingleton._Helper-expanded"><a name="L828"></a><tt class="py-lineno"> 828</tt> <tt class="py-line"> <tt class="py-docstring">"""Helper class to provide a singleton factory method."""</tt> </tt>
<a name="PathResolverSingleton._Helper.__init__"></a><div id="PathResolverSingleton._Helper.__init__-def"><a name="L829"></a><tt class="py-lineno"> 829</tt> <a class="py-toggle" href="#" id="PathResolverSingleton._Helper.__init__-toggle" onclick="return toggle('PathResolverSingleton._Helper.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton._Helper-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton._Helper.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++++++++"></div><div id="PathResolverSingleton._Helper.__init__-expanded"><a name="L830"></a><tt class="py-lineno"> 830</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
</div><a name="PathResolverSingleton._Helper.__call__"></a><div id="PathResolverSingleton._Helper.__call__-def"><a name="L831"></a><tt class="py-lineno"> 831</tt> <a class="py-toggle" href="#" id="PathResolverSingleton._Helper.__call__-toggle" onclick="return toggle('PathResolverSingleton._Helper.__call__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton._Helper-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton._Helper.__call__-collapsed" style="display:none;" pad="++++" indent="+++++++++++++"></div><div id="PathResolverSingleton._Helper.__call__-expanded"><a name="L832"></a><tt class="py-lineno"> 832</tt> <tt class="py-line"> <tt class="py-comment"># pylint: disable=W0212,R0201</tt> </tt>
<a name="L833"></a><tt class="py-lineno"> 833</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-140" class="py-name" targets="Class CedarBackup3.util.PathResolverSingleton=CedarBackup3.util.PathResolverSingleton-class.html"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-140', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">.</tt><tt id="link-141" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton._instance" class="py-name" href="#" onclick="return doclink('link-141', '_instance', 'link-139');">_instance</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L834"></a><tt class="py-lineno"> 834</tt> <tt class="py-line"> <tt class="py-name">obj</tt> <tt class="py-op">=</tt> <tt id="link-142" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-142', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L835"></a><tt class="py-lineno"> 835</tt> <tt class="py-line"> <tt id="link-143" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-143', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">.</tt><tt id="link-144" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton._instance" class="py-name" href="#" onclick="return doclink('link-144', '_instance', 'link-139');">_instance</a></tt> <tt class="py-op">=</tt> <tt class="py-name">obj</tt> </tt>
<a name="L836"></a><tt class="py-lineno"> 836</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-145" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-145', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">.</tt><tt id="link-146" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton._instance" class="py-name" href="#" onclick="return doclink('link-146', '_instance', 'link-139');">_instance</a></tt> </tt>
</div></div><a name="L837"></a><tt class="py-lineno"> 837</tt> <tt class="py-line"> </tt>
<a name="L838"></a><tt class="py-lineno"> 838</tt> <tt class="py-line"> <tt id="link-147" class="py-name" targets="Variable CedarBackup3.util.PathResolverSingleton.getInstance=CedarBackup3.util.PathResolverSingleton-class.html#getInstance"><a title="CedarBackup3.util.PathResolverSingleton.getInstance" class="py-name" href="#" onclick="return doclink('link-147', 'getInstance', 'link-147');">getInstance</a></tt> <tt class="py-op">=</tt> <tt id="link-148" class="py-name" targets="Class CedarBackup3.util.PathResolverSingleton._Helper=CedarBackup3.util.PathResolverSingleton._Helper-class.html"><a title="CedarBackup3.util.PathResolverSingleton._Helper" class="py-name" href="#" onclick="return doclink('link-148', '_Helper', 'link-148');">_Helper</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-comment"># Method that callers will use to get an instance</tt> </tt>
<a name="L839"></a><tt class="py-lineno"> 839</tt> <tt class="py-line"> </tt>
<a name="PathResolverSingleton.__init__"></a><div id="PathResolverSingleton.__init__-def"><a name="L840"></a><tt class="py-lineno"> 840</tt> <a class="py-toggle" href="#" id="PathResolverSingleton.__init__-toggle" onclick="return toggle('PathResolverSingleton.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="PathResolverSingleton.__init__-expanded"><a name="L841"></a><tt class="py-lineno"> 841</tt> <tt class="py-line"> <tt class="py-docstring">"""Singleton constructor, which just creates the singleton instance."""</tt> </tt>
<a name="L842"></a><tt class="py-lineno"> 842</tt> <tt class="py-line"> <tt id="link-149" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-149', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">.</tt><tt id="link-150" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton._instance" class="py-name" href="#" onclick="return doclink('link-150', '_instance', 'link-139');">_instance</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt> </tt>
<a name="L843"></a><tt class="py-lineno"> 843</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mapping</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> <tt class="py-op">}</tt> </tt>
</div><a name="L844"></a><tt class="py-lineno"> 844</tt> <tt class="py-line"> </tt>
<a name="PathResolverSingleton.lookup"></a><div id="PathResolverSingleton.lookup-def"><a name="L845"></a><tt class="py-lineno"> 845</tt> <a class="py-toggle" href="#" id="PathResolverSingleton.lookup-toggle" onclick="return toggle('PathResolverSingleton.lookup');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton-class.html#lookup">lookup</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">default</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton.lookup-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="PathResolverSingleton.lookup-expanded"><a name="L846"></a><tt class="py-lineno"> 846</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L847"></a><tt class="py-lineno"> 847</tt> <tt class="py-line"><tt class="py-docstring"> Looks up name and returns the resolved path associated with the name.</tt> </tt>
<a name="L848"></a><tt class="py-lineno"> 848</tt> <tt class="py-line"><tt class="py-docstring"> @param name: Name of the path resource to resolve.</tt> </tt>
<a name="L849"></a><tt class="py-lineno"> 849</tt> <tt class="py-line"><tt class="py-docstring"> @param default: Default to return if resource cannot be resolved.</tt> </tt>
<a name="L850"></a><tt class="py-lineno"> 850</tt> <tt class="py-line"><tt class="py-docstring"> @return: Resolved path associated with name, or default if name can't be resolved.</tt> </tt>
<a name="L851"></a><tt class="py-lineno"> 851</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L852"></a><tt class="py-lineno"> 852</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">default</tt> </tt>
<a name="L853"></a><tt class="py-lineno"> 853</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-151" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-151', 'name', 'link-99');">name</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mapping</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L854"></a><tt class="py-lineno"> 854</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mapping</tt><tt class="py-op">[</tt><tt id="link-152" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-152', 'name', 'link-99');">name</a></tt><tt class="py-op">]</tt> </tt>
<a name="L855"></a><tt class="py-lineno"> 855</tt> <tt class="py-line"> <tt id="link-153" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-153', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-154" class="py-name" targets="Variable CedarBackup3.cli.Options.debug=CedarBackup3.cli.Options-class.html#debug,Variable CedarBackup3.tools.amazons3.Options.debug=CedarBackup3.tools.amazons3.Options-class.html#debug"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-154', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Resolved command [%s] to [%s]."</tt><tt class="py-op">,</tt> <tt id="link-155" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-155', 'name', 'link-99');">name</a></tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L856"></a><tt class="py-lineno"> 856</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">value</tt> </tt>
</div><a name="L857"></a><tt class="py-lineno"> 857</tt> <tt class="py-line"> </tt>
<a name="PathResolverSingleton.fill"></a><div id="PathResolverSingleton.fill-def"><a name="L858"></a><tt class="py-lineno"> 858</tt> <a class="py-toggle" href="#" id="PathResolverSingleton.fill-toggle" onclick="return toggle('PathResolverSingleton.fill');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.PathResolverSingleton-class.html#fill">fill</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">mapping</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PathResolverSingleton.fill-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="PathResolverSingleton.fill-expanded"><a name="L859"></a><tt class="py-lineno"> 859</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L860"></a><tt class="py-lineno"> 860</tt> <tt class="py-line"><tt class="py-docstring"> Fills in the singleton's internal mapping from name to resource.</tt> </tt>
<a name="L861"></a><tt class="py-lineno"> 861</tt> <tt class="py-line"><tt class="py-docstring"> @param mapping: Mapping from resource name to path.</tt> </tt>
<a name="L862"></a><tt class="py-lineno"> 862</tt> <tt class="py-line"><tt class="py-docstring"> @type mapping: Dictionary mapping name to path, both as strings.</tt> </tt>
<a name="L863"></a><tt class="py-lineno"> 863</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L864"></a><tt class="py-lineno"> 864</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mapping</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> <tt class="py-op">}</tt> </tt>
<a name="L865"></a><tt class="py-lineno"> 865</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">mapping</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L866"></a><tt class="py-lineno"> 866</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mapping</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">mapping</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
</div></div><a name="L867"></a><tt class="py-lineno"> 867</tt> <tt class="py-line"> </tt>
<a name="Pipe"></a><div id="Pipe-def"><a name="L868"></a><tt class="py-lineno"> 868</tt> <tt class="py-line"> </tt>
<a name="L869"></a><tt class="py-lineno"> 869</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L870"></a><tt class="py-lineno"> 870</tt> <tt class="py-line"><tt class="py-comment"># Pipe class definition</tt> </tt>
<a name="L871"></a><tt class="py-lineno"> 871</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L872"></a><tt class="py-lineno"> 872</tt> <tt class="py-line"> </tt>
<a name="L873"></a><tt class="py-lineno"> 873</tt> <a class="py-toggle" href="#" id="Pipe-toggle" onclick="return toggle('Pipe');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.Pipe-class.html">Pipe</a><tt class="py-op">(</tt><tt class="py-base-class">Popen</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Pipe-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Pipe-expanded"><a name="L874"></a><tt class="py-lineno"> 874</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L875"></a><tt class="py-lineno"> 875</tt> <tt class="py-line"><tt class="py-docstring"> Specialized pipe class for use by C{executeCommand}.</tt> </tt>
<a name="L876"></a><tt class="py-lineno"> 876</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L877"></a><tt class="py-lineno"> 877</tt> <tt class="py-line"><tt class="py-docstring"> The L{executeCommand} function needs a specialized way of interacting</tt> </tt>
<a name="L878"></a><tt class="py-lineno"> 878</tt> <tt class="py-line"><tt class="py-docstring"> with a pipe. First, C{executeCommand} only reads from the pipe, and</tt> </tt>
<a name="L879"></a><tt class="py-lineno"> 879</tt> <tt class="py-line"><tt class="py-docstring"> never writes to it. Second, C{executeCommand} needs a way to discard all</tt> </tt>
<a name="L880"></a><tt class="py-lineno"> 880</tt> <tt class="py-line"><tt class="py-docstring"> output written to C{stderr}, as a means of simulating the shell</tt> </tt>
<a name="L881"></a><tt class="py-lineno"> 881</tt> <tt class="py-line"><tt class="py-docstring"> C{2>/dev/null} construct.</tt> </tt>
<a name="L882"></a><tt class="py-lineno"> 882</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="Pipe.__init__"></a><div id="Pipe.__init__-def"><a name="L883"></a><tt class="py-lineno"> 883</tt> <a class="py-toggle" href="#" id="Pipe.__init__-toggle" onclick="return toggle('Pipe.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Pipe-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">,</tt> <tt class="py-param">bufsize</tt><tt class="py-op">=</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-param">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Pipe.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Pipe.__init__-expanded"><a name="L884"></a><tt class="py-lineno"> 884</tt> <tt class="py-line"> <tt class="py-name">stderr</tt> <tt class="py-op">=</tt> <tt class="py-name">STDOUT</tt> </tt>
<a name="L885"></a><tt class="py-lineno"> 885</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">ignoreStderr</tt><tt class="py-op">:</tt> </tt>
<a name="L886"></a><tt class="py-lineno"> 886</tt> <tt class="py-line"> <tt class="py-name">devnull</tt> <tt class="py-op">=</tt> <tt id="link-156" class="py-name" targets="Function CedarBackup3.util.nullDevice()=CedarBackup3.util-module.html#nullDevice"><a title="CedarBackup3.util.nullDevice" class="py-name" href="#" onclick="return doclink('link-156', 'nullDevice', 'link-156');">nullDevice</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L887"></a><tt class="py-lineno"> 887</tt> <tt class="py-line"> <tt class="py-name">stderr</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">devnull</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_RDWR</tt><tt class="py-op">)</tt> </tt>
<a name="L888"></a><tt class="py-lineno"> 888</tt> <tt class="py-line"> <tt class="py-name">Popen</tt><tt class="py-op">.</tt><tt id="link-157" class="py-name"><a title="CedarBackup3.cli.Options.__init__
CedarBackup3.cli._ActionItem.__init__
CedarBackup3.cli._ActionSet.__init__
CedarBackup3.cli._ManagedActionItem.__init__
CedarBackup3.config.ActionDependencies.__init__
CedarBackup3.config.ActionHook.__init__
CedarBackup3.config.BlankBehavior.__init__
CedarBackup3.config.ByteQuantity.__init__
CedarBackup3.config.CollectConfig.__init__
CedarBackup3.config.CollectDir.__init__
CedarBackup3.config.CollectFile.__init__
CedarBackup3.config.CommandOverride.__init__
CedarBackup3.config.Config.__init__
CedarBackup3.config.ExtendedAction.__init__
CedarBackup3.config.ExtensionsConfig.__init__
CedarBackup3.config.LocalPeer.__init__
CedarBackup3.config.OptionsConfig.__init__
CedarBackup3.config.PeersConfig.__init__
CedarBackup3.config.PostActionHook.__init__
CedarBackup3.config.PreActionHook.__init__
CedarBackup3.config.PurgeConfig.__init__
CedarBackup3.config.PurgeDir.__init__
CedarBackup3.config.ReferenceConfig.__init__
CedarBackup3.config.RemotePeer.__init__
CedarBackup3.config.StageConfig.__init__
CedarBackup3.config.StoreConfig.__init__
CedarBackup3.extend.amazons3.AmazonS3Config.__init__
CedarBackup3.extend.amazons3.LocalConfig.__init__
CedarBackup3.extend.capacity.CapacityConfig.__init__
CedarBackup3.extend.capacity.LocalConfig.__init__
CedarBackup3.extend.capacity.PercentageQuantity.__init__
CedarBackup3.extend.encrypt.EncryptConfig.__init__
CedarBackup3.extend.encrypt.LocalConfig.__init__
CedarBackup3.extend.mbox.LocalConfig.__init__
CedarBackup3.extend.mbox.MboxConfig.__init__
CedarBackup3.extend.mbox.MboxDir.__init__
CedarBackup3.extend.mbox.MboxFile.__init__
CedarBackup3.extend.mysql.LocalConfig.__init__
CedarBackup3.extend.mysql.MysqlConfig.__init__
CedarBackup3.extend.postgresql.LocalConfig.__init__
CedarBackup3.extend.postgresql.PostgresqlConfig.__init__
CedarBackup3.extend.split.LocalConfig.__init__
CedarBackup3.extend.split.SplitConfig.__init__
CedarBackup3.extend.subversion.BDBRepository.__init__
CedarBackup3.extend.subversion.FSFSRepository.__init__
CedarBackup3.extend.subversion.LocalConfig.__init__
CedarBackup3.extend.subversion.Repository.__init__
CedarBackup3.extend.subversion.RepositoryDir.__init__
CedarBackup3.extend.subversion.SubversionConfig.__init__
CedarBackup3.filesystem.BackupFileList.__init__
CedarBackup3.filesystem.FilesystemList.__init__
CedarBackup3.filesystem.PurgeItemList.__init__
CedarBackup3.filesystem.SpanItem.__init__
CedarBackup3.peer.LocalPeer.__init__
CedarBackup3.peer.RemotePeer.__init__
CedarBackup3.tools.amazons3.Options.__init__
CedarBackup3.util.Diagnostics.__init__
CedarBackup3.util.DirectedGraph.__init__
CedarBackup3.util.ObjectTypeList.__init__
CedarBackup3.util.PathResolverSingleton._Helper.__init__
CedarBackup3.util.PathResolverSingleton.__init__
CedarBackup3.util.Pipe.__init__
CedarBackup3.util.RegexMatchList.__init__
CedarBackup3.util.RestrictedContentList.__init__
CedarBackup3.util._Vertex.__init__
CedarBackup3.writers.cdwriter.CdWriter.__init__
CedarBackup3.writers.cdwriter.MediaCapacity.__init__
CedarBackup3.writers.cdwriter.MediaDefinition.__init__
CedarBackup3.writers.cdwriter._ImageProperties.__init__
CedarBackup3.writers.dvdwriter.DvdWriter.__init__
CedarBackup3.writers.dvdwriter.MediaCapacity.__init__
CedarBackup3.writers.dvdwriter.MediaDefinition.__init__
CedarBackup3.writers.dvdwriter._ImageProperties.__init__
CedarBackup3.writers.util.IsoImage.__init__
CedarBackup3.xmlutil.Serializer.__init__" class="py-name" href="#" onclick="return doclink('link-157', '__init__', 'link-78');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">shell</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">=</tt><tt class="py-name">cmd</tt><tt class="py-op">,</tt> <tt class="py-name">bufsize</tt><tt class="py-op">=</tt><tt class="py-name">bufsize</tt><tt class="py-op">,</tt> <tt class="py-name">stdin</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">stdout</tt><tt class="py-op">=</tt><tt class="py-name">PIPE</tt><tt class="py-op">,</tt> <tt class="py-name">stderr</tt><tt class="py-op">=</tt><tt class="py-name">stderr</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L889"></a><tt class="py-lineno"> 889</tt> <tt class="py-line"> </tt>
<a name="Diagnostics"></a><div id="Diagnostics-def"><a name="L890"></a><tt class="py-lineno"> 890</tt> <tt class="py-line"> </tt>
<a name="L891"></a><tt class="py-lineno"> 891</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L892"></a><tt class="py-lineno"> 892</tt> <tt class="py-line"><tt class="py-comment"># Diagnostics class definition</tt> </tt>
<a name="L893"></a><tt class="py-lineno"> 893</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L894"></a><tt class="py-lineno"> 894</tt> <tt class="py-line"> </tt>
<a name="L895"></a><tt class="py-lineno"> 895</tt> <a class="py-toggle" href="#" id="Diagnostics-toggle" onclick="return toggle('Diagnostics');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html">Diagnostics</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Diagnostics-expanded"><a name="L896"></a><tt class="py-lineno"> 896</tt> <tt class="py-line"> </tt>
<a name="L897"></a><tt class="py-lineno"> 897</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L898"></a><tt class="py-lineno"> 898</tt> <tt class="py-line"><tt class="py-docstring"> Class holding runtime diagnostic information.</tt> </tt>
<a name="L899"></a><tt class="py-lineno"> 899</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L900"></a><tt class="py-lineno"> 900</tt> <tt class="py-line"><tt class="py-docstring"> Diagnostic information is information that is useful to get from users for</tt> </tt>
<a name="L901"></a><tt class="py-lineno"> 901</tt> <tt class="py-line"><tt class="py-docstring"> debugging purposes. I'm consolidating it all here into one object.</tt> </tt>
<a name="L902"></a><tt class="py-lineno"> 902</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L903"></a><tt class="py-lineno"> 903</tt> <tt class="py-line"><tt class="py-docstring"> @sort: __init__, __repr__, __str__</tt> </tt>
<a name="L904"></a><tt class="py-lineno"> 904</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L905"></a><tt class="py-lineno"> 905</tt> <tt class="py-line"> <tt class="py-comment"># pylint: disable=R0201</tt> </tt>
<a name="L906"></a><tt class="py-lineno"> 906</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.__init__"></a><div id="Diagnostics.__init__-def"><a name="L907"></a><tt class="py-lineno"> 907</tt> <a class="py-toggle" href="#" id="Diagnostics.__init__-toggle" onclick="return toggle('Diagnostics.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.__init__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.__init__-expanded"><a name="L908"></a><tt class="py-lineno"> 908</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L909"></a><tt class="py-lineno"> 909</tt> <tt class="py-line"><tt class="py-docstring"> Constructor for the C{Diagnostics} class.</tt> </tt>
<a name="L910"></a><tt class="py-lineno"> 910</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
</div><a name="L911"></a><tt class="py-lineno"> 911</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.__repr__"></a><div id="Diagnostics.__repr__-def"><a name="L912"></a><tt class="py-lineno"> 912</tt> <a class="py-toggle" href="#" id="Diagnostics.__repr__-toggle" onclick="return toggle('Diagnostics.__repr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.__repr__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.__repr__-expanded"><a name="L913"></a><tt class="py-lineno"> 913</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L914"></a><tt class="py-lineno"> 914</tt> <tt class="py-line"><tt class="py-docstring"> Official string representation for class instance.</tt> </tt>
<a name="L915"></a><tt class="py-lineno"> 915</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L916"></a><tt class="py-lineno"> 916</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"Diagnostics()"</tt> </tt>
</div><a name="L917"></a><tt class="py-lineno"> 917</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.__str__"></a><div id="Diagnostics.__str__-def"><a name="L918"></a><tt class="py-lineno"> 918</tt> <a class="py-toggle" href="#" id="Diagnostics.__str__-toggle" onclick="return toggle('Diagnostics.__str__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.__str__-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.__str__-expanded"><a name="L919"></a><tt class="py-lineno"> 919</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L920"></a><tt class="py-lineno"> 920</tt> <tt class="py-line"><tt class="py-docstring"> Informal string representation for class instance.</tt> </tt>
<a name="L921"></a><tt class="py-lineno"> 921</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L922"></a><tt class="py-lineno"> 922</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-158" class="py-name"><a title="CedarBackup3.cli.Options.__repr__
CedarBackup3.config.ActionDependencies.__repr__
CedarBackup3.config.ActionHook.__repr__
CedarBackup3.config.BlankBehavior.__repr__
CedarBackup3.config.ByteQuantity.__repr__
CedarBackup3.config.CollectConfig.__repr__
CedarBackup3.config.CollectDir.__repr__
CedarBackup3.config.CollectFile.__repr__
CedarBackup3.config.CommandOverride.__repr__
CedarBackup3.config.Config.__repr__
CedarBackup3.config.ExtendedAction.__repr__
CedarBackup3.config.ExtensionsConfig.__repr__
CedarBackup3.config.LocalPeer.__repr__
CedarBackup3.config.OptionsConfig.__repr__
CedarBackup3.config.PeersConfig.__repr__
CedarBackup3.config.PostActionHook.__repr__
CedarBackup3.config.PreActionHook.__repr__
CedarBackup3.config.PurgeConfig.__repr__
CedarBackup3.config.PurgeDir.__repr__
CedarBackup3.config.ReferenceConfig.__repr__
CedarBackup3.config.RemotePeer.__repr__
CedarBackup3.config.StageConfig.__repr__
CedarBackup3.config.StoreConfig.__repr__
CedarBackup3.extend.amazons3.AmazonS3Config.__repr__
CedarBackup3.extend.amazons3.LocalConfig.__repr__
CedarBackup3.extend.capacity.CapacityConfig.__repr__
CedarBackup3.extend.capacity.LocalConfig.__repr__
CedarBackup3.extend.capacity.PercentageQuantity.__repr__
CedarBackup3.extend.encrypt.EncryptConfig.__repr__
CedarBackup3.extend.encrypt.LocalConfig.__repr__
CedarBackup3.extend.mbox.LocalConfig.__repr__
CedarBackup3.extend.mbox.MboxConfig.__repr__
CedarBackup3.extend.mbox.MboxDir.__repr__
CedarBackup3.extend.mbox.MboxFile.__repr__
CedarBackup3.extend.mysql.LocalConfig.__repr__
CedarBackup3.extend.mysql.MysqlConfig.__repr__
CedarBackup3.extend.postgresql.LocalConfig.__repr__
CedarBackup3.extend.postgresql.PostgresqlConfig.__repr__
CedarBackup3.extend.split.LocalConfig.__repr__
CedarBackup3.extend.split.SplitConfig.__repr__
CedarBackup3.extend.subversion.BDBRepository.__repr__
CedarBackup3.extend.subversion.FSFSRepository.__repr__
CedarBackup3.extend.subversion.LocalConfig.__repr__
CedarBackup3.extend.subversion.Repository.__repr__
CedarBackup3.extend.subversion.RepositoryDir.__repr__
CedarBackup3.extend.subversion.SubversionConfig.__repr__
CedarBackup3.tools.amazons3.Options.__repr__
CedarBackup3.util.Diagnostics.__repr__
CedarBackup3.util.DirectedGraph.__repr__" class="py-name" href="#" onclick="return doclink('link-158', '__repr__', 'link-109');">__repr__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L923"></a><tt class="py-lineno"> 923</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.getValues"></a><div id="Diagnostics.getValues-def"><a name="L924"></a><tt class="py-lineno"> 924</tt> <a class="py-toggle" href="#" id="Diagnostics.getValues-toggle" onclick="return toggle('Diagnostics.getValues');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#getValues">getValues</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.getValues-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.getValues-expanded"><a name="L925"></a><tt class="py-lineno"> 925</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L926"></a><tt class="py-lineno"> 926</tt> <tt class="py-line"><tt class="py-docstring"> Get a map containing all of the diagnostic values.</tt> </tt>
<a name="L927"></a><tt class="py-lineno"> 927</tt> <tt class="py-line"><tt class="py-docstring"> @return: Map from diagnostic name to diagnostic value.</tt> </tt>
<a name="L928"></a><tt class="py-lineno"> 928</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L929"></a><tt class="py-lineno"> 929</tt> <tt class="py-line"> <tt class="py-name">values</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L930"></a><tt class="py-lineno"> 930</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'version'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-159" class="py-name" targets="Variable CedarBackup3.cli.Options.version=CedarBackup3.cli.Options-class.html#version,Variable CedarBackup3.tools.amazons3.Options.version=CedarBackup3.tools.amazons3.Options-class.html#version,Variable CedarBackup3.util.Diagnostics.version=CedarBackup3.util.Diagnostics-class.html#version"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-159', 'version', 'link-159');">version</a></tt> </tt>
<a name="L931"></a><tt class="py-lineno"> 931</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'interpreter'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-160" class="py-name" targets="Variable CedarBackup3.util.Diagnostics.interpreter=CedarBackup3.util.Diagnostics-class.html#interpreter"><a title="CedarBackup3.util.Diagnostics.interpreter" class="py-name" href="#" onclick="return doclink('link-160', 'interpreter', 'link-160');">interpreter</a></tt> </tt>
<a name="L932"></a><tt class="py-lineno"> 932</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'platform'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-161" class="py-name" targets="Variable CedarBackup3.util.Diagnostics.platform=CedarBackup3.util.Diagnostics-class.html#platform"><a title="CedarBackup3.util.Diagnostics.platform" class="py-name" href="#" onclick="return doclink('link-161', 'platform', 'link-161');">platform</a></tt> </tt>
<a name="L933"></a><tt class="py-lineno"> 933</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'encoding'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-162" class="py-name" targets="Variable CedarBackup3.util.Diagnostics.encoding=CedarBackup3.util.Diagnostics-class.html#encoding"><a title="CedarBackup3.util.Diagnostics.encoding" class="py-name" href="#" onclick="return doclink('link-162', 'encoding', 'link-162');">encoding</a></tt> </tt>
<a name="L934"></a><tt class="py-lineno"> 934</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'locale'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-163" class="py-name" targets="Variable CedarBackup3.util.Diagnostics.locale=CedarBackup3.util.Diagnostics-class.html#locale"><a title="CedarBackup3.util.Diagnostics.locale" class="py-name" href="#" onclick="return doclink('link-163', 'locale', 'link-163');">locale</a></tt> </tt>
<a name="L935"></a><tt class="py-lineno"> 935</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-string">'timestamp'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-164" class="py-name" targets="Variable CedarBackup3.util.Diagnostics.timestamp=CedarBackup3.util.Diagnostics-class.html#timestamp"><a title="CedarBackup3.util.Diagnostics.timestamp" class="py-name" href="#" onclick="return doclink('link-164', 'timestamp', 'link-164');">timestamp</a></tt> </tt>
<a name="L936"></a><tt class="py-lineno"> 936</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">values</tt> </tt>
</div><a name="L937"></a><tt class="py-lineno"> 937</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.printDiagnostics"></a><div id="Diagnostics.printDiagnostics-def"><a name="L938"></a><tt class="py-lineno"> 938</tt> <a class="py-toggle" href="#" id="Diagnostics.printDiagnostics-toggle" onclick="return toggle('Diagnostics.printDiagnostics');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#printDiagnostics">printDiagnostics</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fd</tt><tt class="py-op">=</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stdout</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.printDiagnostics-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.printDiagnostics-expanded"><a name="L939"></a><tt class="py-lineno"> 939</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L940"></a><tt class="py-lineno"> 940</tt> <tt class="py-line"><tt class="py-docstring"> Pretty-print diagnostic information to a file descriptor.</tt> </tt>
<a name="L941"></a><tt class="py-lineno"> 941</tt> <tt class="py-line"><tt class="py-docstring"> @param fd: File descriptor used to print information.</tt> </tt>
<a name="L942"></a><tt class="py-lineno"> 942</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix string (if any) to place onto printed lines</tt> </tt>
<a name="L943"></a><tt class="py-lineno"> 943</tt> <tt class="py-line"><tt class="py-docstring"> @note: The C{fd} is used rather than C{print} to facilitate unit testing.</tt> </tt>
<a name="L944"></a><tt class="py-lineno"> 944</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L945"></a><tt class="py-lineno"> 945</tt> <tt class="py-line"> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-165" class="py-name" targets="Method CedarBackup3.util.Diagnostics._buildDiagnosticLines()=CedarBackup3.util.Diagnostics-class.html#_buildDiagnosticLines"><a title="CedarBackup3.util.Diagnostics._buildDiagnosticLines" class="py-name" href="#" onclick="return doclink('link-165', '_buildDiagnosticLines', 'link-165');">_buildDiagnosticLines</a></tt><tt class="py-op">(</tt><tt class="py-name">prefix</tt><tt class="py-op">)</tt> </tt>
<a name="L946"></a><tt class="py-lineno"> 946</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
<a name="L947"></a><tt class="py-lineno"> 947</tt> <tt class="py-line"> <tt class="py-name">fd</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%s\n"</tt> <tt class="py-op">%</tt> <tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
</div><a name="L948"></a><tt class="py-lineno"> 948</tt> <tt class="py-line"> </tt>
<a name="Diagnostics.logDiagnostics"></a><div id="Diagnostics.logDiagnostics-def"><a name="L949"></a><tt class="py-lineno"> 949</tt> <a class="py-toggle" href="#" id="Diagnostics.logDiagnostics-toggle" onclick="return toggle('Diagnostics.logDiagnostics');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#logDiagnostics">logDiagnostics</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">method</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics.logDiagnostics-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics.logDiagnostics-expanded"><a name="L950"></a><tt class="py-lineno"> 950</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L951"></a><tt class="py-lineno"> 951</tt> <tt class="py-line"><tt class="py-docstring"> Pretty-print diagnostic information using a logger method.</tt> </tt>
<a name="L952"></a><tt class="py-lineno"> 952</tt> <tt class="py-line"><tt class="py-docstring"> @param method: Logger method to use for logging (i.e. logger.info)</tt> </tt>
<a name="L953"></a><tt class="py-lineno"> 953</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix string (if any) to place onto printed lines</tt> </tt>
<a name="L954"></a><tt class="py-lineno"> 954</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L955"></a><tt class="py-lineno"> 955</tt> <tt class="py-line"> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-166" class="py-name"><a title="CedarBackup3.util.Diagnostics._buildDiagnosticLines" class="py-name" href="#" onclick="return doclink('link-166', '_buildDiagnosticLines', 'link-165');">_buildDiagnosticLines</a></tt><tt class="py-op">(</tt><tt class="py-name">prefix</tt><tt class="py-op">)</tt> </tt>
<a name="L956"></a><tt class="py-lineno"> 956</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
<a name="L957"></a><tt class="py-lineno"> 957</tt> <tt class="py-line"> <tt class="py-name">method</tt><tt class="py-op">(</tt><tt class="py-string">"%s"</tt> <tt class="py-op">%</tt> <tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
</div><a name="L958"></a><tt class="py-lineno"> 958</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._buildDiagnosticLines"></a><div id="Diagnostics._buildDiagnosticLines-def"><a name="L959"></a><tt class="py-lineno"> 959</tt> <a class="py-toggle" href="#" id="Diagnostics._buildDiagnosticLines-toggle" onclick="return toggle('Diagnostics._buildDiagnosticLines');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_buildDiagnosticLines">_buildDiagnosticLines</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._buildDiagnosticLines-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._buildDiagnosticLines-expanded"><a name="L960"></a><tt class="py-lineno"> 960</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L961"></a><tt class="py-lineno"> 961</tt> <tt class="py-line"><tt class="py-docstring"> Build a set of pretty-printed diagnostic lines.</tt> </tt>
<a name="L962"></a><tt class="py-lineno"> 962</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix string (if any) to place onto printed lines</tt> </tt>
<a name="L963"></a><tt class="py-lineno"> 963</tt> <tt class="py-line"><tt class="py-docstring"> @return: List of strings, not terminated by newlines.</tt> </tt>
<a name="L964"></a><tt class="py-lineno"> 964</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L965"></a><tt class="py-lineno"> 965</tt> <tt class="py-line"> <tt class="py-name">values</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-167" class="py-name" targets="Method CedarBackup3.util.Diagnostics.getValues()=CedarBackup3.util.Diagnostics-class.html#getValues"><a title="CedarBackup3.util.Diagnostics.getValues" class="py-name" href="#" onclick="return doclink('link-167', 'getValues', 'link-167');">getValues</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L966"></a><tt class="py-lineno"> 966</tt> <tt class="py-line"> <tt class="py-name">keys</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L967"></a><tt class="py-lineno"> 967</tt> <tt class="py-line"> <tt class="py-name">keys</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L968"></a><tt class="py-lineno"> 968</tt> <tt class="py-line"> <tt class="py-name">tmax</tt> <tt class="py-op">=</tt> <tt id="link-168" class="py-name" targets="Class CedarBackup3.util.Diagnostics=CedarBackup3.util.Diagnostics-class.html"><a title="CedarBackup3.util.Diagnostics" class="py-name" href="#" onclick="return doclink('link-168', 'Diagnostics', 'link-168');">Diagnostics</a></tt><tt class="py-op">.</tt><tt id="link-169" class="py-name" targets="Static Method CedarBackup3.util.Diagnostics._getMaxLength()=CedarBackup3.util.Diagnostics-class.html#_getMaxLength"><a title="CedarBackup3.util.Diagnostics._getMaxLength" class="py-name" href="#" onclick="return doclink('link-169', '_getMaxLength', 'link-169');">_getMaxLength</a></tt><tt class="py-op">(</tt><tt class="py-name">keys</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-number">3</tt> <tt class="py-comment"># three extra dots in output</tt> </tt>
<a name="L969"></a><tt class="py-lineno"> 969</tt> <tt class="py-line"> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L970"></a><tt class="py-lineno"> 970</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keys</tt><tt class="py-op">:</tt> </tt>
<a name="L971"></a><tt class="py-lineno"> 971</tt> <tt class="py-line"> <tt class="py-name">title</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt><tt class="py-op">.</tt><tt class="py-name">title</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L972"></a><tt class="py-lineno"> 972</tt> <tt class="py-line"> <tt class="py-name">title</tt> <tt class="py-op">+=</tt> <tt class="py-op">(</tt><tt class="py-name">tmax</tt> <tt class="py-op">-</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">title</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-string">'.'</tt> </tt>
<a name="L973"></a><tt class="py-lineno"> 973</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
<a name="L974"></a><tt class="py-lineno"> 974</tt> <tt class="py-line"> <tt class="py-name">line</tt> <tt class="py-op">=</tt> <tt class="py-string">"%s%s: %s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">title</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L975"></a><tt class="py-lineno"> 975</tt> <tt class="py-line"> <tt class="py-name">lines</tt><tt class="py-op">.</tt><tt id="link-170" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-170', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L976"></a><tt class="py-lineno"> 976</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">lines</tt> </tt>
</div><a name="L977"></a><tt class="py-lineno"> 977</tt> <tt class="py-line"> </tt>
<a name="L978"></a><tt class="py-lineno"> 978</tt> <tt class="py-line"> <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Diagnostics._getMaxLength"></a><div id="Diagnostics._getMaxLength-def"><a name="L979"></a><tt class="py-lineno"> 979</tt> <a class="py-toggle" href="#" id="Diagnostics._getMaxLength-toggle" onclick="return toggle('Diagnostics._getMaxLength');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getMaxLength">_getMaxLength</a><tt class="py-op">(</tt><tt class="py-param">values</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getMaxLength-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getMaxLength-expanded"><a name="L980"></a><tt class="py-lineno"> 980</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L981"></a><tt class="py-lineno"> 981</tt> <tt class="py-line"><tt class="py-docstring"> Get the maximum length from among a list of strings.</tt> </tt>
<a name="L982"></a><tt class="py-lineno"> 982</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L983"></a><tt class="py-lineno"> 983</tt> <tt class="py-line"> <tt class="py-name">tmax</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L984"></a><tt class="py-lineno"> 984</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">values</tt><tt class="py-op">:</tt> </tt>
<a name="L985"></a><tt class="py-lineno"> 985</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> <tt class="py-op">></tt> <tt class="py-name">tmax</tt><tt class="py-op">:</tt> </tt>
<a name="L986"></a><tt class="py-lineno"> 986</tt> <tt class="py-line"> <tt class="py-name">tmax</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L987"></a><tt class="py-lineno"> 987</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">tmax</tt> </tt>
</div><a name="L988"></a><tt class="py-lineno"> 988</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getVersion"></a><div id="Diagnostics._getVersion-def"><a name="L989"></a><tt class="py-lineno"> 989</tt> <a class="py-toggle" href="#" id="Diagnostics._getVersion-toggle" onclick="return toggle('Diagnostics._getVersion');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getVersion">_getVersion</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getVersion-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getVersion-expanded"><a name="L990"></a><tt class="py-lineno"> 990</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L991"></a><tt class="py-lineno"> 991</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get the Cedar Backup version.</tt> </tt>
<a name="L992"></a><tt class="py-lineno"> 992</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L993"></a><tt class="py-lineno"> 993</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"Cedar Backup %s (%s)"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-171" class="py-name"><a title="CedarBackup3.release.VERSION" class="py-name" href="#" onclick="return doclink('link-171', 'VERSION', 'link-4');">VERSION</a></tt><tt class="py-op">,</tt> <tt id="link-172" class="py-name"><a title="CedarBackup3.release.DATE" class="py-name" href="#" onclick="return doclink('link-172', 'DATE', 'link-5');">DATE</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L994"></a><tt class="py-lineno"> 994</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getInterpreter"></a><div id="Diagnostics._getInterpreter-def"><a name="L995"></a><tt class="py-lineno"> 995</tt> <a class="py-toggle" href="#" id="Diagnostics._getInterpreter-toggle" onclick="return toggle('Diagnostics._getInterpreter');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getInterpreter">_getInterpreter</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getInterpreter-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getInterpreter-expanded"><a name="L996"></a><tt class="py-lineno"> 996</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L997"></a><tt class="py-lineno"> 997</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get the Python interpreter version.</tt> </tt>
<a name="L998"></a><tt class="py-lineno"> 998</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L999"></a><tt class="py-lineno"> 999</tt> <tt class="py-line"> <tt id="link-173" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-173', 'version', 'link-159');">version</a></tt> <tt class="py-op">=</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">version_info</tt> </tt>
<a name="L1000"></a><tt class="py-lineno">1000</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"Python %d.%d.%d (%s)"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-174" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-174', 'version', 'link-159');">version</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-175" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-175', 'version', 'link-159');">version</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-176" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-176', 'version', 'link-159');">version</a></tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-177" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-177', 'version', 'link-159');">version</a></tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1001"></a><tt class="py-lineno">1001</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getEncoding"></a><div id="Diagnostics._getEncoding-def"><a name="L1002"></a><tt class="py-lineno">1002</tt> <a class="py-toggle" href="#" id="Diagnostics._getEncoding-toggle" onclick="return toggle('Diagnostics._getEncoding');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getEncoding">_getEncoding</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getEncoding-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getEncoding-expanded"><a name="L1003"></a><tt class="py-lineno">1003</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1004"></a><tt class="py-lineno">1004</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get the filesystem encoding.</tt> </tt>
<a name="L1005"></a><tt class="py-lineno">1005</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1006"></a><tt class="py-lineno">1006</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">getfilesystemencoding</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">getdefaultencoding</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1007"></a><tt class="py-lineno">1007</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getPlatform"></a><div id="Diagnostics._getPlatform-def"><a name="L1008"></a><tt class="py-lineno">1008</tt> <a class="py-toggle" href="#" id="Diagnostics._getPlatform-toggle" onclick="return toggle('Diagnostics._getPlatform');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getPlatform">_getPlatform</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getPlatform-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getPlatform-expanded"><a name="L1009"></a><tt class="py-lineno">1009</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1010"></a><tt class="py-lineno">1010</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get the operating system platform.</tt> </tt>
<a name="L1011"></a><tt class="py-lineno">1011</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1012"></a><tt class="py-lineno">1012</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1013"></a><tt class="py-lineno">1013</tt> <tt class="py-line"> <tt class="py-name">uname</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">uname</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1014"></a><tt class="py-lineno">1014</tt> <tt class="py-line"> <tt class="py-name">sysname</tt> <tt class="py-op">=</tt> <tt class="py-name">uname</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-comment"># i.e. Linux</tt> </tt>
<a name="L1015"></a><tt class="py-lineno">1015</tt> <tt class="py-line"> <tt id="link-178" class="py-name"><a title="CedarBackup3.release" class="py-name" href="#" onclick="return doclink('link-178', 'release', 'link-3');">release</a></tt> <tt class="py-op">=</tt> <tt class="py-name">uname</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-comment"># i.e. 2.16.18-2</tt> </tt>
<a name="L1016"></a><tt class="py-lineno">1016</tt> <tt class="py-line"> <tt class="py-name">machine</tt> <tt class="py-op">=</tt> <tt class="py-name">uname</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt> <tt class="py-comment"># i.e. i686</tt> </tt>
<a name="L1017"></a><tt class="py-lineno">1017</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"%s (%s %s %s)"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt id="link-179" class="py-name"><a title="CedarBackup3.util.Diagnostics.platform" class="py-name" href="#" onclick="return doclink('link-179', 'platform', 'link-161');">platform</a></tt><tt class="py-op">,</tt> <tt class="py-name">sysname</tt><tt class="py-op">,</tt> <tt id="link-180" class="py-name"><a title="CedarBackup3.release" class="py-name" href="#" onclick="return doclink('link-180', 'release', 'link-3');">release</a></tt><tt class="py-op">,</tt> <tt class="py-name">machine</tt><tt class="py-op">)</tt> </tt>
<a name="L1018"></a><tt class="py-lineno">1018</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L1019"></a><tt class="py-lineno">1019</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt id="link-181" class="py-name"><a title="CedarBackup3.util.Diagnostics.platform" class="py-name" href="#" onclick="return doclink('link-181', 'platform', 'link-161');">platform</a></tt> </tt>
</div><a name="L1020"></a><tt class="py-lineno">1020</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getLocale"></a><div id="Diagnostics._getLocale-def"><a name="L1021"></a><tt class="py-lineno">1021</tt> <a class="py-toggle" href="#" id="Diagnostics._getLocale-toggle" onclick="return toggle('Diagnostics._getLocale');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getLocale">_getLocale</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getLocale-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getLocale-expanded"><a name="L1022"></a><tt class="py-lineno">1022</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1023"></a><tt class="py-lineno">1023</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get the default locale that is in effect.</tt> </tt>
<a name="L1024"></a><tt class="py-lineno">1024</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1025"></a><tt class="py-lineno">1025</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1026"></a><tt class="py-lineno">1026</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt id="link-182" class="py-name"><a title="CedarBackup3.util.Diagnostics.locale" class="py-name" href="#" onclick="return doclink('link-182', 'locale', 'link-163');">locale</a></tt> </tt>
<a name="L1027"></a><tt class="py-lineno">1027</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-183" class="py-name"><a title="CedarBackup3.util.Diagnostics.locale" class="py-name" href="#" onclick="return doclink('link-183', 'locale', 'link-163');">locale</a></tt><tt class="py-op">.</tt><tt class="py-name">getdefaultlocale</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1028"></a><tt class="py-lineno">1028</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L1029"></a><tt class="py-lineno">1029</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"(unknown)"</tt> </tt>
</div><a name="L1030"></a><tt class="py-lineno">1030</tt> <tt class="py-line"> </tt>
<a name="Diagnostics._getTimestamp"></a><div id="Diagnostics._getTimestamp-def"><a name="L1031"></a><tt class="py-lineno">1031</tt> <a class="py-toggle" href="#" id="Diagnostics._getTimestamp-toggle" onclick="return toggle('Diagnostics._getTimestamp');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util.Diagnostics-class.html#_getTimestamp">_getTimestamp</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Diagnostics._getTimestamp-collapsed" style="display:none;" pad="++++" indent="+++++++"></div><div id="Diagnostics._getTimestamp-expanded"><a name="L1032"></a><tt class="py-lineno">1032</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1033"></a><tt class="py-lineno">1033</tt> <tt class="py-line"><tt class="py-docstring"> Property target to get a current date/time stamp.</tt> </tt>
<a name="L1034"></a><tt class="py-lineno">1034</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1035"></a><tt class="py-lineno">1035</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1036"></a><tt class="py-lineno">1036</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">datetime</tt> </tt>
<a name="L1037"></a><tt class="py-lineno">1037</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">utcnow</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">ctime</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">" UTC"</tt> </tt>
<a name="L1038"></a><tt class="py-lineno">1038</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L1039"></a><tt class="py-lineno">1039</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"(unknown)"</tt> </tt>
</div><a name="L1040"></a><tt class="py-lineno">1040</tt> <tt class="py-line"> </tt>
<a name="L1041"></a><tt class="py-lineno">1041</tt> <tt class="py-line"> <tt id="link-184" class="py-name"><a title="CedarBackup3.cli.Options.version
CedarBackup3.tools.amazons3.Options.version
CedarBackup3.util.Diagnostics.version" class="py-name" href="#" onclick="return doclink('link-184', 'version', 'link-159');">version</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-185" class="py-name" targets="Method CedarBackup3.cli.Options._getVersion()=CedarBackup3.cli.Options-class.html#_getVersion,Method CedarBackup3.tools.amazons3.Options._getVersion()=CedarBackup3.tools.amazons3.Options-class.html#_getVersion,Method CedarBackup3.util.Diagnostics._getVersion()=CedarBackup3.util.Diagnostics-class.html#_getVersion"><a title="CedarBackup3.cli.Options._getVersion
CedarBackup3.tools.amazons3.Options._getVersion
CedarBackup3.util.Diagnostics._getVersion" class="py-name" href="#" onclick="return doclink('link-185', '_getVersion', 'link-185');">_getVersion</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Cedar Backup version."</tt><tt class="py-op">)</tt> </tt>
<a name="L1042"></a><tt class="py-lineno">1042</tt> <tt class="py-line"> <tt id="link-186" class="py-name"><a title="CedarBackup3.util.Diagnostics.interpreter" class="py-name" href="#" onclick="return doclink('link-186', 'interpreter', 'link-160');">interpreter</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-187" class="py-name" targets="Method CedarBackup3.util.Diagnostics._getInterpreter()=CedarBackup3.util.Diagnostics-class.html#_getInterpreter"><a title="CedarBackup3.util.Diagnostics._getInterpreter" class="py-name" href="#" onclick="return doclink('link-187', '_getInterpreter', 'link-187');">_getInterpreter</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Python interpreter version."</tt><tt class="py-op">)</tt> </tt>
<a name="L1043"></a><tt class="py-lineno">1043</tt> <tt class="py-line"> <tt id="link-188" class="py-name"><a title="CedarBackup3.util.Diagnostics.platform" class="py-name" href="#" onclick="return doclink('link-188', 'platform', 'link-161');">platform</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-189" class="py-name" targets="Method CedarBackup3.util.Diagnostics._getPlatform()=CedarBackup3.util.Diagnostics-class.html#_getPlatform"><a title="CedarBackup3.util.Diagnostics._getPlatform" class="py-name" href="#" onclick="return doclink('link-189', '_getPlatform', 'link-189');">_getPlatform</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Platform identifying information."</tt><tt class="py-op">)</tt> </tt>
<a name="L1044"></a><tt class="py-lineno">1044</tt> <tt class="py-line"> <tt id="link-190" class="py-name"><a title="CedarBackup3.util.Diagnostics.encoding" class="py-name" href="#" onclick="return doclink('link-190', 'encoding', 'link-162');">encoding</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-191" class="py-name" targets="Method CedarBackup3.util.Diagnostics._getEncoding()=CedarBackup3.util.Diagnostics-class.html#_getEncoding"><a title="CedarBackup3.util.Diagnostics._getEncoding" class="py-name" href="#" onclick="return doclink('link-191', '_getEncoding', 'link-191');">_getEncoding</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Filesystem encoding that is in effect."</tt><tt class="py-op">)</tt> </tt>
<a name="L1045"></a><tt class="py-lineno">1045</tt> <tt class="py-line"> <tt id="link-192" class="py-name"><a title="CedarBackup3.util.Diagnostics.locale" class="py-name" href="#" onclick="return doclink('link-192', 'locale', 'link-163');">locale</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-193" class="py-name" targets="Method CedarBackup3.util.Diagnostics._getLocale()=CedarBackup3.util.Diagnostics-class.html#_getLocale"><a title="CedarBackup3.util.Diagnostics._getLocale" class="py-name" href="#" onclick="return doclink('link-193', '_getLocale', 'link-193');">_getLocale</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Locale that is in effect."</tt><tt class="py-op">)</tt> </tt>
<a name="L1046"></a><tt class="py-lineno">1046</tt> <tt class="py-line"> <tt id="link-194" class="py-name"><a title="CedarBackup3.util.Diagnostics.timestamp" class="py-name" href="#" onclick="return doclink('link-194', 'timestamp', 'link-164');">timestamp</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-195" class="py-name" targets="Method CedarBackup3.util.Diagnostics._getTimestamp()=CedarBackup3.util.Diagnostics-class.html#_getTimestamp"><a title="CedarBackup3.util.Diagnostics._getTimestamp" class="py-name" href="#" onclick="return doclink('link-195', '_getTimestamp', 'link-195');">_getTimestamp</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"Current timestamp."</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1047"></a><tt class="py-lineno">1047</tt> <tt class="py-line"> </tt>
<a name="sortDict"></a><div id="sortDict-def"><a name="L1048"></a><tt class="py-lineno">1048</tt> <tt class="py-line"> </tt>
<a name="L1049"></a><tt class="py-lineno">1049</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L1050"></a><tt class="py-lineno">1050</tt> <tt class="py-line"><tt class="py-comment"># General utility functions</tt> </tt>
<a name="L1051"></a><tt class="py-lineno">1051</tt> <tt class="py-line"><tt class="py-comment">########################################################################</tt> </tt>
<a name="L1052"></a><tt class="py-lineno">1052</tt> <tt class="py-line"> </tt>
<a name="L1053"></a><tt class="py-lineno">1053</tt> <tt class="py-line"><tt class="py-comment">######################</tt> </tt>
<a name="L1054"></a><tt class="py-lineno">1054</tt> <tt class="py-line"><tt class="py-comment"># sortDict() function</tt> </tt>
<a name="L1055"></a><tt class="py-lineno">1055</tt> <tt class="py-line"><tt class="py-comment">######################</tt> </tt>
<a name="L1056"></a><tt class="py-lineno">1056</tt> <tt class="py-line"> </tt>
<a name="L1057"></a><tt class="py-lineno">1057</tt> <a class="py-toggle" href="#" id="sortDict-toggle" onclick="return toggle('sortDict');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#sortDict">sortDict</a><tt class="py-op">(</tt><tt class="py-param">d</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sortDict-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="sortDict-expanded"><a name="L1058"></a><tt class="py-lineno">1058</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1059"></a><tt class="py-lineno">1059</tt> <tt class="py-line"><tt class="py-docstring"> Returns the keys of the dictionary sorted by value.</tt> </tt>
<a name="L1060"></a><tt class="py-lineno">1060</tt> <tt class="py-line"><tt class="py-docstring"> @param d: Dictionary to operate on</tt> </tt>
<a name="L1061"></a><tt class="py-lineno">1061</tt> <tt class="py-line"><tt class="py-docstring"> @return: List of dictionary keys sorted in order by dictionary value.</tt> </tt>
<a name="L1062"></a><tt class="py-lineno">1062</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1063"></a><tt class="py-lineno">1063</tt> <tt class="py-line"> <tt class="py-name">items</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1064"></a><tt class="py-lineno">1064</tt> <tt class="py-line"> <tt class="py-name">items</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">=</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">x</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">x</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-comment"># sort by value and then by key</tt> </tt>
<a name="L1065"></a><tt class="py-lineno">1065</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">key</tt> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">items</tt><tt class="py-op">]</tt> </tt>
</div><a name="L1066"></a><tt class="py-lineno">1066</tt> <tt class="py-line"> </tt>
<a name="removeKeys"></a><div id="removeKeys-def"><a name="L1067"></a><tt class="py-lineno">1067</tt> <tt class="py-line"> </tt>
<a name="L1068"></a><tt class="py-lineno">1068</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1069"></a><tt class="py-lineno">1069</tt> <tt class="py-line"><tt class="py-comment"># removeKeys() function</tt> </tt>
<a name="L1070"></a><tt class="py-lineno">1070</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1071"></a><tt class="py-lineno">1071</tt> <tt class="py-line"> </tt>
<a name="L1072"></a><tt class="py-lineno">1072</tt> <a class="py-toggle" href="#" id="removeKeys-toggle" onclick="return toggle('removeKeys');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#removeKeys">removeKeys</a><tt class="py-op">(</tt><tt class="py-param">d</tt><tt class="py-op">,</tt> <tt class="py-param">keys</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="removeKeys-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="removeKeys-expanded"><a name="L1073"></a><tt class="py-lineno">1073</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1074"></a><tt class="py-lineno">1074</tt> <tt class="py-line"><tt class="py-docstring"> Removes all of the keys from the dictionary.</tt> </tt>
<a name="L1075"></a><tt class="py-lineno">1075</tt> <tt class="py-line"><tt class="py-docstring"> The dictionary is altered in-place.</tt> </tt>
<a name="L1076"></a><tt class="py-lineno">1076</tt> <tt class="py-line"><tt class="py-docstring"> Each key must exist in the dictionary.</tt> </tt>
<a name="L1077"></a><tt class="py-lineno">1077</tt> <tt class="py-line"><tt class="py-docstring"> @param d: Dictionary to operate on</tt> </tt>
<a name="L1078"></a><tt class="py-lineno">1078</tt> <tt class="py-line"><tt class="py-docstring"> @param keys: List of keys to remove</tt> </tt>
<a name="L1079"></a><tt class="py-lineno">1079</tt> <tt class="py-line"><tt class="py-docstring"> @raise KeyError: If one of the keys does not exist</tt> </tt>
<a name="L1080"></a><tt class="py-lineno">1080</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1081"></a><tt class="py-lineno">1081</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keys</tt><tt class="py-op">:</tt> </tt>
<a name="L1082"></a><tt class="py-lineno">1082</tt> <tt class="py-line"> <tt class="py-keyword">del</tt> <tt class="py-name">d</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
</div><a name="L1083"></a><tt class="py-lineno">1083</tt> <tt class="py-line"> </tt>
<a name="convertSize"></a><div id="convertSize-def"><a name="L1084"></a><tt class="py-lineno">1084</tt> <tt class="py-line"> </tt>
<a name="L1085"></a><tt class="py-lineno">1085</tt> <tt class="py-line"><tt class="py-comment">#########################</tt> </tt>
<a name="L1086"></a><tt class="py-lineno">1086</tt> <tt class="py-line"><tt class="py-comment"># convertSize() function</tt> </tt>
<a name="L1087"></a><tt class="py-lineno">1087</tt> <tt class="py-line"><tt class="py-comment">#########################</tt> </tt>
<a name="L1088"></a><tt class="py-lineno">1088</tt> <tt class="py-line"> </tt>
<a name="L1089"></a><tt class="py-lineno">1089</tt> <a class="py-toggle" href="#" id="convertSize-toggle" onclick="return toggle('convertSize');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#convertSize">convertSize</a><tt class="py-op">(</tt><tt class="py-param">size</tt><tt class="py-op">,</tt> <tt class="py-param">fromUnit</tt><tt class="py-op">,</tt> <tt class="py-param">toUnit</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="convertSize-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="convertSize-expanded"><a name="L1090"></a><tt class="py-lineno">1090</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1091"></a><tt class="py-lineno">1091</tt> <tt class="py-line"><tt class="py-docstring"> Converts a size in one unit to a size in another unit.</tt> </tt>
<a name="L1092"></a><tt class="py-lineno">1092</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1093"></a><tt class="py-lineno">1093</tt> <tt class="py-line"><tt class="py-docstring"> This is just a convenience function so that the functionality can be</tt> </tt>
<a name="L1094"></a><tt class="py-lineno">1094</tt> <tt class="py-line"><tt class="py-docstring"> implemented in just one place. Internally, we convert values to bytes and</tt> </tt>
<a name="L1095"></a><tt class="py-lineno">1095</tt> <tt class="py-line"><tt class="py-docstring"> then to the final unit.</tt> </tt>
<a name="L1096"></a><tt class="py-lineno">1096</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1097"></a><tt class="py-lineno">1097</tt> <tt class="py-line"><tt class="py-docstring"> The available units are:</tt> </tt>
<a name="L1098"></a><tt class="py-lineno">1098</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1099"></a><tt class="py-lineno">1099</tt> <tt class="py-line"><tt class="py-docstring"> - C{UNIT_BYTES} - Bytes</tt> </tt>
<a name="L1100"></a><tt class="py-lineno">1100</tt> <tt class="py-line"><tt class="py-docstring"> - C{UNIT_KBYTES} - Kilobytes, where 1 kB = 1024 B</tt> </tt>
<a name="L1101"></a><tt class="py-lineno">1101</tt> <tt class="py-line"><tt class="py-docstring"> - C{UNIT_MBYTES} - Megabytes, where 1 MB = 1024 kB</tt> </tt>
<a name="L1102"></a><tt class="py-lineno">1102</tt> <tt class="py-line"><tt class="py-docstring"> - C{UNIT_GBYTES} - Gigabytes, where 1 GB = 1024 MB</tt> </tt>
<a name="L1103"></a><tt class="py-lineno">1103</tt> <tt class="py-line"><tt class="py-docstring"> - C{UNIT_SECTORS} - Sectors, where 1 sector = 2048 B</tt> </tt>
<a name="L1104"></a><tt class="py-lineno">1104</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1105"></a><tt class="py-lineno">1105</tt> <tt class="py-line"><tt class="py-docstring"> @param size: Size to convert</tt> </tt>
<a name="L1106"></a><tt class="py-lineno">1106</tt> <tt class="py-line"><tt class="py-docstring"> @type size: Integer or float value in units of C{fromUnit}</tt> </tt>
<a name="L1107"></a><tt class="py-lineno">1107</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1108"></a><tt class="py-lineno">1108</tt> <tt class="py-line"><tt class="py-docstring"> @param fromUnit: Unit to convert from</tt> </tt>
<a name="L1109"></a><tt class="py-lineno">1109</tt> <tt class="py-line"><tt class="py-docstring"> @type fromUnit: One of the units listed above</tt> </tt>
<a name="L1110"></a><tt class="py-lineno">1110</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1111"></a><tt class="py-lineno">1111</tt> <tt class="py-line"><tt class="py-docstring"> @param toUnit: Unit to convert to</tt> </tt>
<a name="L1112"></a><tt class="py-lineno">1112</tt> <tt class="py-line"><tt class="py-docstring"> @type toUnit: One of the units listed above</tt> </tt>
<a name="L1113"></a><tt class="py-lineno">1113</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1114"></a><tt class="py-lineno">1114</tt> <tt class="py-line"><tt class="py-docstring"> @return: Number converted to new unit, as a float.</tt> </tt>
<a name="L1115"></a><tt class="py-lineno">1115</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If one of the units is invalid.</tt> </tt>
<a name="L1116"></a><tt class="py-lineno">1116</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1117"></a><tt class="py-lineno">1117</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">size</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1118"></a><tt class="py-lineno">1118</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot convert size of None."</tt><tt class="py-op">)</tt> </tt>
<a name="L1119"></a><tt class="py-lineno">1119</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">fromUnit</tt> <tt class="py-op">==</tt> <tt id="link-196" class="py-name"><a title="CedarBackup3.util.UNIT_BYTES" class="py-name" href="#" onclick="return doclink('link-196', 'UNIT_BYTES', 'link-27');">UNIT_BYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1120"></a><tt class="py-lineno">1120</tt> <tt class="py-line"> <tt class="py-name">byteSize</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> </tt>
<a name="L1121"></a><tt class="py-lineno">1121</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">fromUnit</tt> <tt class="py-op">==</tt> <tt id="link-197" class="py-name"><a title="CedarBackup3.util.UNIT_KBYTES" class="py-name" href="#" onclick="return doclink('link-197', 'UNIT_KBYTES', 'link-28');">UNIT_KBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1122"></a><tt class="py-lineno">1122</tt> <tt class="py-line"> <tt class="py-name">byteSize</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt id="link-198" class="py-name"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-198', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt> </tt>
<a name="L1123"></a><tt class="py-lineno">1123</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">fromUnit</tt> <tt class="py-op">==</tt> <tt id="link-199" class="py-name"><a title="CedarBackup3.util.UNIT_MBYTES" class="py-name" href="#" onclick="return doclink('link-199', 'UNIT_MBYTES', 'link-29');">UNIT_MBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1124"></a><tt class="py-lineno">1124</tt> <tt class="py-line"> <tt class="py-name">byteSize</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt id="link-200" class="py-name"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-200', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt> </tt>
<a name="L1125"></a><tt class="py-lineno">1125</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">fromUnit</tt> <tt class="py-op">==</tt> <tt id="link-201" class="py-name"><a title="CedarBackup3.util.UNIT_GBYTES" class="py-name" href="#" onclick="return doclink('link-201', 'UNIT_GBYTES', 'link-30');">UNIT_GBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1126"></a><tt class="py-lineno">1126</tt> <tt class="py-line"> <tt class="py-name">byteSize</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt id="link-202" class="py-name"><a title="CedarBackup3.util.BYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-202', 'BYTES_PER_GBYTE', 'link-17');">BYTES_PER_GBYTE</a></tt> </tt>
<a name="L1127"></a><tt class="py-lineno">1127</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">fromUnit</tt> <tt class="py-op">==</tt> <tt id="link-203" class="py-name"><a title="CedarBackup3.util.UNIT_SECTORS" class="py-name" href="#" onclick="return doclink('link-203', 'UNIT_SECTORS', 'link-31');">UNIT_SECTORS</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1128"></a><tt class="py-lineno">1128</tt> <tt class="py-line"> <tt class="py-name">byteSize</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt id="link-204" class="py-name"><a title="CedarBackup3.util.BYTES_PER_SECTOR" class="py-name" href="#" onclick="return doclink('link-204', 'BYTES_PER_SECTOR', 'link-9');">BYTES_PER_SECTOR</a></tt> </tt>
<a name="L1129"></a><tt class="py-lineno">1129</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1130"></a><tt class="py-lineno">1130</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Unknown 'from' unit %s."</tt> <tt class="py-op">%</tt> <tt class="py-name">fromUnit</tt><tt class="py-op">)</tt> </tt>
<a name="L1131"></a><tt class="py-lineno">1131</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">toUnit</tt> <tt class="py-op">==</tt> <tt id="link-205" class="py-name"><a title="CedarBackup3.util.UNIT_BYTES" class="py-name" href="#" onclick="return doclink('link-205', 'UNIT_BYTES', 'link-27');">UNIT_BYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1132"></a><tt class="py-lineno">1132</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">byteSize</tt> </tt>
<a name="L1133"></a><tt class="py-lineno">1133</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">toUnit</tt> <tt class="py-op">==</tt> <tt id="link-206" class="py-name"><a title="CedarBackup3.util.UNIT_KBYTES" class="py-name" href="#" onclick="return doclink('link-206', 'UNIT_KBYTES', 'link-28');">UNIT_KBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1134"></a><tt class="py-lineno">1134</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">byteSize</tt> <tt class="py-op">/</tt> <tt id="link-207" class="py-name"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-207', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt> </tt>
<a name="L1135"></a><tt class="py-lineno">1135</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">toUnit</tt> <tt class="py-op">==</tt> <tt id="link-208" class="py-name"><a title="CedarBackup3.util.UNIT_MBYTES" class="py-name" href="#" onclick="return doclink('link-208', 'UNIT_MBYTES', 'link-29');">UNIT_MBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1136"></a><tt class="py-lineno">1136</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">byteSize</tt> <tt class="py-op">/</tt> <tt id="link-209" class="py-name"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-209', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt> </tt>
<a name="L1137"></a><tt class="py-lineno">1137</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">toUnit</tt> <tt class="py-op">==</tt> <tt id="link-210" class="py-name"><a title="CedarBackup3.util.UNIT_GBYTES" class="py-name" href="#" onclick="return doclink('link-210', 'UNIT_GBYTES', 'link-30');">UNIT_GBYTES</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1138"></a><tt class="py-lineno">1138</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">byteSize</tt> <tt class="py-op">/</tt> <tt id="link-211" class="py-name"><a title="CedarBackup3.util.BYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-211', 'BYTES_PER_GBYTE', 'link-17');">BYTES_PER_GBYTE</a></tt> </tt>
<a name="L1139"></a><tt class="py-lineno">1139</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">toUnit</tt> <tt class="py-op">==</tt> <tt id="link-212" class="py-name"><a title="CedarBackup3.util.UNIT_SECTORS" class="py-name" href="#" onclick="return doclink('link-212', 'UNIT_SECTORS', 'link-31');">UNIT_SECTORS</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1140"></a><tt class="py-lineno">1140</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">byteSize</tt> <tt class="py-op">/</tt> <tt id="link-213" class="py-name"><a title="CedarBackup3.util.BYTES_PER_SECTOR" class="py-name" href="#" onclick="return doclink('link-213', 'BYTES_PER_SECTOR', 'link-9');">BYTES_PER_SECTOR</a></tt> </tt>
<a name="L1141"></a><tt class="py-lineno">1141</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1142"></a><tt class="py-lineno">1142</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Unknown 'to' unit %s."</tt> <tt class="py-op">%</tt> <tt class="py-name">toUnit</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1143"></a><tt class="py-lineno">1143</tt> <tt class="py-line"> </tt>
<a name="displayBytes"></a><div id="displayBytes-def"><a name="L1144"></a><tt class="py-lineno">1144</tt> <tt class="py-line"> </tt>
<a name="L1145"></a><tt class="py-lineno">1145</tt> <tt class="py-line"><tt class="py-comment">##########################</tt> </tt>
<a name="L1146"></a><tt class="py-lineno">1146</tt> <tt class="py-line"><tt class="py-comment"># displayBytes() function</tt> </tt>
<a name="L1147"></a><tt class="py-lineno">1147</tt> <tt class="py-line"><tt class="py-comment">##########################</tt> </tt>
<a name="L1148"></a><tt class="py-lineno">1148</tt> <tt class="py-line"> </tt>
<a name="L1149"></a><tt class="py-lineno">1149</tt> <a class="py-toggle" href="#" id="displayBytes-toggle" onclick="return toggle('displayBytes');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#displayBytes">displayBytes</a><tt class="py-op">(</tt><tt class="py-param">bytes</tt><tt class="py-op">,</tt> <tt class="py-param">digits</tt><tt class="py-op">=</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment"># pylint: disable=W0622</tt> </tt>
</div><a name="L1150"></a><tt class="py-lineno">1150</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1151"></a><tt class="py-lineno">1151</tt> <tt class="py-line"><tt class="py-docstring"> Format a byte quantity so it can be sensibly displayed.</tt> </tt>
<a name="L1152"></a><tt class="py-lineno">1152</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1153"></a><tt class="py-lineno">1153</tt> <tt class="py-line"><tt class="py-docstring"> It's rather difficult to look at a number like "72372224 bytes" and get any</tt> </tt>
<a name="L1154"></a><tt class="py-lineno">1154</tt> <tt class="py-line"><tt class="py-docstring"> meaningful information out of it. It would be more useful to see something</tt> </tt>
<a name="L1155"></a><tt class="py-lineno">1155</tt> <tt class="py-line"><tt class="py-docstring"> like "69.02 MB". That's what this function does. Any time you want to display</tt> </tt>
<a name="L1156"></a><tt class="py-lineno">1156</tt> <tt class="py-line"><tt class="py-docstring"> a byte value, i.e.::</tt> </tt>
<a name="L1157"></a><tt class="py-lineno">1157</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1158"></a><tt class="py-lineno">1158</tt> <tt class="py-line"><tt class="py-docstring"> print "Size: %s bytes" % bytes</tt> </tt>
<a name="L1159"></a><tt class="py-lineno">1159</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1160"></a><tt class="py-lineno">1160</tt> <tt class="py-line"><tt class="py-docstring"> Call this function instead::</tt> </tt>
<a name="L1161"></a><tt class="py-lineno">1161</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1162"></a><tt class="py-lineno">1162</tt> <tt class="py-line"><tt class="py-docstring"> print "Size: %s" % displayBytes(bytes)</tt> </tt>
<a name="L1163"></a><tt class="py-lineno">1163</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1164"></a><tt class="py-lineno">1164</tt> <tt class="py-line"><tt class="py-docstring"> What comes out will be sensibly formatted. The indicated number of digits</tt> </tt>
<a name="L1165"></a><tt class="py-lineno">1165</tt> <tt class="py-line"><tt class="py-docstring"> will be listed after the decimal point, rounded based on whatever rules are</tt> </tt>
<a name="L1166"></a><tt class="py-lineno">1166</tt> <tt class="py-line"><tt class="py-docstring"> used by Python's standard C{%f} string format specifier. (Values less than 1</tt> </tt>
<a name="L1167"></a><tt class="py-lineno">1167</tt> <tt class="py-line"><tt class="py-docstring"> kB will be listed in bytes and will not have a decimal point, since the</tt> </tt>
<a name="L1168"></a><tt class="py-lineno">1168</tt> <tt class="py-line"><tt class="py-docstring"> concept of a fractional byte is nonsensical.)</tt> </tt>
<a name="L1169"></a><tt class="py-lineno">1169</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1170"></a><tt class="py-lineno">1170</tt> <tt class="py-line"><tt class="py-docstring"> @param bytes: Byte quantity.</tt> </tt>
<a name="L1171"></a><tt class="py-lineno">1171</tt> <tt class="py-line"><tt class="py-docstring"> @type bytes: Integer number of bytes.</tt> </tt>
<a name="L1172"></a><tt class="py-lineno">1172</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1173"></a><tt class="py-lineno">1173</tt> <tt class="py-line"><tt class="py-docstring"> @param digits: Number of digits to display after the decimal point.</tt> </tt>
<a name="L1174"></a><tt class="py-lineno">1174</tt> <tt class="py-line"><tt class="py-docstring"> @type digits: Integer value, typically 2-5.</tt> </tt>
<a name="L1175"></a><tt class="py-lineno">1175</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1176"></a><tt class="py-lineno">1176</tt> <tt class="py-line"><tt class="py-docstring"> @return: String, formatted for sensible display.</tt> </tt>
<a name="L1177"></a><tt class="py-lineno">1177</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1178"></a><tt class="py-lineno">1178</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-214" class="py-name" targets="Variable CedarBackup3.config.ByteQuantity.bytes=CedarBackup3.config.ByteQuantity-class.html#bytes"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-214', 'bytes', 'link-214');">bytes</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1179"></a><tt class="py-lineno">1179</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot display byte value of None."</tt><tt class="py-op">)</tt> </tt>
<a name="L1180"></a><tt class="py-lineno">1180</tt> <tt class="py-line"> <tt id="link-215" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-215', 'bytes', 'link-214');">bytes</a></tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-216" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-216', 'bytes', 'link-214');">bytes</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1181"></a><tt class="py-lineno">1181</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt id="link-217" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-217', 'bytes', 'link-214');">bytes</a></tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt id="link-218" class="py-name"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-218', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1182"></a><tt class="py-lineno">1182</tt> <tt class="py-line"> <tt class="py-name">fmt</tt> <tt class="py-op">=</tt> <tt class="py-string">"%.0f bytes"</tt> </tt>
<a name="L1183"></a><tt class="py-lineno">1183</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt id="link-219" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-219', 'bytes', 'link-214');">bytes</a></tt> </tt>
<a name="L1184"></a><tt class="py-lineno">1184</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt id="link-220" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-220', 'bytes', 'link-214');">bytes</a></tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt id="link-221" class="py-name"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-221', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1185"></a><tt class="py-lineno">1185</tt> <tt class="py-line"> <tt class="py-name">fmt</tt> <tt class="py-op">=</tt> <tt class="py-string">"%."</tt> <tt class="py-op">+</tt> <tt class="py-string">"%d"</tt> <tt class="py-op">%</tt> <tt class="py-name">digits</tt> <tt class="py-op">+</tt> <tt class="py-string">"f kB"</tt> </tt>
<a name="L1186"></a><tt class="py-lineno">1186</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt id="link-222" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-222', 'bytes', 'link-214');">bytes</a></tt> <tt class="py-op">/</tt> <tt id="link-223" class="py-name"><a title="CedarBackup3.util.BYTES_PER_KBYTE" class="py-name" href="#" onclick="return doclink('link-223', 'BYTES_PER_KBYTE', 'link-11');">BYTES_PER_KBYTE</a></tt> </tt>
<a name="L1187"></a><tt class="py-lineno">1187</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt id="link-224" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-224', 'bytes', 'link-214');">bytes</a></tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt id="link-225" class="py-name"><a title="CedarBackup3.util.BYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-225', 'BYTES_PER_GBYTE', 'link-17');">BYTES_PER_GBYTE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1188"></a><tt class="py-lineno">1188</tt> <tt class="py-line"> <tt class="py-name">fmt</tt> <tt class="py-op">=</tt> <tt class="py-string">"%."</tt> <tt class="py-op">+</tt> <tt class="py-string">"%d"</tt> <tt class="py-op">%</tt> <tt class="py-name">digits</tt> <tt class="py-op">+</tt> <tt class="py-string">"f MB"</tt> </tt>
<a name="L1189"></a><tt class="py-lineno">1189</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt id="link-226" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-226', 'bytes', 'link-214');">bytes</a></tt> <tt class="py-op">/</tt> <tt id="link-227" class="py-name"><a title="CedarBackup3.util.BYTES_PER_MBYTE" class="py-name" href="#" onclick="return doclink('link-227', 'BYTES_PER_MBYTE', 'link-14');">BYTES_PER_MBYTE</a></tt> </tt>
<a name="L1190"></a><tt class="py-lineno">1190</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1191"></a><tt class="py-lineno">1191</tt> <tt class="py-line"> <tt class="py-name">fmt</tt> <tt class="py-op">=</tt> <tt class="py-string">"%."</tt> <tt class="py-op">+</tt> <tt class="py-string">"%d"</tt> <tt class="py-op">%</tt> <tt class="py-name">digits</tt> <tt class="py-op">+</tt> <tt class="py-string">"f GB"</tt> </tt>
<a name="L1192"></a><tt class="py-lineno">1192</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt id="link-228" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-228', 'bytes', 'link-214');">bytes</a></tt> <tt class="py-op">/</tt> <tt id="link-229" class="py-name"><a title="CedarBackup3.util.BYTES_PER_GBYTE" class="py-name" href="#" onclick="return doclink('link-229', 'BYTES_PER_GBYTE', 'link-17');">BYTES_PER_GBYTE</a></tt> </tt>
<a name="L1193"></a><tt class="py-lineno">1193</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">fmt</tt> <tt class="py-op">%</tt> <tt class="py-name">value</tt> </tt>
</div><a name="L1194"></a><tt class="py-lineno">1194</tt> <tt class="py-line"> </tt>
<a name="getFunctionReference"></a><div id="getFunctionReference-def"><a name="L1195"></a><tt class="py-lineno">1195</tt> <tt class="py-line"> </tt>
<a name="L1196"></a><tt class="py-lineno">1196</tt> <tt class="py-line"><tt class="py-comment">##################################</tt> </tt>
<a name="L1197"></a><tt class="py-lineno">1197</tt> <tt class="py-line"><tt class="py-comment"># getFunctionReference() function</tt> </tt>
<a name="L1198"></a><tt class="py-lineno">1198</tt> <tt class="py-line"><tt class="py-comment">##################################</tt> </tt>
<a name="L1199"></a><tt class="py-lineno">1199</tt> <tt class="py-line"> </tt>
<a name="L1200"></a><tt class="py-lineno">1200</tt> <a class="py-toggle" href="#" id="getFunctionReference-toggle" onclick="return toggle('getFunctionReference');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#getFunctionReference">getFunctionReference</a><tt class="py-op">(</tt><tt class="py-param">module</tt><tt class="py-op">,</tt> <tt class="py-param">function</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getFunctionReference-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="getFunctionReference-expanded"><a name="L1201"></a><tt class="py-lineno">1201</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1202"></a><tt class="py-lineno">1202</tt> <tt class="py-line"><tt class="py-docstring"> Gets a reference to a named function.</tt> </tt>
<a name="L1203"></a><tt class="py-lineno">1203</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1204"></a><tt class="py-lineno">1204</tt> <tt class="py-line"><tt class="py-docstring"> This does some hokey-pokey to get back a reference to a dynamically named</tt> </tt>
<a name="L1205"></a><tt class="py-lineno">1205</tt> <tt class="py-line"><tt class="py-docstring"> function. For instance, say you wanted to get a reference to the</tt> </tt>
<a name="L1206"></a><tt class="py-lineno">1206</tt> <tt class="py-line"><tt class="py-docstring"> C{os.path.isdir} function. You could use::</tt> </tt>
<a name="L1207"></a><tt class="py-lineno">1207</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1208"></a><tt class="py-lineno">1208</tt> <tt class="py-line"><tt class="py-docstring"> myfunc = getFunctionReference("os.path", "isdir")</tt> </tt>
<a name="L1209"></a><tt class="py-lineno">1209</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1210"></a><tt class="py-lineno">1210</tt> <tt class="py-line"><tt class="py-docstring"> Although we won't bomb out directly, behavior is pretty much undefined if</tt> </tt>
<a name="L1211"></a><tt class="py-lineno">1211</tt> <tt class="py-line"><tt class="py-docstring"> you pass in C{None} or C{""} for either C{module} or C{function}.</tt> </tt>
<a name="L1212"></a><tt class="py-lineno">1212</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1213"></a><tt class="py-lineno">1213</tt> <tt class="py-line"><tt class="py-docstring"> The only validation we enforce is that whatever we get back must be</tt> </tt>
<a name="L1214"></a><tt class="py-lineno">1214</tt> <tt class="py-line"><tt class="py-docstring"> callable.</tt> </tt>
<a name="L1215"></a><tt class="py-lineno">1215</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1216"></a><tt class="py-lineno">1216</tt> <tt class="py-line"><tt class="py-docstring"> I derived this code based on the internals of the Python unittest</tt> </tt>
<a name="L1217"></a><tt class="py-lineno">1217</tt> <tt class="py-line"><tt class="py-docstring"> implementation. I don't claim to completely understand how it works.</tt> </tt>
<a name="L1218"></a><tt class="py-lineno">1218</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1219"></a><tt class="py-lineno">1219</tt> <tt class="py-line"><tt class="py-docstring"> @param module: Name of module associated with function.</tt> </tt>
<a name="L1220"></a><tt class="py-lineno">1220</tt> <tt class="py-line"><tt class="py-docstring"> @type module: Something like "os.path" or "CedarBackup3.util"</tt> </tt>
<a name="L1221"></a><tt class="py-lineno">1221</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1222"></a><tt class="py-lineno">1222</tt> <tt class="py-line"><tt class="py-docstring"> @param function: Name of function</tt> </tt>
<a name="L1223"></a><tt class="py-lineno">1223</tt> <tt class="py-line"><tt class="py-docstring"> @type function: Something like "isdir" or "getUidGid"</tt> </tt>
<a name="L1224"></a><tt class="py-lineno">1224</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1225"></a><tt class="py-lineno">1225</tt> <tt class="py-line"><tt class="py-docstring"> @return: Reference to function associated with name.</tt> </tt>
<a name="L1226"></a><tt class="py-lineno">1226</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1227"></a><tt class="py-lineno">1227</tt> <tt class="py-line"><tt class="py-docstring"> @raise ImportError: If the function cannot be found.</tt> </tt>
<a name="L1228"></a><tt class="py-lineno">1228</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the resulting reference is not callable.</tt> </tt>
<a name="L1229"></a><tt class="py-lineno">1229</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1230"></a><tt class="py-lineno">1230</tt> <tt class="py-line"><tt class="py-docstring"> @copyright: Some of this code, prior to customization, was originally part</tt> </tt>
<a name="L1231"></a><tt class="py-lineno">1231</tt> <tt class="py-line"><tt class="py-docstring"> of the Python 2.3 codebase. Python code is copyright (c) 2001, 2002 Python</tt> </tt>
<a name="L1232"></a><tt class="py-lineno">1232</tt> <tt class="py-line"><tt class="py-docstring"> Software Foundation; All Rights Reserved.</tt> </tt>
<a name="L1233"></a><tt class="py-lineno">1233</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1234"></a><tt class="py-lineno">1234</tt> <tt class="py-line"> <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1235"></a><tt class="py-lineno">1235</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-230" class="py-name" targets="Variable CedarBackup3.config.ExtendedAction.module=CedarBackup3.config.ExtendedAction-class.html#module"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-230', 'module', 'link-230');">module</a></tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt id="link-231" class="py-name"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-231', 'module', 'link-230');">module</a></tt> <tt class="py-op">!=</tt> <tt class="py-string">""</tt><tt class="py-op">:</tt> </tt>
<a name="L1236"></a><tt class="py-lineno">1236</tt> <tt class="py-line"> <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt id="link-232" class="py-name"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-232', 'module', 'link-230');">module</a></tt><tt class="py-op">.</tt><tt id="link-233" class="py-name" targets="Module CedarBackup3.extend.split=CedarBackup3.extend.split-module.html,Variable CedarBackup3.extend.split.LocalConfig.split=CedarBackup3.extend.split.LocalConfig-class.html#split"><a title="CedarBackup3.extend.split
CedarBackup3.extend.split.LocalConfig.split" class="py-name" href="#" onclick="return doclink('link-233', 'split', 'link-233');">split</a></tt><tt class="py-op">(</tt><tt class="py-string">"."</tt><tt class="py-op">)</tt> </tt>
<a name="L1237"></a><tt class="py-lineno">1237</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-234" class="py-name" targets="Variable CedarBackup3.config.ExtendedAction.function=CedarBackup3.config.ExtendedAction-class.html#function"><a title="CedarBackup3.config.ExtendedAction.function" class="py-name" href="#" onclick="return doclink('link-234', 'function', 'link-234');">function</a></tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt id="link-235" class="py-name"><a title="CedarBackup3.config.ExtendedAction.function" class="py-name" href="#" onclick="return doclink('link-235', 'function', 'link-234');">function</a></tt> <tt class="py-op">!=</tt> <tt class="py-string">""</tt><tt class="py-op">:</tt> </tt>
<a name="L1238"></a><tt class="py-lineno">1238</tt> <tt class="py-line"> <tt class="py-name">parts</tt><tt class="py-op">.</tt><tt id="link-236" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-236', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt id="link-237" class="py-name"><a title="CedarBackup3.config.ExtendedAction.function" class="py-name" href="#" onclick="return doclink('link-237', 'function', 'link-234');">function</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1239"></a><tt class="py-lineno">1239</tt> <tt class="py-line"> <tt class="py-name">copy</tt> <tt class="py-op">=</tt> <tt class="py-name">parts</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L1240"></a><tt class="py-lineno">1240</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">copy</tt><tt class="py-op">:</tt> </tt>
<a name="L1241"></a><tt class="py-lineno">1241</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1242"></a><tt class="py-lineno">1242</tt> <tt class="py-line"> <tt id="link-238" class="py-name"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-238', 'module', 'link-230');">module</a></tt> <tt class="py-op">=</tt> <tt class="py-name">__import__</tt><tt class="py-op">(</tt><tt class="py-string">"."</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">copy</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1243"></a><tt class="py-lineno">1243</tt> <tt class="py-line"> <tt class="py-keyword">break</tt> </tt>
<a name="L1244"></a><tt class="py-lineno">1244</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">ImportError</tt><tt class="py-op">:</tt> </tt>
<a name="L1245"></a><tt class="py-lineno">1245</tt> <tt class="py-line"> <tt class="py-keyword">del</tt> <tt class="py-name">copy</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1246"></a><tt class="py-lineno">1246</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">copy</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> </tt>
<a name="L1247"></a><tt class="py-lineno">1247</tt> <tt class="py-line"> <tt class="py-name">parts</tt> <tt class="py-op">=</tt> <tt class="py-name">parts</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L1248"></a><tt class="py-lineno">1248</tt> <tt class="py-line"> <tt class="py-name">obj</tt> <tt class="py-op">=</tt> <tt id="link-239" class="py-name"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-239', 'module', 'link-230');">module</a></tt> </tt>
<a name="L1249"></a><tt class="py-lineno">1249</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">part</tt> <tt class="py-keyword">in</tt> <tt class="py-name">parts</tt><tt class="py-op">:</tt> </tt>
<a name="L1250"></a><tt class="py-lineno">1250</tt> <tt class="py-line"> <tt class="py-name">obj</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-name">part</tt><tt class="py-op">)</tt> </tt>
<a name="L1251"></a><tt class="py-lineno">1251</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-name">collections</tt><tt class="py-op">.</tt><tt class="py-name">Callable</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1252"></a><tt class="py-lineno">1252</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Reference to %s.%s is not callable."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-240" class="py-name"><a title="CedarBackup3.config.ExtendedAction.module" class="py-name" href="#" onclick="return doclink('link-240', 'module', 'link-230');">module</a></tt><tt class="py-op">,</tt> <tt id="link-241" class="py-name"><a title="CedarBackup3.config.ExtendedAction.function" class="py-name" href="#" onclick="return doclink('link-241', 'function', 'link-234');">function</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1253"></a><tt class="py-lineno">1253</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">obj</tt> </tt>
</div><a name="L1254"></a><tt class="py-lineno">1254</tt> <tt class="py-line"> </tt>
<a name="getUidGid"></a><div id="getUidGid-def"><a name="L1255"></a><tt class="py-lineno">1255</tt> <tt class="py-line"> </tt>
<a name="L1256"></a><tt class="py-lineno">1256</tt> <tt class="py-line"><tt class="py-comment">#######################</tt> </tt>
<a name="L1257"></a><tt class="py-lineno">1257</tt> <tt class="py-line"><tt class="py-comment"># getUidGid() function</tt> </tt>
<a name="L1258"></a><tt class="py-lineno">1258</tt> <tt class="py-line"><tt class="py-comment">#######################</tt> </tt>
<a name="L1259"></a><tt class="py-lineno">1259</tt> <tt class="py-line"> </tt>
<a name="L1260"></a><tt class="py-lineno">1260</tt> <a class="py-toggle" href="#" id="getUidGid-toggle" onclick="return toggle('getUidGid');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#getUidGid">getUidGid</a><tt class="py-op">(</tt><tt class="py-param">user</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getUidGid-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="getUidGid-expanded"><a name="L1261"></a><tt class="py-lineno">1261</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1262"></a><tt class="py-lineno">1262</tt> <tt class="py-line"><tt class="py-docstring"> Get the uid/gid associated with a user/group pair</tt> </tt>
<a name="L1263"></a><tt class="py-lineno">1263</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1264"></a><tt class="py-lineno">1264</tt> <tt class="py-line"><tt class="py-docstring"> This is a no-op if user/group functionality is not available on the platform.</tt> </tt>
<a name="L1265"></a><tt class="py-lineno">1265</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1266"></a><tt class="py-lineno">1266</tt> <tt class="py-line"><tt class="py-docstring"> @param user: User name</tt> </tt>
<a name="L1267"></a><tt class="py-lineno">1267</tt> <tt class="py-line"><tt class="py-docstring"> @type user: User name as a string</tt> </tt>
<a name="L1268"></a><tt class="py-lineno">1268</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1269"></a><tt class="py-lineno">1269</tt> <tt class="py-line"><tt class="py-docstring"> @param group: Group name</tt> </tt>
<a name="L1270"></a><tt class="py-lineno">1270</tt> <tt class="py-line"><tt class="py-docstring"> @type group: Group name as a string</tt> </tt>
<a name="L1271"></a><tt class="py-lineno">1271</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1272"></a><tt class="py-lineno">1272</tt> <tt class="py-line"><tt class="py-docstring"> @return: Tuple C{(uid, gid)} matching passed-in user and group.</tt> </tt>
<a name="L1273"></a><tt class="py-lineno">1273</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the ownership user/group values are invalid</tt> </tt>
<a name="L1274"></a><tt class="py-lineno">1274</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1275"></a><tt class="py-lineno">1275</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-242" class="py-name"><a title="CedarBackup3.util._UID_GID_AVAILABLE" class="py-name" href="#" onclick="return doclink('link-242', '_UID_GID_AVAILABLE', 'link-0');">_UID_GID_AVAILABLE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1276"></a><tt class="py-lineno">1276</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1277"></a><tt class="py-lineno">1277</tt> <tt class="py-line"> <tt class="py-name">uid</tt> <tt class="py-op">=</tt> <tt class="py-name">pwd</tt><tt class="py-op">.</tt><tt class="py-name">getpwnam</tt><tt class="py-op">(</tt><tt id="link-243" class="py-name" targets="Variable CedarBackup3.extend.mysql.MysqlConfig.user=CedarBackup3.extend.mysql.MysqlConfig-class.html#user,Variable CedarBackup3.extend.postgresql.PostgresqlConfig.user=CedarBackup3.extend.postgresql.PostgresqlConfig-class.html#user"><a title="CedarBackup3.extend.mysql.MysqlConfig.user
CedarBackup3.extend.postgresql.PostgresqlConfig.user" class="py-name" href="#" onclick="return doclink('link-243', 'user', 'link-243');">user</a></tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L1278"></a><tt class="py-lineno">1278</tt> <tt class="py-line"> <tt class="py-name">gid</tt> <tt class="py-op">=</tt> <tt class="py-name">grp</tt><tt class="py-op">.</tt><tt class="py-name">getgrnam</tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L1279"></a><tt class="py-lineno">1279</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">uid</tt><tt class="py-op">,</tt> <tt class="py-name">gid</tt><tt class="py-op">)</tt> </tt>
<a name="L1280"></a><tt class="py-lineno">1280</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt> <tt class="py-keyword">as</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L1281"></a><tt class="py-lineno">1281</tt> <tt class="py-line"> <tt id="link-244" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-244', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-245" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-245', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Error looking up uid and gid for [%s:%s]: %s"</tt><tt class="py-op">,</tt> <tt id="link-246" class="py-name"><a title="CedarBackup3.extend.mysql.MysqlConfig.user
CedarBackup3.extend.postgresql.PostgresqlConfig.user" class="py-name" href="#" onclick="return doclink('link-246', 'user', 'link-243');">user</a></tt><tt class="py-op">,</tt> <tt class="py-name">group</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">)</tt> </tt>
<a name="L1282"></a><tt class="py-lineno">1282</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Unable to lookup up uid and gid for passed in user/group."</tt><tt class="py-op">)</tt> </tt>
<a name="L1283"></a><tt class="py-lineno">1283</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1284"></a><tt class="py-lineno">1284</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1285"></a><tt class="py-lineno">1285</tt> <tt class="py-line"> </tt>
<a name="changeOwnership"></a><div id="changeOwnership-def"><a name="L1286"></a><tt class="py-lineno">1286</tt> <tt class="py-line"> </tt>
<a name="L1287"></a><tt class="py-lineno">1287</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1288"></a><tt class="py-lineno">1288</tt> <tt class="py-line"><tt class="py-comment"># changeOwnership() function</tt> </tt>
<a name="L1289"></a><tt class="py-lineno">1289</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1290"></a><tt class="py-lineno">1290</tt> <tt class="py-line"> </tt>
<a name="L1291"></a><tt class="py-lineno">1291</tt> <a class="py-toggle" href="#" id="changeOwnership-toggle" onclick="return toggle('changeOwnership');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#changeOwnership">changeOwnership</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">user</tt><tt class="py-op">,</tt> <tt class="py-param">group</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="changeOwnership-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="changeOwnership-expanded"><a name="L1292"></a><tt class="py-lineno">1292</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1293"></a><tt class="py-lineno">1293</tt> <tt class="py-line"><tt class="py-docstring"> Changes ownership of path to match the user and group.</tt> </tt>
<a name="L1294"></a><tt class="py-lineno">1294</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1295"></a><tt class="py-lineno">1295</tt> <tt class="py-line"><tt class="py-docstring"> This is a no-op if user/group functionality is not available on the</tt> </tt>
<a name="L1296"></a><tt class="py-lineno">1296</tt> <tt class="py-line"><tt class="py-docstring"> platform, or if the either passed-in user or group is C{None}. Further, we</tt> </tt>
<a name="L1297"></a><tt class="py-lineno">1297</tt> <tt class="py-line"><tt class="py-docstring"> won't even try to do it unless running as root, since it's unlikely to work.</tt> </tt>
<a name="L1298"></a><tt class="py-lineno">1298</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1299"></a><tt class="py-lineno">1299</tt> <tt class="py-line"><tt class="py-docstring"> @param path: Path whose ownership to change.</tt> </tt>
<a name="L1300"></a><tt class="py-lineno">1300</tt> <tt class="py-line"><tt class="py-docstring"> @param user: User which owns file.</tt> </tt>
<a name="L1301"></a><tt class="py-lineno">1301</tt> <tt class="py-line"><tt class="py-docstring"> @param group: Group which owns file.</tt> </tt>
<a name="L1302"></a><tt class="py-lineno">1302</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1303"></a><tt class="py-lineno">1303</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-247" class="py-name"><a title="CedarBackup3.util._UID_GID_AVAILABLE" class="py-name" href="#" onclick="return doclink('link-247', '_UID_GID_AVAILABLE', 'link-0');">_UID_GID_AVAILABLE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1304"></a><tt class="py-lineno">1304</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-248" class="py-name"><a title="CedarBackup3.extend.mysql.MysqlConfig.user
CedarBackup3.extend.postgresql.PostgresqlConfig.user" class="py-name" href="#" onclick="return doclink('link-248', 'user', 'link-243');">user</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">or</tt> <tt class="py-name">group</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1305"></a><tt class="py-lineno">1305</tt> <tt class="py-line"> <tt id="link-249" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-249', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-250" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-250', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"User or group is None, so not attempting to change owner on [%s]."</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1306"></a><tt class="py-lineno">1306</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt id="link-251" class="py-name" targets="Function CedarBackup3.util.isRunningAsRoot()=CedarBackup3.util-module.html#isRunningAsRoot"><a title="CedarBackup3.util.isRunningAsRoot" class="py-name" href="#" onclick="return doclink('link-251', 'isRunningAsRoot', 'link-251');">isRunningAsRoot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1307"></a><tt class="py-lineno">1307</tt> <tt class="py-line"> <tt id="link-252" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-252', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-253" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-253', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Not root, so not attempting to change owner on [%s]."</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1308"></a><tt class="py-lineno">1308</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1309"></a><tt class="py-lineno">1309</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1310"></a><tt class="py-lineno">1310</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">uid</tt><tt class="py-op">,</tt> <tt class="py-name">gid</tt><tt class="py-op">)</tt> <tt class="py-op">=</tt> <tt id="link-254" class="py-name" targets="Function CedarBackup3.util.getUidGid()=CedarBackup3.util-module.html#getUidGid"><a title="CedarBackup3.util.getUidGid" class="py-name" href="#" onclick="return doclink('link-254', 'getUidGid', 'link-254');">getUidGid</a></tt><tt class="py-op">(</tt><tt id="link-255" class="py-name"><a title="CedarBackup3.extend.mysql.MysqlConfig.user
CedarBackup3.extend.postgresql.PostgresqlConfig.user" class="py-name" href="#" onclick="return doclink('link-255', 'user', 'link-243');">user</a></tt><tt class="py-op">,</tt> <tt class="py-name">group</tt><tt class="py-op">)</tt> </tt>
<a name="L1311"></a><tt class="py-lineno">1311</tt> <tt class="py-line"> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">chown</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">uid</tt><tt class="py-op">,</tt> <tt class="py-name">gid</tt><tt class="py-op">)</tt> </tt>
<a name="L1312"></a><tt class="py-lineno">1312</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt> <tt class="py-keyword">as</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L1313"></a><tt class="py-lineno">1313</tt> <tt class="py-line"> <tt id="link-256" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-256', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">"Error changing ownership of [%s]: %s"</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1314"></a><tt class="py-lineno">1314</tt> <tt class="py-line"> </tt>
<a name="isRunningAsRoot"></a><div id="isRunningAsRoot-def"><a name="L1315"></a><tt class="py-lineno">1315</tt> <tt class="py-line"> </tt>
<a name="L1316"></a><tt class="py-lineno">1316</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1317"></a><tt class="py-lineno">1317</tt> <tt class="py-line"><tt class="py-comment"># isRunningAsRoot() function</tt> </tt>
<a name="L1318"></a><tt class="py-lineno">1318</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1319"></a><tt class="py-lineno">1319</tt> <tt class="py-line"> </tt>
<a name="L1320"></a><tt class="py-lineno">1320</tt> <a class="py-toggle" href="#" id="isRunningAsRoot-toggle" onclick="return toggle('isRunningAsRoot');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#isRunningAsRoot">isRunningAsRoot</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="isRunningAsRoot-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="isRunningAsRoot-expanded"><a name="L1321"></a><tt class="py-lineno">1321</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1322"></a><tt class="py-lineno">1322</tt> <tt class="py-line"><tt class="py-docstring"> Indicates whether the program is running as the root user.</tt> </tt>
<a name="L1323"></a><tt class="py-lineno">1323</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1324"></a><tt class="py-lineno">1324</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">getuid</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L1325"></a><tt class="py-lineno">1325</tt> <tt class="py-line"> </tt>
<a name="splitCommandLine"></a><div id="splitCommandLine-def"><a name="L1326"></a><tt class="py-lineno">1326</tt> <tt class="py-line"> </tt>
<a name="L1327"></a><tt class="py-lineno">1327</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1328"></a><tt class="py-lineno">1328</tt> <tt class="py-line"><tt class="py-comment"># splitCommandLine() function</tt> </tt>
<a name="L1329"></a><tt class="py-lineno">1329</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1330"></a><tt class="py-lineno">1330</tt> <tt class="py-line"> </tt>
<a name="L1331"></a><tt class="py-lineno">1331</tt> <a class="py-toggle" href="#" id="splitCommandLine-toggle" onclick="return toggle('splitCommandLine');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#splitCommandLine">splitCommandLine</a><tt class="py-op">(</tt><tt class="py-param">commandLine</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="splitCommandLine-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="splitCommandLine-expanded"><a name="L1332"></a><tt class="py-lineno">1332</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1333"></a><tt class="py-lineno">1333</tt> <tt class="py-line"><tt class="py-docstring"> Splits a command line string into a list of arguments.</tt> </tt>
<a name="L1334"></a><tt class="py-lineno">1334</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1335"></a><tt class="py-lineno">1335</tt> <tt class="py-line"><tt class="py-docstring"> Unfortunately, there is no "standard" way to parse a command line string,</tt> </tt>
<a name="L1336"></a><tt class="py-lineno">1336</tt> <tt class="py-line"><tt class="py-docstring"> and it's actually not an easy problem to solve portably (essentially, we</tt> </tt>
<a name="L1337"></a><tt class="py-lineno">1337</tt> <tt class="py-line"><tt class="py-docstring"> have to emulate the shell argument-processing logic). This code only</tt> </tt>
<a name="L1338"></a><tt class="py-lineno">1338</tt> <tt class="py-line"><tt class="py-docstring"> respects double quotes (C{"}) for grouping arguments, not single quotes</tt> </tt>
<a name="L1339"></a><tt class="py-lineno">1339</tt> <tt class="py-line"><tt class="py-docstring"> (C{'}). Make sure you take this into account when building your command</tt> </tt>
<a name="L1340"></a><tt class="py-lineno">1340</tt> <tt class="py-line"><tt class="py-docstring"> line.</tt> </tt>
<a name="L1341"></a><tt class="py-lineno">1341</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1342"></a><tt class="py-lineno">1342</tt> <tt class="py-line"><tt class="py-docstring"> Incidentally, I found this particular parsing method while digging around in</tt> </tt>
<a name="L1343"></a><tt class="py-lineno">1343</tt> <tt class="py-line"><tt class="py-docstring"> Google Groups, and I tweaked it for my own use.</tt> </tt>
<a name="L1344"></a><tt class="py-lineno">1344</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1345"></a><tt class="py-lineno">1345</tt> <tt class="py-line"><tt class="py-docstring"> @param commandLine: Command line string</tt> </tt>
<a name="L1346"></a><tt class="py-lineno">1346</tt> <tt class="py-line"><tt class="py-docstring"> @type commandLine: String, i.e. "cback3 --verbose stage store"</tt> </tt>
<a name="L1347"></a><tt class="py-lineno">1347</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1348"></a><tt class="py-lineno">1348</tt> <tt class="py-line"><tt class="py-docstring"> @return: List of arguments, suitable for passing to C{popen2}.</tt> </tt>
<a name="L1349"></a><tt class="py-lineno">1349</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1350"></a><tt class="py-lineno">1350</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the command line is None.</tt> </tt>
<a name="L1351"></a><tt class="py-lineno">1351</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1352"></a><tt class="py-lineno">1352</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">commandLine</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1353"></a><tt class="py-lineno">1353</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot split command line of None."</tt><tt class="py-op">)</tt> </tt>
<a name="L1354"></a><tt class="py-lineno">1354</tt> <tt class="py-line"> <tt class="py-name">fields</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">findall</tt><tt class="py-op">(</tt><tt class="py-string">'[^ "]+|"[^"]+"'</tt><tt class="py-op">,</tt> <tt class="py-name">commandLine</tt><tt class="py-op">)</tt> </tt>
<a name="L1355"></a><tt class="py-lineno">1355</tt> <tt class="py-line"> <tt class="py-name">fields</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'"'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">field</tt> <tt class="py-keyword">in</tt> <tt class="py-name">fields</tt><tt class="py-op">]</tt> </tt>
<a name="L1356"></a><tt class="py-lineno">1356</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">fields</tt> </tt>
</div><a name="L1357"></a><tt class="py-lineno">1357</tt> <tt class="py-line"> </tt>
<a name="resolveCommand"></a><div id="resolveCommand-def"><a name="L1358"></a><tt class="py-lineno">1358</tt> <tt class="py-line"> </tt>
<a name="L1359"></a><tt class="py-lineno">1359</tt> <tt class="py-line"><tt class="py-comment">############################</tt> </tt>
<a name="L1360"></a><tt class="py-lineno">1360</tt> <tt class="py-line"><tt class="py-comment"># resolveCommand() function</tt> </tt>
<a name="L1361"></a><tt class="py-lineno">1361</tt> <tt class="py-line"><tt class="py-comment">############################</tt> </tt>
<a name="L1362"></a><tt class="py-lineno">1362</tt> <tt class="py-line"> </tt>
<a name="L1363"></a><tt class="py-lineno">1363</tt> <a class="py-toggle" href="#" id="resolveCommand-toggle" onclick="return toggle('resolveCommand');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#resolveCommand">resolveCommand</a><tt class="py-op">(</tt><tt class="py-param">command</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="resolveCommand-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="resolveCommand-expanded"><a name="L1364"></a><tt class="py-lineno">1364</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1365"></a><tt class="py-lineno">1365</tt> <tt class="py-line"><tt class="py-docstring"> Resolves the real path to a command through the path resolver mechanism.</tt> </tt>
<a name="L1366"></a><tt class="py-lineno">1366</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1367"></a><tt class="py-lineno">1367</tt> <tt class="py-line"><tt class="py-docstring"> Both extensions and standard Cedar Backup functionality need a way to</tt> </tt>
<a name="L1368"></a><tt class="py-lineno">1368</tt> <tt class="py-line"><tt class="py-docstring"> resolve the "real" location of various executables. Normally, they assume</tt> </tt>
<a name="L1369"></a><tt class="py-lineno">1369</tt> <tt class="py-line"><tt class="py-docstring"> that these executables are on the system path, but some callers need to</tt> </tt>
<a name="L1370"></a><tt class="py-lineno">1370</tt> <tt class="py-line"><tt class="py-docstring"> specify an alternate location.</tt> </tt>
<a name="L1371"></a><tt class="py-lineno">1371</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1372"></a><tt class="py-lineno">1372</tt> <tt class="py-line"><tt class="py-docstring"> Ideally, we want to handle this configuration in a central location. The</tt> </tt>
<a name="L1373"></a><tt class="py-lineno">1373</tt> <tt class="py-line"><tt class="py-docstring"> Cedar Backup path resolver mechanism (a singleton called</tt> </tt>
<a name="L1374"></a><tt class="py-lineno">1374</tt> <tt class="py-line"><tt class="py-docstring"> L{PathResolverSingleton}) provides the central location to store the</tt> </tt>
<a name="L1375"></a><tt class="py-lineno">1375</tt> <tt class="py-line"><tt class="py-docstring"> mappings. This function wraps access to the singleton, and is what all</tt> </tt>
<a name="L1376"></a><tt class="py-lineno">1376</tt> <tt class="py-line"><tt class="py-docstring"> functions (extensions or standard functionality) should call if they need to</tt> </tt>
<a name="L1377"></a><tt class="py-lineno">1377</tt> <tt class="py-line"><tt class="py-docstring"> find a command.</tt> </tt>
<a name="L1378"></a><tt class="py-lineno">1378</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1379"></a><tt class="py-lineno">1379</tt> <tt class="py-line"><tt class="py-docstring"> The passed-in command must actually be a list, in the standard form used by</tt> </tt>
<a name="L1380"></a><tt class="py-lineno">1380</tt> <tt class="py-line"><tt class="py-docstring"> all existing Cedar Backup code (something like C{["svnlook", ]}). The</tt> </tt>
<a name="L1381"></a><tt class="py-lineno">1381</tt> <tt class="py-line"><tt class="py-docstring"> lookup will actually be done on the first element in the list, and the</tt> </tt>
<a name="L1382"></a><tt class="py-lineno">1382</tt> <tt class="py-line"><tt class="py-docstring"> returned command will always be in list form as well.</tt> </tt>
<a name="L1383"></a><tt class="py-lineno">1383</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1384"></a><tt class="py-lineno">1384</tt> <tt class="py-line"><tt class="py-docstring"> If the passed-in command can't be resolved or no mapping exists, then the</tt> </tt>
<a name="L1385"></a><tt class="py-lineno">1385</tt> <tt class="py-line"><tt class="py-docstring"> command itself will be returned unchanged. This way, we neatly fall back on</tt> </tt>
<a name="L1386"></a><tt class="py-lineno">1386</tt> <tt class="py-line"><tt class="py-docstring"> default behavior if we have no sensible alternative.</tt> </tt>
<a name="L1387"></a><tt class="py-lineno">1387</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1388"></a><tt class="py-lineno">1388</tt> <tt class="py-line"><tt class="py-docstring"> @param command: Command to resolve.</tt> </tt>
<a name="L1389"></a><tt class="py-lineno">1389</tt> <tt class="py-line"><tt class="py-docstring"> @type command: List form of command, i.e. C{["svnlook", ]}.</tt> </tt>
<a name="L1390"></a><tt class="py-lineno">1390</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1391"></a><tt class="py-lineno">1391</tt> <tt class="py-line"><tt class="py-docstring"> @return: Path to command or just command itself if no mapping exists.</tt> </tt>
<a name="L1392"></a><tt class="py-lineno">1392</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1393"></a><tt class="py-lineno">1393</tt> <tt class="py-line"> <tt class="py-name">singleton</tt> <tt class="py-op">=</tt> <tt id="link-257" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton" class="py-name" href="#" onclick="return doclink('link-257', 'PathResolverSingleton', 'link-140');">PathResolverSingleton</a></tt><tt class="py-op">.</tt><tt id="link-258" class="py-name"><a title="CedarBackup3.util.PathResolverSingleton.getInstance" class="py-name" href="#" onclick="return doclink('link-258', 'getInstance', 'link-147');">getInstance</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1394"></a><tt class="py-lineno">1394</tt> <tt class="py-line"> <tt id="link-259" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-259', 'name', 'link-99');">name</a></tt> <tt class="py-op">=</tt> <tt id="link-260" class="py-name" targets="Variable CedarBackup3.config.ActionHook.command=CedarBackup3.config.ActionHook-class.html#command,Variable CedarBackup3.config.CommandOverride.command=CedarBackup3.config.CommandOverride-class.html#command"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-260', 'command', 'link-260');">command</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1395"></a><tt class="py-lineno">1395</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-261" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-261', 'command', 'link-260');">command</a></tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L1396"></a><tt class="py-lineno">1396</tt> <tt class="py-line"> <tt class="py-name">result</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">singleton</tt><tt class="py-op">.</tt><tt id="link-262" class="py-name" targets="Method CedarBackup3.util.PathResolverSingleton.lookup()=CedarBackup3.util.PathResolverSingleton-class.html#lookup"><a title="CedarBackup3.util.PathResolverSingleton.lookup" class="py-name" href="#" onclick="return doclink('link-262', 'lookup', 'link-262');">lookup</a></tt><tt class="py-op">(</tt><tt id="link-263" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-263', 'name', 'link-99');">name</a></tt><tt class="py-op">,</tt> <tt id="link-264" class="py-name"><a title="CedarBackup3.config.ExtendedAction.name
CedarBackup3.config.LocalPeer.name
CedarBackup3.config.RemotePeer.name
CedarBackup3.peer.LocalPeer.name
CedarBackup3.peer.RemotePeer.name
CedarBackup3.util.DirectedGraph.name" class="py-name" href="#" onclick="return doclink('link-264', 'name', 'link-99');">name</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1397"></a><tt class="py-lineno">1397</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div><a name="L1398"></a><tt class="py-lineno">1398</tt> <tt class="py-line"> </tt>
<a name="executeCommand"></a><div id="executeCommand-def"><a name="L1399"></a><tt class="py-lineno">1399</tt> <tt class="py-line"> </tt>
<a name="L1400"></a><tt class="py-lineno">1400</tt> <tt class="py-line"><tt class="py-comment">############################</tt> </tt>
<a name="L1401"></a><tt class="py-lineno">1401</tt> <tt class="py-line"><tt class="py-comment"># executeCommand() function</tt> </tt>
<a name="L1402"></a><tt class="py-lineno">1402</tt> <tt class="py-line"><tt class="py-comment">############################</tt> </tt>
<a name="L1403"></a><tt class="py-lineno">1403</tt> <tt class="py-line"> </tt>
<a name="L1404"></a><tt class="py-lineno">1404</tt> <a class="py-toggle" href="#" id="executeCommand-toggle" onclick="return toggle('executeCommand');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#executeCommand">executeCommand</a><tt class="py-op">(</tt><tt class="py-param">command</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-param">returnOutput</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">doNotLog</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">outputFile</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="executeCommand-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="executeCommand-expanded"><a name="L1405"></a><tt class="py-lineno">1405</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1406"></a><tt class="py-lineno">1406</tt> <tt class="py-line"><tt class="py-docstring"> Executes a shell command, hopefully in a safe way.</tt> </tt>
<a name="L1407"></a><tt class="py-lineno">1407</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1408"></a><tt class="py-lineno">1408</tt> <tt class="py-line"><tt class="py-docstring"> This function exists to replace direct calls to C{os.popen} in the Cedar</tt> </tt>
<a name="L1409"></a><tt class="py-lineno">1409</tt> <tt class="py-line"><tt class="py-docstring"> Backup code. It's not safe to call a function such as C{os.popen()} with</tt> </tt>
<a name="L1410"></a><tt class="py-lineno">1410</tt> <tt class="py-line"><tt class="py-docstring"> untrusted arguments, since that can cause problems if the string contains</tt> </tt>
<a name="L1411"></a><tt class="py-lineno">1411</tt> <tt class="py-line"><tt class="py-docstring"> non-safe variables or other constructs (imagine that the argument is</tt> </tt>
<a name="L1412"></a><tt class="py-lineno">1412</tt> <tt class="py-line"><tt class="py-docstring"> C{$WHATEVER}, but C{$WHATEVER} contains something like C{"; rm -fR ~/;</tt> </tt>
<a name="L1413"></a><tt class="py-lineno">1413</tt> <tt class="py-line"><tt class="py-docstring"> echo"} in the current environment).</tt> </tt>
<a name="L1414"></a><tt class="py-lineno">1414</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1415"></a><tt class="py-lineno">1415</tt> <tt class="py-line"><tt class="py-docstring"> Instead, it's safer to pass a list of arguments in the style supported bt</tt> </tt>
<a name="L1416"></a><tt class="py-lineno">1416</tt> <tt class="py-line"><tt class="py-docstring"> C{popen2} or C{popen4}. This function actually uses a specialized C{Pipe}</tt> </tt>
<a name="L1417"></a><tt class="py-lineno">1417</tt> <tt class="py-line"><tt class="py-docstring"> class implemented using either C{subprocess.Popen} or C{popen2.Popen4}.</tt> </tt>
<a name="L1418"></a><tt class="py-lineno">1418</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1419"></a><tt class="py-lineno">1419</tt> <tt class="py-line"><tt class="py-docstring"> Under the normal case, this function will return a tuple of C{(status,</tt> </tt>
<a name="L1420"></a><tt class="py-lineno">1420</tt> <tt class="py-line"><tt class="py-docstring"> None)} where the status is the wait-encoded return status of the call per</tt> </tt>
<a name="L1421"></a><tt class="py-lineno">1421</tt> <tt class="py-line"><tt class="py-docstring"> the C{popen2.Popen4} documentation. If C{returnOutput} is passed in as</tt> </tt>
<a name="L1422"></a><tt class="py-lineno">1422</tt> <tt class="py-line"><tt class="py-docstring"> C{True}, the function will return a tuple of C{(status, output)} where</tt> </tt>
<a name="L1423"></a><tt class="py-lineno">1423</tt> <tt class="py-line"><tt class="py-docstring"> C{output} is a list of strings, one entry per line in the output from the</tt> </tt>
<a name="L1424"></a><tt class="py-lineno">1424</tt> <tt class="py-line"><tt class="py-docstring"> command. Output is always logged to the C{outputLogger.info()} target,</tt> </tt>
<a name="L1425"></a><tt class="py-lineno">1425</tt> <tt class="py-line"><tt class="py-docstring"> regardless of whether it's returned.</tt> </tt>
<a name="L1426"></a><tt class="py-lineno">1426</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1427"></a><tt class="py-lineno">1427</tt> <tt class="py-line"><tt class="py-docstring"> By default, C{stdout} and C{stderr} will be intermingled in the output.</tt> </tt>
<a name="L1428"></a><tt class="py-lineno">1428</tt> <tt class="py-line"><tt class="py-docstring"> However, if you pass in C{ignoreStderr=True}, then only C{stdout} will be</tt> </tt>
<a name="L1429"></a><tt class="py-lineno">1429</tt> <tt class="py-line"><tt class="py-docstring"> included in the output.</tt> </tt>
<a name="L1430"></a><tt class="py-lineno">1430</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1431"></a><tt class="py-lineno">1431</tt> <tt class="py-line"><tt class="py-docstring"> The C{doNotLog} parameter exists so that callers can force the function to</tt> </tt>
<a name="L1432"></a><tt class="py-lineno">1432</tt> <tt class="py-line"><tt class="py-docstring"> not log command output to the debug log. Normally, you would want to log.</tt> </tt>
<a name="L1433"></a><tt class="py-lineno">1433</tt> <tt class="py-line"><tt class="py-docstring"> However, if you're using this function to write huge output files (i.e.</tt> </tt>
<a name="L1434"></a><tt class="py-lineno">1434</tt> <tt class="py-line"><tt class="py-docstring"> database backups written to C{stdout}) then you might want to avoid putting</tt> </tt>
<a name="L1435"></a><tt class="py-lineno">1435</tt> <tt class="py-line"><tt class="py-docstring"> all that information into the debug log.</tt> </tt>
<a name="L1436"></a><tt class="py-lineno">1436</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1437"></a><tt class="py-lineno">1437</tt> <tt class="py-line"><tt class="py-docstring"> The C{outputFile} parameter exists to make it easier for a caller to push</tt> </tt>
<a name="L1438"></a><tt class="py-lineno">1438</tt> <tt class="py-line"><tt class="py-docstring"> output into a file, i.e. as a substitute for redirection to a file. If this</tt> </tt>
<a name="L1439"></a><tt class="py-lineno">1439</tt> <tt class="py-line"><tt class="py-docstring"> value is passed in, each time a line of output is generated, it will be</tt> </tt>
<a name="L1440"></a><tt class="py-lineno">1440</tt> <tt class="py-line"><tt class="py-docstring"> written to the file using C{outputFile.write()}. At the end, the file</tt> </tt>
<a name="L1441"></a><tt class="py-lineno">1441</tt> <tt class="py-line"><tt class="py-docstring"> descriptor will be flushed using C{outputFile.flush()}. The caller</tt> </tt>
<a name="L1442"></a><tt class="py-lineno">1442</tt> <tt class="py-line"><tt class="py-docstring"> maintains responsibility for closing the file object appropriately.</tt> </tt>
<a name="L1443"></a><tt class="py-lineno">1443</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1444"></a><tt class="py-lineno">1444</tt> <tt class="py-line"><tt class="py-docstring"> @note: I know that it's a bit confusing that the command and the arguments</tt> </tt>
<a name="L1445"></a><tt class="py-lineno">1445</tt> <tt class="py-line"><tt class="py-docstring"> are both lists. I could have just required the caller to pass in one big</tt> </tt>
<a name="L1446"></a><tt class="py-lineno">1446</tt> <tt class="py-line"><tt class="py-docstring"> list. However, I think it makes some sense to keep the command (the</tt> </tt>
<a name="L1447"></a><tt class="py-lineno">1447</tt> <tt class="py-line"><tt class="py-docstring"> constant part of what we're executing, i.e. C{"scp -B"}) separate from its</tt> </tt>
<a name="L1448"></a><tt class="py-lineno">1448</tt> <tt class="py-line"><tt class="py-docstring"> arguments, even if they both end up looking kind of similar.</tt> </tt>
<a name="L1449"></a><tt class="py-lineno">1449</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1450"></a><tt class="py-lineno">1450</tt> <tt class="py-line"><tt class="py-docstring"> @note: You cannot redirect output via shell constructs (i.e. C{>file},</tt> </tt>
<a name="L1451"></a><tt class="py-lineno">1451</tt> <tt class="py-line"><tt class="py-docstring"> C{2>/dev/null}, etc.) using this function. The redirection string would be</tt> </tt>
<a name="L1452"></a><tt class="py-lineno">1452</tt> <tt class="py-line"><tt class="py-docstring"> passed to the command just like any other argument. However, you can</tt> </tt>
<a name="L1453"></a><tt class="py-lineno">1453</tt> <tt class="py-line"><tt class="py-docstring"> implement the equivalent to redirection using C{ignoreStderr} and</tt> </tt>
<a name="L1454"></a><tt class="py-lineno">1454</tt> <tt class="py-line"><tt class="py-docstring"> C{outputFile}, as discussed above.</tt> </tt>
<a name="L1455"></a><tt class="py-lineno">1455</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1456"></a><tt class="py-lineno">1456</tt> <tt class="py-line"><tt class="py-docstring"> @note: The operating system environment is partially sanitized before</tt> </tt>
<a name="L1457"></a><tt class="py-lineno">1457</tt> <tt class="py-line"><tt class="py-docstring"> the command is invoked. See L{sanitizeEnvironment} for details.</tt> </tt>
<a name="L1458"></a><tt class="py-lineno">1458</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1459"></a><tt class="py-lineno">1459</tt> <tt class="py-line"><tt class="py-docstring"> @param command: Shell command to execute</tt> </tt>
<a name="L1460"></a><tt class="py-lineno">1460</tt> <tt class="py-line"><tt class="py-docstring"> @type command: List of individual arguments that make up the command</tt> </tt>
<a name="L1461"></a><tt class="py-lineno">1461</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1462"></a><tt class="py-lineno">1462</tt> <tt class="py-line"><tt class="py-docstring"> @param args: List of arguments to the command</tt> </tt>
<a name="L1463"></a><tt class="py-lineno">1463</tt> <tt class="py-line"><tt class="py-docstring"> @type args: List of additional arguments to the command</tt> </tt>
<a name="L1464"></a><tt class="py-lineno">1464</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1465"></a><tt class="py-lineno">1465</tt> <tt class="py-line"><tt class="py-docstring"> @param returnOutput: Indicates whether to return the output of the command</tt> </tt>
<a name="L1466"></a><tt class="py-lineno">1466</tt> <tt class="py-line"><tt class="py-docstring"> @type returnOutput: Boolean C{True} or C{False}</tt> </tt>
<a name="L1467"></a><tt class="py-lineno">1467</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1468"></a><tt class="py-lineno">1468</tt> <tt class="py-line"><tt class="py-docstring"> @param ignoreStderr: Whether stderr should be discarded</tt> </tt>
<a name="L1469"></a><tt class="py-lineno">1469</tt> <tt class="py-line"><tt class="py-docstring"> @type ignoreStderr: Boolean True or False</tt> </tt>
<a name="L1470"></a><tt class="py-lineno">1470</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1471"></a><tt class="py-lineno">1471</tt> <tt class="py-line"><tt class="py-docstring"> @param doNotLog: Indicates that output should not be logged.</tt> </tt>
<a name="L1472"></a><tt class="py-lineno">1472</tt> <tt class="py-line"><tt class="py-docstring"> @type doNotLog: Boolean C{True} or C{False}</tt> </tt>
<a name="L1473"></a><tt class="py-lineno">1473</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1474"></a><tt class="py-lineno">1474</tt> <tt class="py-line"><tt class="py-docstring"> @param outputFile: File object that all output should be written to.</tt> </tt>
<a name="L1475"></a><tt class="py-lineno">1475</tt> <tt class="py-line"><tt class="py-docstring"> @type outputFile: File object as returned from C{open()} or C{file()}, configured for binary write</tt> </tt>
<a name="L1476"></a><tt class="py-lineno">1476</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1477"></a><tt class="py-lineno">1477</tt> <tt class="py-line"><tt class="py-docstring"> @return: Tuple of C{(result, output)} as described above.</tt> </tt>
<a name="L1478"></a><tt class="py-lineno">1478</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1479"></a><tt class="py-lineno">1479</tt> <tt class="py-line"> <tt id="link-265" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-265', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-266" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-266', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Executing command %s with args %s."</tt><tt class="py-op">,</tt> <tt id="link-267" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-267', 'command', 'link-260');">command</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L1480"></a><tt class="py-lineno">1480</tt> <tt class="py-line"> <tt id="link-268" class="py-name"><a title="CedarBackup3.util.outputLogger" class="py-name" href="#" onclick="return doclink('link-268', 'outputLogger', 'link-7');">outputLogger</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">"Executing command %s with args %s."</tt><tt class="py-op">,</tt> <tt id="link-269" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-269', 'command', 'link-260');">command</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L1481"></a><tt class="py-lineno">1481</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">doNotLog</tt><tt class="py-op">:</tt> </tt>
<a name="L1482"></a><tt class="py-lineno">1482</tt> <tt class="py-line"> <tt id="link-270" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-270', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-271" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-271', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Note: output will not be logged, per the doNotLog flag."</tt><tt class="py-op">)</tt> </tt>
<a name="L1483"></a><tt class="py-lineno">1483</tt> <tt class="py-line"> <tt id="link-272" class="py-name"><a title="CedarBackup3.util.outputLogger" class="py-name" href="#" onclick="return doclink('link-272', 'outputLogger', 'link-7');">outputLogger</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">"Note: output will not be logged, per the doNotLog flag."</tt><tt class="py-op">)</tt> </tt>
<a name="L1484"></a><tt class="py-lineno">1484</tt> <tt class="py-line"> <tt id="link-273" class="py-name" targets="Variable CedarBackup3.cli.Options.output=CedarBackup3.cli.Options-class.html#output,Variable CedarBackup3.tools.amazons3.Options.output=CedarBackup3.tools.amazons3.Options-class.html#output"><a title="CedarBackup3.cli.Options.output
CedarBackup3.tools.amazons3.Options.output" class="py-name" href="#" onclick="return doclink('link-273', 'output', 'link-273');">output</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1485"></a><tt class="py-lineno">1485</tt> <tt class="py-line"> <tt class="py-name">fields</tt> <tt class="py-op">=</tt> <tt id="link-274" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-274', 'command', 'link-260');">command</a></tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-comment"># make sure to copy it so we don't destroy it</tt> </tt>
<a name="L1486"></a><tt class="py-lineno">1486</tt> <tt class="py-line"> <tt class="py-name">fields</tt><tt class="py-op">.</tt><tt id="link-275" class="py-name"><a title="CedarBackup3.extend
CedarBackup3.util.AbsolutePathList.extend
CedarBackup3.util.ObjectTypeList.extend
CedarBackup3.util.RegexList.extend
CedarBackup3.util.RegexMatchList.extend
CedarBackup3.util.RestrictedContentList.extend" class="py-name" href="#" onclick="return doclink('link-275', 'extend', 'link-82');">extend</a></tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L1487"></a><tt class="py-lineno">1487</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1488"></a><tt class="py-lineno">1488</tt> <tt class="py-line"> <tt id="link-276" class="py-name" targets="Function CedarBackup3.util.sanitizeEnvironment()=CedarBackup3.util-module.html#sanitizeEnvironment"><a title="CedarBackup3.util.sanitizeEnvironment" class="py-name" href="#" onclick="return doclink('link-276', 'sanitizeEnvironment', 'link-276');">sanitizeEnvironment</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-comment"># make sure we have a consistent environment</tt> </tt>
<a name="L1489"></a><tt class="py-lineno">1489</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1490"></a><tt class="py-lineno">1490</tt> <tt class="py-line"> <tt class="py-name">pipe</tt> <tt class="py-op">=</tt> <tt id="link-277" class="py-name" targets="Class CedarBackup3.util.Pipe=CedarBackup3.util.Pipe-class.html"><a title="CedarBackup3.util.Pipe" class="py-name" href="#" onclick="return doclink('link-277', 'Pipe', 'link-277');">Pipe</a></tt><tt class="py-op">(</tt><tt class="py-name">fields</tt><tt class="py-op">,</tt> <tt class="py-name">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">ignoreStderr</tt><tt class="py-op">)</tt> </tt>
<a name="L1491"></a><tt class="py-lineno">1491</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">OSError</tt><tt class="py-op">:</tt> </tt>
<a name="L1492"></a><tt class="py-lineno">1492</tt> <tt class="py-line"> <tt class="py-comment"># On some platforms (i.e. Cygwin) this intermittently fails the first time we do it.</tt> </tt>
<a name="L1493"></a><tt class="py-lineno">1493</tt> <tt class="py-line"> <tt class="py-comment"># So, we attempt it a second time and if that works, we just go on as usual.</tt> </tt>
<a name="L1494"></a><tt class="py-lineno">1494</tt> <tt class="py-line"> <tt class="py-comment"># The problem appears to be that we sometimes get a bad stderr file descriptor.</tt> </tt>
<a name="L1495"></a><tt class="py-lineno">1495</tt> <tt class="py-line"> <tt class="py-name">pipe</tt> <tt class="py-op">=</tt> <tt id="link-278" class="py-name"><a title="CedarBackup3.util.Pipe" class="py-name" href="#" onclick="return doclink('link-278', 'Pipe', 'link-277');">Pipe</a></tt><tt class="py-op">(</tt><tt class="py-name">fields</tt><tt class="py-op">,</tt> <tt class="py-name">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">ignoreStderr</tt><tt class="py-op">)</tt> </tt>
<a name="L1496"></a><tt class="py-lineno">1496</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L1497"></a><tt class="py-lineno">1497</tt> <tt class="py-line"> <tt class="py-name">line</tt> <tt class="py-op">=</tt> <tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">stdout</tt><tt class="py-op">.</tt><tt class="py-name">readline</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1498"></a><tt class="py-lineno">1498</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">line</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> </tt>
<a name="L1499"></a><tt class="py-lineno">1499</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">:</tt> <tt id="link-279" class="py-name"><a title="CedarBackup3.cli.Options.output
CedarBackup3.tools.amazons3.Options.output" class="py-name" href="#" onclick="return doclink('link-279', 'output', 'link-273');">output</a></tt><tt class="py-op">.</tt><tt id="link-280" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-280', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"utf-8"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1500"></a><tt class="py-lineno">1500</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">outputFile</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">outputFile</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L1501"></a><tt class="py-lineno">1501</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">doNotLog</tt><tt class="py-op">:</tt> <tt id="link-281" class="py-name"><a title="CedarBackup3.util.outputLogger" class="py-name" href="#" onclick="return doclink('link-281', 'outputLogger', 'link-7');">outputLogger</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"utf-8"</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># this way the log will (hopefully) get updated in realtime</tt> </tt>
<a name="L1502"></a><tt class="py-lineno">1502</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">outputFile</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1503"></a><tt class="py-lineno">1503</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-comment"># note, not every file-like object can be flushed</tt> </tt>
<a name="L1504"></a><tt class="py-lineno">1504</tt> <tt class="py-line"> <tt class="py-name">outputFile</tt><tt class="py-op">.</tt><tt class="py-name">flush</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1505"></a><tt class="py-lineno">1505</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
<a name="L1506"></a><tt class="py-lineno">1506</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">:</tt> </tt>
<a name="L1507"></a><tt class="py-lineno">1507</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">wait</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-282" class="py-name"><a title="CedarBackup3.cli.Options.output
CedarBackup3.tools.amazons3.Options.output" class="py-name" href="#" onclick="return doclink('link-282', 'output', 'link-273');">output</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1508"></a><tt class="py-lineno">1508</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1509"></a><tt class="py-lineno">1509</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">wait</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L1510"></a><tt class="py-lineno">1510</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">OSError</tt> <tt class="py-keyword">as</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L1511"></a><tt class="py-lineno">1511</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1512"></a><tt class="py-lineno">1512</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">:</tt> </tt>
<a name="L1513"></a><tt class="py-lineno">1513</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-283" class="py-name"><a title="CedarBackup3.cli.Options.output
CedarBackup3.tools.amazons3.Options.output" class="py-name" href="#" onclick="return doclink('link-283', 'output', 'link-273');">output</a></tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L1514"></a><tt class="py-lineno">1514</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">wait</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-284" class="py-name"><a title="CedarBackup3.cli.Options.output
CedarBackup3.tools.amazons3.Options.output" class="py-name" href="#" onclick="return doclink('link-284', 'output', 'link-273');">output</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1515"></a><tt class="py-lineno">1515</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1516"></a><tt class="py-lineno">1516</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">wait</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1517"></a><tt class="py-lineno">1517</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1518"></a><tt class="py-lineno">1518</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">pipe</tt><tt class="py-op">.</tt><tt class="py-name">wait</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L1519"></a><tt class="py-lineno">1519</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">UnboundLocalError</tt><tt class="py-op">:</tt> <tt class="py-comment"># pipe not set</tt> </tt>
<a name="L1520"></a><tt class="py-lineno">1520</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">:</tt> </tt>
<a name="L1521"></a><tt class="py-lineno">1521</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-number">256</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1522"></a><tt class="py-lineno">1522</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1523"></a><tt class="py-lineno">1523</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-number">256</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1524"></a><tt class="py-lineno">1524</tt> <tt class="py-line"> </tt>
<a name="calculateFileAge"></a><div id="calculateFileAge-def"><a name="L1525"></a><tt class="py-lineno">1525</tt> <tt class="py-line"> </tt>
<a name="L1526"></a><tt class="py-lineno">1526</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1527"></a><tt class="py-lineno">1527</tt> <tt class="py-line"><tt class="py-comment"># calculateFileAge() function</tt> </tt>
<a name="L1528"></a><tt class="py-lineno">1528</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1529"></a><tt class="py-lineno">1529</tt> <tt class="py-line"> </tt>
<a name="L1530"></a><tt class="py-lineno">1530</tt> <a class="py-toggle" href="#" id="calculateFileAge-toggle" onclick="return toggle('calculateFileAge');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#calculateFileAge">calculateFileAge</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="calculateFileAge-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="calculateFileAge-expanded"><a name="L1531"></a><tt class="py-lineno">1531</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1532"></a><tt class="py-lineno">1532</tt> <tt class="py-line"><tt class="py-docstring"> Calculates the age (in days) of a file.</tt> </tt>
<a name="L1533"></a><tt class="py-lineno">1533</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1534"></a><tt class="py-lineno">1534</tt> <tt class="py-line"><tt class="py-docstring"> The "age" of a file is the amount of time since the file was last used, per</tt> </tt>
<a name="L1535"></a><tt class="py-lineno">1535</tt> <tt class="py-line"><tt class="py-docstring"> the most recent of the file's C{st_atime} and C{st_mtime} values.</tt> </tt>
<a name="L1536"></a><tt class="py-lineno">1536</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1537"></a><tt class="py-lineno">1537</tt> <tt class="py-line"><tt class="py-docstring"> Technically, we only intend this function to work with files, but it will</tt> </tt>
<a name="L1538"></a><tt class="py-lineno">1538</tt> <tt class="py-line"><tt class="py-docstring"> probably work with anything on the filesystem.</tt> </tt>
<a name="L1539"></a><tt class="py-lineno">1539</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1540"></a><tt class="py-lineno">1540</tt> <tt class="py-line"><tt class="py-docstring"> @param path: Path to a file on disk.</tt> </tt>
<a name="L1541"></a><tt class="py-lineno">1541</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1542"></a><tt class="py-lineno">1542</tt> <tt class="py-line"><tt class="py-docstring"> @return: Age of the file in days (possibly fractional).</tt> </tt>
<a name="L1543"></a><tt class="py-lineno">1543</tt> <tt class="py-line"><tt class="py-docstring"> @raise OSError: If the file doesn't exist.</tt> </tt>
<a name="L1544"></a><tt class="py-lineno">1544</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1545"></a><tt class="py-lineno">1545</tt> <tt class="py-line"> <tt class="py-name">currentTime</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">time</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1546"></a><tt class="py-lineno">1546</tt> <tt class="py-line"> <tt class="py-name">fileStats</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">stat</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1547"></a><tt class="py-lineno">1547</tt> <tt class="py-line"> <tt class="py-name">lastUse</tt> <tt class="py-op">=</tt> <tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-name">fileStats</tt><tt class="py-op">.</tt><tt class="py-name">st_atime</tt><tt class="py-op">,</tt> <tt class="py-name">fileStats</tt><tt class="py-op">.</tt><tt class="py-name">st_mtime</tt><tt class="py-op">)</tt> <tt class="py-comment"># "most recent" is "largest"</tt> </tt>
<a name="L1548"></a><tt class="py-lineno">1548</tt> <tt class="py-line"> <tt class="py-name">ageInSeconds</tt> <tt class="py-op">=</tt> <tt class="py-name">currentTime</tt> <tt class="py-op">-</tt> <tt class="py-name">lastUse</tt> </tt>
<a name="L1549"></a><tt class="py-lineno">1549</tt> <tt class="py-line"> <tt class="py-name">ageInDays</tt> <tt class="py-op">=</tt> <tt class="py-name">ageInSeconds</tt> <tt class="py-op">/</tt> <tt id="link-285" class="py-name"><a title="CedarBackup3.util.SECONDS_PER_DAY" class="py-name" href="#" onclick="return doclink('link-285', 'SECONDS_PER_DAY', 'link-23');">SECONDS_PER_DAY</a></tt> </tt>
<a name="L1550"></a><tt class="py-lineno">1550</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">ageInDays</tt> </tt>
</div><a name="L1551"></a><tt class="py-lineno">1551</tt> <tt class="py-line"> </tt>
<a name="mount"></a><div id="mount-def"><a name="L1552"></a><tt class="py-lineno">1552</tt> <tt class="py-line"> </tt>
<a name="L1553"></a><tt class="py-lineno">1553</tt> <tt class="py-line"><tt class="py-comment">###################</tt> </tt>
<a name="L1554"></a><tt class="py-lineno">1554</tt> <tt class="py-line"><tt class="py-comment"># mount() function</tt> </tt>
<a name="L1555"></a><tt class="py-lineno">1555</tt> <tt class="py-line"><tt class="py-comment">###################</tt> </tt>
<a name="L1556"></a><tt class="py-lineno">1556</tt> <tt class="py-line"> </tt>
<a name="L1557"></a><tt class="py-lineno">1557</tt> <a class="py-toggle" href="#" id="mount-toggle" onclick="return toggle('mount');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#mount">mount</a><tt class="py-op">(</tt><tt class="py-param">devicePath</tt><tt class="py-op">,</tt> <tt class="py-param">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-param">fsType</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="mount-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="mount-expanded"><a name="L1558"></a><tt class="py-lineno">1558</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1559"></a><tt class="py-lineno">1559</tt> <tt class="py-line"><tt class="py-docstring"> Mounts the indicated device at the indicated mount point.</tt> </tt>
<a name="L1560"></a><tt class="py-lineno">1560</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1561"></a><tt class="py-lineno">1561</tt> <tt class="py-line"><tt class="py-docstring"> For instance, to mount a CD, you might use device path C{/dev/cdrw}, mount</tt> </tt>
<a name="L1562"></a><tt class="py-lineno">1562</tt> <tt class="py-line"><tt class="py-docstring"> point C{/media/cdrw} and filesystem type C{iso9660}. You can safely use any</tt> </tt>
<a name="L1563"></a><tt class="py-lineno">1563</tt> <tt class="py-line"><tt class="py-docstring"> filesystem type that is supported by C{mount} on your platform. If the type</tt> </tt>
<a name="L1564"></a><tt class="py-lineno">1564</tt> <tt class="py-line"><tt class="py-docstring"> is C{None}, we'll attempt to let C{mount} auto-detect it. This may or may</tt> </tt>
<a name="L1565"></a><tt class="py-lineno">1565</tt> <tt class="py-line"><tt class="py-docstring"> not work on all systems.</tt> </tt>
<a name="L1566"></a><tt class="py-lineno">1566</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1567"></a><tt class="py-lineno">1567</tt> <tt class="py-line"><tt class="py-docstring"> @note: This only works on platforms that have a concept of "mounting" a</tt> </tt>
<a name="L1568"></a><tt class="py-lineno">1568</tt> <tt class="py-line"><tt class="py-docstring"> filesystem through a command-line C{"mount"} command, like UNIXes. It</tt> </tt>
<a name="L1569"></a><tt class="py-lineno">1569</tt> <tt class="py-line"><tt class="py-docstring"> won't work on Windows.</tt> </tt>
<a name="L1570"></a><tt class="py-lineno">1570</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1571"></a><tt class="py-lineno">1571</tt> <tt class="py-line"><tt class="py-docstring"> @param devicePath: Path of device to be mounted.</tt> </tt>
<a name="L1572"></a><tt class="py-lineno">1572</tt> <tt class="py-line"><tt class="py-docstring"> @param mountPoint: Path that device should be mounted at.</tt> </tt>
<a name="L1573"></a><tt class="py-lineno">1573</tt> <tt class="py-line"><tt class="py-docstring"> @param fsType: Type of the filesystem assumed to be available via the device.</tt> </tt>
<a name="L1574"></a><tt class="py-lineno">1574</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1575"></a><tt class="py-lineno">1575</tt> <tt class="py-line"><tt class="py-docstring"> @raise IOError: If the device cannot be mounted.</tt> </tt>
<a name="L1576"></a><tt class="py-lineno">1576</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1577"></a><tt class="py-lineno">1577</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">fsType</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1578"></a><tt class="py-lineno">1578</tt> <tt class="py-line"> <tt class="py-name">args</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> <tt id="link-286" class="py-name" targets="Variable CedarBackup3.config.StoreConfig.devicePath=CedarBackup3.config.StoreConfig-class.html#devicePath"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-286', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt> <tt class="py-op">]</tt> </tt>
<a name="L1579"></a><tt class="py-lineno">1579</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1580"></a><tt class="py-lineno">1580</tt> <tt class="py-line"> <tt class="py-name">args</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> <tt class="py-string">"-t"</tt><tt class="py-op">,</tt> <tt class="py-name">fsType</tt><tt class="py-op">,</tt> <tt id="link-287" class="py-name"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-287', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt> <tt class="py-op">]</tt> </tt>
<a name="L1581"></a><tt class="py-lineno">1581</tt> <tt class="py-line"> <tt id="link-288" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-288', 'command', 'link-260');">command</a></tt> <tt class="py-op">=</tt> <tt id="link-289" class="py-name" targets="Function CedarBackup3.util.resolveCommand()=CedarBackup3.util-module.html#resolveCommand"><a title="CedarBackup3.util.resolveCommand" class="py-name" href="#" onclick="return doclink('link-289', 'resolveCommand', 'link-289');">resolveCommand</a></tt><tt class="py-op">(</tt><tt id="link-290" class="py-name"><a title="CedarBackup3.util.MOUNT_COMMAND" class="py-name" href="#" onclick="return doclink('link-290', 'MOUNT_COMMAND', 'link-33');">MOUNT_COMMAND</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1582"></a><tt class="py-lineno">1582</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-291" class="py-name" targets="Function CedarBackup3.util.executeCommand()=CedarBackup3.util-module.html#executeCommand"><a title="CedarBackup3.util.executeCommand" class="py-name" href="#" onclick="return doclink('link-291', 'executeCommand', 'link-291');">executeCommand</a></tt><tt class="py-op">(</tt><tt id="link-292" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-292', 'command', 'link-260');">command</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1583"></a><tt class="py-lineno">1583</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">result</tt> <tt class="py-op">!=</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1584"></a><tt class="py-lineno">1584</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">"Error [%d] mounting [%s] at [%s] as [%s]."</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">,</tt> <tt id="link-293" class="py-name"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-293', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-name">fsType</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1585"></a><tt class="py-lineno">1585</tt> <tt class="py-line"> </tt>
<a name="unmount"></a><div id="unmount-def"><a name="L1586"></a><tt class="py-lineno">1586</tt> <tt class="py-line"> </tt>
<a name="L1587"></a><tt class="py-lineno">1587</tt> <tt class="py-line"><tt class="py-comment">#####################</tt> </tt>
<a name="L1588"></a><tt class="py-lineno">1588</tt> <tt class="py-line"><tt class="py-comment"># unmount() function</tt> </tt>
<a name="L1589"></a><tt class="py-lineno">1589</tt> <tt class="py-line"><tt class="py-comment">#####################</tt> </tt>
<a name="L1590"></a><tt class="py-lineno">1590</tt> <tt class="py-line"> </tt>
<a name="L1591"></a><tt class="py-lineno">1591</tt> <a class="py-toggle" href="#" id="unmount-toggle" onclick="return toggle('unmount');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#unmount">unmount</a><tt class="py-op">(</tt><tt class="py-param">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-param">removeAfter</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">attempts</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-param">waitSeconds</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="unmount-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="unmount-expanded"><a name="L1592"></a><tt class="py-lineno">1592</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1593"></a><tt class="py-lineno">1593</tt> <tt class="py-line"><tt class="py-docstring"> Unmounts whatever device is mounted at the indicated mount point.</tt> </tt>
<a name="L1594"></a><tt class="py-lineno">1594</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1595"></a><tt class="py-lineno">1595</tt> <tt class="py-line"><tt class="py-docstring"> Sometimes, it might not be possible to unmount the mount point immediately,</tt> </tt>
<a name="L1596"></a><tt class="py-lineno">1596</tt> <tt class="py-line"><tt class="py-docstring"> if there are still files open there. Use the C{attempts} and C{waitSeconds}</tt> </tt>
<a name="L1597"></a><tt class="py-lineno">1597</tt> <tt class="py-line"><tt class="py-docstring"> arguments to indicate how many unmount attempts to make and how many seconds</tt> </tt>
<a name="L1598"></a><tt class="py-lineno">1598</tt> <tt class="py-line"><tt class="py-docstring"> to wait between attempts. If you pass in zero attempts, no attempts will be</tt> </tt>
<a name="L1599"></a><tt class="py-lineno">1599</tt> <tt class="py-line"><tt class="py-docstring"> made (duh).</tt> </tt>
<a name="L1600"></a><tt class="py-lineno">1600</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1601"></a><tt class="py-lineno">1601</tt> <tt class="py-line"><tt class="py-docstring"> If the indicated mount point is not really a mount point per</tt> </tt>
<a name="L1602"></a><tt class="py-lineno">1602</tt> <tt class="py-line"><tt class="py-docstring"> C{os.path.ismount()}, then it will be ignored. This seems to be a safer</tt> </tt>
<a name="L1603"></a><tt class="py-lineno">1603</tt> <tt class="py-line"><tt class="py-docstring"> check then looking through C{/etc/mtab}, since C{ismount()} is already in</tt> </tt>
<a name="L1604"></a><tt class="py-lineno">1604</tt> <tt class="py-line"><tt class="py-docstring"> the Python standard library and is documented as working on all POSIX</tt> </tt>
<a name="L1605"></a><tt class="py-lineno">1605</tt> <tt class="py-line"><tt class="py-docstring"> systems.</tt> </tt>
<a name="L1606"></a><tt class="py-lineno">1606</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1607"></a><tt class="py-lineno">1607</tt> <tt class="py-line"><tt class="py-docstring"> If C{removeAfter} is C{True}, then the mount point will be removed using</tt> </tt>
<a name="L1608"></a><tt class="py-lineno">1608</tt> <tt class="py-line"><tt class="py-docstring"> C{os.rmdir()} after the unmount action succeeds. If for some reason the</tt> </tt>
<a name="L1609"></a><tt class="py-lineno">1609</tt> <tt class="py-line"><tt class="py-docstring"> mount point is not a directory, then it will not be removed.</tt> </tt>
<a name="L1610"></a><tt class="py-lineno">1610</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1611"></a><tt class="py-lineno">1611</tt> <tt class="py-line"><tt class="py-docstring"> @note: This only works on platforms that have a concept of "mounting" a</tt> </tt>
<a name="L1612"></a><tt class="py-lineno">1612</tt> <tt class="py-line"><tt class="py-docstring"> filesystem through a command-line C{"mount"} command, like UNIXes. It</tt> </tt>
<a name="L1613"></a><tt class="py-lineno">1613</tt> <tt class="py-line"><tt class="py-docstring"> won't work on Windows.</tt> </tt>
<a name="L1614"></a><tt class="py-lineno">1614</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1615"></a><tt class="py-lineno">1615</tt> <tt class="py-line"><tt class="py-docstring"> @param mountPoint: Mount point to be unmounted.</tt> </tt>
<a name="L1616"></a><tt class="py-lineno">1616</tt> <tt class="py-line"><tt class="py-docstring"> @param removeAfter: Remove the mount point after unmounting it.</tt> </tt>
<a name="L1617"></a><tt class="py-lineno">1617</tt> <tt class="py-line"><tt class="py-docstring"> @param attempts: Number of times to attempt the unmount.</tt> </tt>
<a name="L1618"></a><tt class="py-lineno">1618</tt> <tt class="py-line"><tt class="py-docstring"> @param waitSeconds: Number of seconds to wait between repeated attempts.</tt> </tt>
<a name="L1619"></a><tt class="py-lineno">1619</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1620"></a><tt class="py-lineno">1620</tt> <tt class="py-line"><tt class="py-docstring"> @raise IOError: If the mount point is still mounted after attempts are exhausted.</tt> </tt>
<a name="L1621"></a><tt class="py-lineno">1621</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1622"></a><tt class="py-lineno">1622</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">ismount</tt><tt class="py-op">(</tt><tt class="py-name">mountPoint</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1623"></a><tt class="py-lineno">1623</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">attempt</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">attempts</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1624"></a><tt class="py-lineno">1624</tt> <tt class="py-line"> <tt id="link-294" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-294', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-295" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-295', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Making attempt %d to unmount [%s]."</tt><tt class="py-op">,</tt> <tt class="py-name">attempt</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
<a name="L1625"></a><tt class="py-lineno">1625</tt> <tt class="py-line"> <tt id="link-296" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-296', 'command', 'link-260');">command</a></tt> <tt class="py-op">=</tt> <tt id="link-297" class="py-name"><a title="CedarBackup3.util.resolveCommand" class="py-name" href="#" onclick="return doclink('link-297', 'resolveCommand', 'link-289');">resolveCommand</a></tt><tt class="py-op">(</tt><tt id="link-298" class="py-name"><a title="CedarBackup3.util.UMOUNT_COMMAND" class="py-name" href="#" onclick="return doclink('link-298', 'UMOUNT_COMMAND', 'link-34');">UMOUNT_COMMAND</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1626"></a><tt class="py-lineno">1626</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-299" class="py-name"><a title="CedarBackup3.util.executeCommand" class="py-name" href="#" onclick="return doclink('link-299', 'executeCommand', 'link-291');">executeCommand</a></tt><tt class="py-op">(</tt><tt id="link-300" class="py-name"><a title="CedarBackup3.config.ActionHook.command
CedarBackup3.config.CommandOverride.command" class="py-name" href="#" onclick="return doclink('link-300', 'command', 'link-260');">command</a></tt><tt class="py-op">,</tt> <tt class="py-op">[</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">returnOutput</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">ignoreStderr</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1627"></a><tt class="py-lineno">1627</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">result</tt> <tt class="py-op">!=</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1628"></a><tt class="py-lineno">1628</tt> <tt class="py-line"> <tt id="link-301" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-301', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">"Error [%d] unmounting [%s] on attempt %d."</tt><tt class="py-op">,</tt> <tt class="py-name">result</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-name">attempt</tt><tt class="py-op">)</tt> </tt>
<a name="L1629"></a><tt class="py-lineno">1629</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">ismount</tt><tt class="py-op">(</tt><tt class="py-name">mountPoint</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1630"></a><tt class="py-lineno">1630</tt> <tt class="py-line"> <tt id="link-302" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-302', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">"After attempt %d, [%s] is still mounted."</tt><tt class="py-op">,</tt> <tt class="py-name">attempt</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
<a name="L1631"></a><tt class="py-lineno">1631</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1632"></a><tt class="py-lineno">1632</tt> <tt class="py-line"> <tt id="link-303" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-303', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-304" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-304', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Successfully unmounted [%s] on attempt %d."</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-name">attempt</tt><tt class="py-op">)</tt> </tt>
<a name="L1633"></a><tt class="py-lineno">1633</tt> <tt class="py-line"> <tt class="py-keyword">break</tt> <tt class="py-comment"># this will cause us to skip the loop else: clause</tt> </tt>
<a name="L1634"></a><tt class="py-lineno">1634</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">attempt</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> <tt class="py-op"><</tt> <tt class="py-name">attempts</tt><tt class="py-op">:</tt> <tt class="py-comment"># i.e. this isn't the last attempt</tt> </tt>
<a name="L1635"></a><tt class="py-lineno">1635</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">waitSeconds</tt> <tt class="py-op">></tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1636"></a><tt class="py-lineno">1636</tt> <tt class="py-line"> <tt id="link-305" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-305', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">"Sleeping %d second(s) before next unmount attempt."</tt><tt class="py-op">,</tt> <tt class="py-name">waitSeconds</tt><tt class="py-op">)</tt> </tt>
<a name="L1637"></a><tt class="py-lineno">1637</tt> <tt class="py-line"> <tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">sleep</tt><tt class="py-op">(</tt><tt class="py-name">waitSeconds</tt><tt class="py-op">)</tt> </tt>
<a name="L1638"></a><tt class="py-lineno">1638</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1639"></a><tt class="py-lineno">1639</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">ismount</tt><tt class="py-op">(</tt><tt class="py-name">mountPoint</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1640"></a><tt class="py-lineno">1640</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">"Unable to unmount [%s] after %d attempts."</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-name">attempts</tt><tt class="py-op">)</tt> </tt>
<a name="L1641"></a><tt class="py-lineno">1641</tt> <tt class="py-line"> <tt id="link-306" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-306', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">info</tt><tt class="py-op">(</tt><tt class="py-string">"Mount point [%s] seems to have finally gone away."</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
<a name="L1642"></a><tt class="py-lineno">1642</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">isdir</tt><tt class="py-op">(</tt><tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">removeAfter</tt><tt class="py-op">:</tt> </tt>
<a name="L1643"></a><tt class="py-lineno">1643</tt> <tt class="py-line"> <tt id="link-307" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-307', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-308" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-308', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Removing mount point [%s]."</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
<a name="L1644"></a><tt class="py-lineno">1644</tt> <tt class="py-line"> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">rmdir</tt><tt class="py-op">(</tt><tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1645"></a><tt class="py-lineno">1645</tt> <tt class="py-line"> </tt>
<a name="deviceMounted"></a><div id="deviceMounted-def"><a name="L1646"></a><tt class="py-lineno">1646</tt> <tt class="py-line"> </tt>
<a name="L1647"></a><tt class="py-lineno">1647</tt> <tt class="py-line"><tt class="py-comment">###########################</tt> </tt>
<a name="L1648"></a><tt class="py-lineno">1648</tt> <tt class="py-line"><tt class="py-comment"># deviceMounted() function</tt> </tt>
<a name="L1649"></a><tt class="py-lineno">1649</tt> <tt class="py-line"><tt class="py-comment">###########################</tt> </tt>
<a name="L1650"></a><tt class="py-lineno">1650</tt> <tt class="py-line"> </tt>
<a name="L1651"></a><tt class="py-lineno">1651</tt> <a class="py-toggle" href="#" id="deviceMounted-toggle" onclick="return toggle('deviceMounted');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#deviceMounted">deviceMounted</a><tt class="py-op">(</tt><tt class="py-param">devicePath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="deviceMounted-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="deviceMounted-expanded"><a name="L1652"></a><tt class="py-lineno">1652</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1653"></a><tt class="py-lineno">1653</tt> <tt class="py-line"><tt class="py-docstring"> Indicates whether a specific filesystem device is currently mounted.</tt> </tt>
<a name="L1654"></a><tt class="py-lineno">1654</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1655"></a><tt class="py-lineno">1655</tt> <tt class="py-line"><tt class="py-docstring"> We determine whether the device is mounted by looking through the system's</tt> </tt>
<a name="L1656"></a><tt class="py-lineno">1656</tt> <tt class="py-line"><tt class="py-docstring"> C{mtab} file. This file shows every currently-mounted filesystem, ordered</tt> </tt>
<a name="L1657"></a><tt class="py-lineno">1657</tt> <tt class="py-line"><tt class="py-docstring"> by device. We only do the check if the C{mtab} file exists and is readable.</tt> </tt>
<a name="L1658"></a><tt class="py-lineno">1658</tt> <tt class="py-line"><tt class="py-docstring"> Otherwise, we assume that the device is not mounted.</tt> </tt>
<a name="L1659"></a><tt class="py-lineno">1659</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1660"></a><tt class="py-lineno">1660</tt> <tt class="py-line"><tt class="py-docstring"> @note: This only works on platforms that have a concept of an mtab file</tt> </tt>
<a name="L1661"></a><tt class="py-lineno">1661</tt> <tt class="py-line"><tt class="py-docstring"> to show mounted volumes, like UNIXes. It won't work on Windows.</tt> </tt>
<a name="L1662"></a><tt class="py-lineno">1662</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1663"></a><tt class="py-lineno">1663</tt> <tt class="py-line"><tt class="py-docstring"> @param devicePath: Path of device to be checked</tt> </tt>
<a name="L1664"></a><tt class="py-lineno">1664</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1665"></a><tt class="py-lineno">1665</tt> <tt class="py-line"><tt class="py-docstring"> @return: True if device is mounted, false otherwise.</tt> </tt>
<a name="L1666"></a><tt class="py-lineno">1666</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1667"></a><tt class="py-lineno">1667</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">exists</tt><tt class="py-op">(</tt><tt id="link-309" class="py-name"><a title="CedarBackup3.util.MTAB_FILE" class="py-name" href="#" onclick="return doclink('link-309', 'MTAB_FILE', 'link-32');">MTAB_FILE</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">access</tt><tt class="py-op">(</tt><tt id="link-310" class="py-name"><a title="CedarBackup3.util.MTAB_FILE" class="py-name" href="#" onclick="return doclink('link-310', 'MTAB_FILE', 'link-32');">MTAB_FILE</a></tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">R_OK</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1668"></a><tt class="py-lineno">1668</tt> <tt class="py-line"> <tt class="py-name">realPath</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">realpath</tt><tt class="py-op">(</tt><tt id="link-311" class="py-name"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-311', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1669"></a><tt class="py-lineno">1669</tt> <tt class="py-line"> <tt class="py-keyword">with</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt id="link-312" class="py-name"><a title="CedarBackup3.util.MTAB_FILE" class="py-name" href="#" onclick="return doclink('link-312', 'MTAB_FILE', 'link-32');">MTAB_FILE</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">as</tt> <tt class="py-name">f</tt><tt class="py-op">:</tt> </tt>
<a name="L1670"></a><tt class="py-lineno">1670</tt> <tt class="py-line"> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">readlines</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1671"></a><tt class="py-lineno">1671</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
<a name="L1672"></a><tt class="py-lineno">1672</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">mountDevice</tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">,</tt> <tt class="py-name">remainder</tt><tt class="py-op">)</tt> <tt class="py-op">=</tt> <tt class="py-name">line</tt><tt class="py-op">.</tt><tt id="link-313" class="py-name"><a title="CedarBackup3.extend.split
CedarBackup3.extend.split.LocalConfig.split" class="py-name" href="#" onclick="return doclink('link-313', 'split', 'link-233');">split</a></tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L1673"></a><tt class="py-lineno">1673</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">mountDevice</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt> <tt id="link-314" class="py-name"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-314', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">,</tt> <tt class="py-name">realPath</tt><tt class="py-op">,</tt> <tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L1674"></a><tt class="py-lineno">1674</tt> <tt class="py-line"> <tt id="link-315" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-315', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-316" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-316', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Device [%s] is mounted at [%s]."</tt><tt class="py-op">,</tt> <tt id="link-317" class="py-name"><a title="CedarBackup3.config.StoreConfig.devicePath" class="py-name" href="#" onclick="return doclink('link-317', 'devicePath', 'link-286');">devicePath</a></tt><tt class="py-op">,</tt> <tt class="py-name">mountPoint</tt><tt class="py-op">)</tt> </tt>
<a name="L1675"></a><tt class="py-lineno">1675</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L1676"></a><tt class="py-lineno">1676</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L1677"></a><tt class="py-lineno">1677</tt> <tt class="py-line"> </tt>
<a name="encodePath"></a><div id="encodePath-def"><a name="L1678"></a><tt class="py-lineno">1678</tt> <tt class="py-line"> </tt>
<a name="L1679"></a><tt class="py-lineno">1679</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1680"></a><tt class="py-lineno">1680</tt> <tt class="py-line"><tt class="py-comment"># encodePath() function</tt> </tt>
<a name="L1681"></a><tt class="py-lineno">1681</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1682"></a><tt class="py-lineno">1682</tt> <tt class="py-line"> </tt>
<a name="L1683"></a><tt class="py-lineno">1683</tt> <a class="py-toggle" href="#" id="encodePath-toggle" onclick="return toggle('encodePath');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#encodePath">encodePath</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="encodePath-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="encodePath-expanded"><a name="L1684"></a><tt class="py-lineno">1684</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1685"></a><tt class="py-lineno">1685</tt> <tt class="py-line"><tt class="py-docstring"> Safely encodes a filesystem path as a Unicode string, converting bytes to fileystem encoding if necessary.</tt> </tt>
<a name="L1686"></a><tt class="py-lineno">1686</tt> <tt class="py-line"><tt class="py-docstring"> @param path: Path to encode</tt> </tt>
<a name="L1687"></a><tt class="py-lineno">1687</tt> <tt class="py-line"><tt class="py-docstring"> @return: Path, as a string, encoded appropriately</tt> </tt>
<a name="L1688"></a><tt class="py-lineno">1688</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the path cannot be encoded properly.</tt> </tt>
<a name="L1689"></a><tt class="py-lineno">1689</tt> <tt class="py-line"><tt class="py-docstring"> @see: http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/</tt> </tt>
<a name="L1690"></a><tt class="py-lineno">1690</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1691"></a><tt class="py-lineno">1691</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">path</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1692"></a><tt class="py-lineno">1692</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">path</tt> </tt>
<a name="L1693"></a><tt class="py-lineno">1693</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1694"></a><tt class="py-lineno">1694</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt id="link-318" class="py-name"><a title="CedarBackup3.config.ByteQuantity.bytes" class="py-name" href="#" onclick="return doclink('link-318', 'bytes', 'link-214');">bytes</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1695"></a><tt class="py-lineno">1695</tt> <tt class="py-line"> <tt id="link-319" class="py-name"><a title="CedarBackup3.util.Diagnostics.encoding" class="py-name" href="#" onclick="return doclink('link-319', 'encoding', 'link-162');">encoding</a></tt> <tt class="py-op">=</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">getfilesystemencoding</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">getdefaultencoding</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1696"></a><tt class="py-lineno">1696</tt> <tt class="py-line"> <tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt id="link-320" class="py-name"><a title="CedarBackup3.util.Diagnostics.encoding" class="py-name" href="#" onclick="return doclink('link-320', 'encoding', 'link-162');">encoding</a></tt><tt class="py-op">,</tt> <tt class="py-string">"surrogateescape"</tt><tt class="py-op">)</tt> <tt class="py-comment"># to match what os.listdir() does</tt> </tt>
<a name="L1697"></a><tt class="py-lineno">1697</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">path</tt> </tt>
<a name="L1698"></a><tt class="py-lineno">1698</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">UnicodeError</tt> <tt class="py-keyword">as</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L1699"></a><tt class="py-lineno">1699</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Path could not be safely encoded as %s: %s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-321" class="py-name"><a title="CedarBackup3.util.Diagnostics.encoding" class="py-name" href="#" onclick="return doclink('link-321', 'encoding', 'link-162');">encoding</a></tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1700"></a><tt class="py-lineno">1700</tt> <tt class="py-line"> </tt>
<a name="nullDevice"></a><div id="nullDevice-def"><a name="L1701"></a><tt class="py-lineno">1701</tt> <tt class="py-line"> </tt>
<a name="L1702"></a><tt class="py-lineno">1702</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1703"></a><tt class="py-lineno">1703</tt> <tt class="py-line"><tt class="py-comment"># nullDevice() function</tt> </tt>
<a name="L1704"></a><tt class="py-lineno">1704</tt> <tt class="py-line"><tt class="py-comment">########################</tt> </tt>
<a name="L1705"></a><tt class="py-lineno">1705</tt> <tt class="py-line"> </tt>
<a name="L1706"></a><tt class="py-lineno">1706</tt> <a class="py-toggle" href="#" id="nullDevice-toggle" onclick="return toggle('nullDevice');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#nullDevice">nullDevice</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="nullDevice-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="nullDevice-expanded"><a name="L1707"></a><tt class="py-lineno">1707</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1708"></a><tt class="py-lineno">1708</tt> <tt class="py-line"><tt class="py-docstring"> Attempts to portably return the null device on this system.</tt> </tt>
<a name="L1709"></a><tt class="py-lineno">1709</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1710"></a><tt class="py-lineno">1710</tt> <tt class="py-line"><tt class="py-docstring"> The null device is something like C{/dev/null} on a UNIX system. The name</tt> </tt>
<a name="L1711"></a><tt class="py-lineno">1711</tt> <tt class="py-line"><tt class="py-docstring"> varies on other platforms.</tt> </tt>
<a name="L1712"></a><tt class="py-lineno">1712</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1713"></a><tt class="py-lineno">1713</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">devnull</tt> </tt>
</div><a name="L1714"></a><tt class="py-lineno">1714</tt> <tt class="py-line"> </tt>
<a name="deriveDayOfWeek"></a><div id="deriveDayOfWeek-def"><a name="L1715"></a><tt class="py-lineno">1715</tt> <tt class="py-line"> </tt>
<a name="L1716"></a><tt class="py-lineno">1716</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1717"></a><tt class="py-lineno">1717</tt> <tt class="py-line"><tt class="py-comment"># deriveDayOfWeek() function</tt> </tt>
<a name="L1718"></a><tt class="py-lineno">1718</tt> <tt class="py-line"><tt class="py-comment">##############################</tt> </tt>
<a name="L1719"></a><tt class="py-lineno">1719</tt> <tt class="py-line"> </tt>
<a name="L1720"></a><tt class="py-lineno">1720</tt> <a class="py-toggle" href="#" id="deriveDayOfWeek-toggle" onclick="return toggle('deriveDayOfWeek');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#deriveDayOfWeek">deriveDayOfWeek</a><tt class="py-op">(</tt><tt class="py-param">dayName</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="deriveDayOfWeek-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="deriveDayOfWeek-expanded"><a name="L1721"></a><tt class="py-lineno">1721</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1722"></a><tt class="py-lineno">1722</tt> <tt class="py-line"><tt class="py-docstring"> Converts English day name to numeric day of week as from C{time.localtime}.</tt> </tt>
<a name="L1723"></a><tt class="py-lineno">1723</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1724"></a><tt class="py-lineno">1724</tt> <tt class="py-line"><tt class="py-docstring"> For instance, the day C{monday} would be converted to the number C{0}.</tt> </tt>
<a name="L1725"></a><tt class="py-lineno">1725</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1726"></a><tt class="py-lineno">1726</tt> <tt class="py-line"><tt class="py-docstring"> @param dayName: Day of week to convert</tt> </tt>
<a name="L1727"></a><tt class="py-lineno">1727</tt> <tt class="py-line"><tt class="py-docstring"> @type dayName: string, i.e. C{"monday"}, C{"tuesday"}, etc.</tt> </tt>
<a name="L1728"></a><tt class="py-lineno">1728</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1729"></a><tt class="py-lineno">1729</tt> <tt class="py-line"><tt class="py-docstring"> @returns: Integer, where Monday is 0 and Sunday is 6; or -1 if no conversion is possible.</tt> </tt>
<a name="L1730"></a><tt class="py-lineno">1730</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1731"></a><tt class="py-lineno">1731</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"monday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1732"></a><tt class="py-lineno">1732</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
<a name="L1733"></a><tt class="py-lineno">1733</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"tuesday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1734"></a><tt class="py-lineno">1734</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
<a name="L1735"></a><tt class="py-lineno">1735</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"wednesday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1736"></a><tt class="py-lineno">1736</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">2</tt> </tt>
<a name="L1737"></a><tt class="py-lineno">1737</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"thursday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1738"></a><tt class="py-lineno">1738</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">3</tt> </tt>
<a name="L1739"></a><tt class="py-lineno">1739</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"friday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1740"></a><tt class="py-lineno">1740</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">4</tt> </tt>
<a name="L1741"></a><tt class="py-lineno">1741</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"saturday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1742"></a><tt class="py-lineno">1742</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">5</tt> </tt>
<a name="L1743"></a><tt class="py-lineno">1743</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">dayName</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"sunday"</tt><tt class="py-op">:</tt> </tt>
<a name="L1744"></a><tt class="py-lineno">1744</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">6</tt> </tt>
<a name="L1745"></a><tt class="py-lineno">1745</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1746"></a><tt class="py-lineno">1746</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> <tt class="py-comment"># What else can we do?? Thrown an exception, I guess.</tt> </tt>
</div><a name="L1747"></a><tt class="py-lineno">1747</tt> <tt class="py-line"> </tt>
<a name="isStartOfWeek"></a><div id="isStartOfWeek-def"><a name="L1748"></a><tt class="py-lineno">1748</tt> <tt class="py-line"> </tt>
<a name="L1749"></a><tt class="py-lineno">1749</tt> <tt class="py-line"><tt class="py-comment">###########################</tt> </tt>
<a name="L1750"></a><tt class="py-lineno">1750</tt> <tt class="py-line"><tt class="py-comment"># isStartOfWeek() function</tt> </tt>
<a name="L1751"></a><tt class="py-lineno">1751</tt> <tt class="py-line"><tt class="py-comment">###########################</tt> </tt>
<a name="L1752"></a><tt class="py-lineno">1752</tt> <tt class="py-line"> </tt>
<a name="L1753"></a><tt class="py-lineno">1753</tt> <a class="py-toggle" href="#" id="isStartOfWeek-toggle" onclick="return toggle('isStartOfWeek');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#isStartOfWeek">isStartOfWeek</a><tt class="py-op">(</tt><tt class="py-param">startingDay</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="isStartOfWeek-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="isStartOfWeek-expanded"><a name="L1754"></a><tt class="py-lineno">1754</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1755"></a><tt class="py-lineno">1755</tt> <tt class="py-line"><tt class="py-docstring"> Indicates whether "today" is the backup starting day per configuration.</tt> </tt>
<a name="L1756"></a><tt class="py-lineno">1756</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1757"></a><tt class="py-lineno">1757</tt> <tt class="py-line"><tt class="py-docstring"> If the current day's English name matches the indicated starting day, then</tt> </tt>
<a name="L1758"></a><tt class="py-lineno">1758</tt> <tt class="py-line"><tt class="py-docstring"> today is a starting day.</tt> </tt>
<a name="L1759"></a><tt class="py-lineno">1759</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1760"></a><tt class="py-lineno">1760</tt> <tt class="py-line"><tt class="py-docstring"> @param startingDay: Configured starting day.</tt> </tt>
<a name="L1761"></a><tt class="py-lineno">1761</tt> <tt class="py-line"><tt class="py-docstring"> @type startingDay: string, i.e. C{"monday"}, C{"tuesday"}, etc.</tt> </tt>
<a name="L1762"></a><tt class="py-lineno">1762</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1763"></a><tt class="py-lineno">1763</tt> <tt class="py-line"><tt class="py-docstring"> @return: Boolean indicating whether today is the starting day.</tt> </tt>
<a name="L1764"></a><tt class="py-lineno">1764</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1765"></a><tt class="py-lineno">1765</tt> <tt class="py-line"> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">time</tt><tt class="py-op">.</tt><tt class="py-name">localtime</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">tm_wday</tt> <tt class="py-op">==</tt> <tt id="link-322" class="py-name" targets="Function CedarBackup3.util.deriveDayOfWeek()=CedarBackup3.util-module.html#deriveDayOfWeek"><a title="CedarBackup3.util.deriveDayOfWeek" class="py-name" href="#" onclick="return doclink('link-322', 'deriveDayOfWeek', 'link-322');">deriveDayOfWeek</a></tt><tt class="py-op">(</tt><tt id="link-323" class="py-name" targets="Variable CedarBackup3.config.OptionsConfig.startingDay=CedarBackup3.config.OptionsConfig-class.html#startingDay"><a title="CedarBackup3.config.OptionsConfig.startingDay" class="py-name" href="#" onclick="return doclink('link-323', 'startingDay', 'link-323');">startingDay</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1766"></a><tt class="py-lineno">1766</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">value</tt><tt class="py-op">:</tt> </tt>
<a name="L1767"></a><tt class="py-lineno">1767</tt> <tt class="py-line"> <tt id="link-324" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-324', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-325" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-325', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Today is the start of the week."</tt><tt class="py-op">)</tt> </tt>
<a name="L1768"></a><tt class="py-lineno">1768</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1769"></a><tt class="py-lineno">1769</tt> <tt class="py-line"> <tt id="link-326" class="py-name"><a title="CedarBackup3.actions.collect.logger
CedarBackup3.actions.initialize.logger
CedarBackup3.actions.purge.logger
CedarBackup3.actions.rebuild.logger
CedarBackup3.actions.stage.logger
CedarBackup3.actions.store.logger
CedarBackup3.actions.util.logger
CedarBackup3.actions.validate.logger
CedarBackup3.cli.logger
CedarBackup3.config.logger
CedarBackup3.customize.logger
CedarBackup3.extend.amazons3.logger
CedarBackup3.extend.capacity.logger
CedarBackup3.extend.encrypt.logger
CedarBackup3.extend.mbox.logger
CedarBackup3.extend.mysql.logger
CedarBackup3.extend.postgresql.logger
CedarBackup3.extend.split.logger
CedarBackup3.extend.subversion.logger
CedarBackup3.extend.sysinfo.logger
CedarBackup3.filesystem.logger
CedarBackup3.peer.logger
CedarBackup3.tools.amazons3.logger
CedarBackup3.tools.span.logger
CedarBackup3.util.logger
CedarBackup3.writers.cdwriter.logger
CedarBackup3.writers.dvdwriter.logger
CedarBackup3.writers.util.logger
CedarBackup3.xmlutil.logger" class="py-name" href="#" onclick="return doclink('link-326', 'logger', 'link-6');">logger</a></tt><tt class="py-op">.</tt><tt id="link-327" class="py-name"><a title="CedarBackup3.cli.Options.debug
CedarBackup3.tools.amazons3.Options.debug" class="py-name" href="#" onclick="return doclink('link-327', 'debug', 'link-154');">debug</a></tt><tt class="py-op">(</tt><tt class="py-string">"Today is NOT the start of the week."</tt><tt class="py-op">)</tt> </tt>
<a name="L1770"></a><tt class="py-lineno">1770</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">value</tt> </tt>
</div><a name="L1771"></a><tt class="py-lineno">1771</tt> <tt class="py-line"> </tt>
<a name="buildNormalizedPath"></a><div id="buildNormalizedPath-def"><a name="L1772"></a><tt class="py-lineno">1772</tt> <tt class="py-line"> </tt>
<a name="L1773"></a><tt class="py-lineno">1773</tt> <tt class="py-line"><tt class="py-comment">#################################</tt> </tt>
<a name="L1774"></a><tt class="py-lineno">1774</tt> <tt class="py-line"><tt class="py-comment"># buildNormalizedPath() function</tt> </tt>
<a name="L1775"></a><tt class="py-lineno">1775</tt> <tt class="py-line"><tt class="py-comment">#################################</tt> </tt>
<a name="L1776"></a><tt class="py-lineno">1776</tt> <tt class="py-line"> </tt>
<a name="L1777"></a><tt class="py-lineno">1777</tt> <a class="py-toggle" href="#" id="buildNormalizedPath-toggle" onclick="return toggle('buildNormalizedPath');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#buildNormalizedPath">buildNormalizedPath</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="buildNormalizedPath-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="buildNormalizedPath-expanded"><a name="L1778"></a><tt class="py-lineno">1778</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1779"></a><tt class="py-lineno">1779</tt> <tt class="py-line"><tt class="py-docstring"> Returns a "normalized" path based on a path name.</tt> </tt>
<a name="L1780"></a><tt class="py-lineno">1780</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1781"></a><tt class="py-lineno">1781</tt> <tt class="py-line"><tt class="py-docstring"> A normalized path is a representation of a path that is also a valid file</tt> </tt>
<a name="L1782"></a><tt class="py-lineno">1782</tt> <tt class="py-line"><tt class="py-docstring"> name. To make a valid file name out of a complete path, we have to convert</tt> </tt>
<a name="L1783"></a><tt class="py-lineno">1783</tt> <tt class="py-line"><tt class="py-docstring"> or remove some characters that are significant to the filesystem -- in</tt> </tt>
<a name="L1784"></a><tt class="py-lineno">1784</tt> <tt class="py-line"><tt class="py-docstring"> particular, the path separator and any leading C{'.'} character (which would</tt> </tt>
<a name="L1785"></a><tt class="py-lineno">1785</tt> <tt class="py-line"><tt class="py-docstring"> cause the file to be hidden in a file listing).</tt> </tt>
<a name="L1786"></a><tt class="py-lineno">1786</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1787"></a><tt class="py-lineno">1787</tt> <tt class="py-line"><tt class="py-docstring"> Note that this is a one-way transformation -- you can't safely derive the</tt> </tt>
<a name="L1788"></a><tt class="py-lineno">1788</tt> <tt class="py-line"><tt class="py-docstring"> original path from the normalized path.</tt> </tt>
<a name="L1789"></a><tt class="py-lineno">1789</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1790"></a><tt class="py-lineno">1790</tt> <tt class="py-line"><tt class="py-docstring"> To normalize a path, we begin by looking at the first character. If the</tt> </tt>
<a name="L1791"></a><tt class="py-lineno">1791</tt> <tt class="py-line"><tt class="py-docstring"> first character is C{'/'} or C{'\\'}, it gets removed. If the first</tt> </tt>
<a name="L1792"></a><tt class="py-lineno">1792</tt> <tt class="py-line"><tt class="py-docstring"> character is C{'.'}, it gets converted to C{'_'}. Then, we look through the</tt> </tt>
<a name="L1793"></a><tt class="py-lineno">1793</tt> <tt class="py-line"><tt class="py-docstring"> rest of the path and convert all remaining C{'/'} or C{'\\'} characters</tt> </tt>
<a name="L1794"></a><tt class="py-lineno">1794</tt> <tt class="py-line"><tt class="py-docstring"> C{'-'}, and all remaining whitespace characters to C{'_'}.</tt> </tt>
<a name="L1795"></a><tt class="py-lineno">1795</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1796"></a><tt class="py-lineno">1796</tt> <tt class="py-line"><tt class="py-docstring"> As a special case, a path consisting only of a single C{'/'} or C{'\\'}</tt> </tt>
<a name="L1797"></a><tt class="py-lineno">1797</tt> <tt class="py-line"><tt class="py-docstring"> character will be converted to C{'-'}.</tt> </tt>
<a name="L1798"></a><tt class="py-lineno">1798</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1799"></a><tt class="py-lineno">1799</tt> <tt class="py-line"><tt class="py-docstring"> @param path: Path to normalize</tt> </tt>
<a name="L1800"></a><tt class="py-lineno">1800</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1801"></a><tt class="py-lineno">1801</tt> <tt class="py-line"><tt class="py-docstring"> @return: Normalized path as described above.</tt> </tt>
<a name="L1802"></a><tt class="py-lineno">1802</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1803"></a><tt class="py-lineno">1803</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If the path is None</tt> </tt>
<a name="L1804"></a><tt class="py-lineno">1804</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1805"></a><tt class="py-lineno">1805</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">path</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1806"></a><tt class="py-lineno">1806</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot normalize path None."</tt><tt class="py-op">)</tt> </tt>
<a name="L1807"></a><tt class="py-lineno">1807</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1808"></a><tt class="py-lineno">1808</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">path</tt> </tt>
<a name="L1809"></a><tt class="py-lineno">1809</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">path</tt> <tt class="py-op">==</tt> <tt class="py-string">"/"</tt> <tt class="py-keyword">or</tt> <tt class="py-name">path</tt> <tt class="py-op">==</tt> <tt class="py-string">"\\"</tt><tt class="py-op">:</tt> </tt>
<a name="L1810"></a><tt class="py-lineno">1810</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"-"</tt> </tt>
<a name="L1811"></a><tt class="py-lineno">1811</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1812"></a><tt class="py-lineno">1812</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">path</tt> </tt>
<a name="L1813"></a><tt class="py-lineno">1813</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"^\/"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># remove leading '/'</tt> </tt>
<a name="L1814"></a><tt class="py-lineno">1814</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"^\\"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># remove leading '\'</tt> </tt>
<a name="L1815"></a><tt class="py-lineno">1815</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"^\."</tt><tt class="py-op">,</tt> <tt class="py-string">"_"</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># convert leading '.' to '_' so file won't be hidden</tt> </tt>
<a name="L1816"></a><tt class="py-lineno">1816</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"\/"</tt><tt class="py-op">,</tt> <tt class="py-string">"-"</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># convert all '/' characters to '-'</tt> </tt>
<a name="L1817"></a><tt class="py-lineno">1817</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"\\"</tt><tt class="py-op">,</tt> <tt class="py-string">"-"</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># convert all '\' characters to '-'</tt> </tt>
<a name="L1818"></a><tt class="py-lineno">1818</tt> <tt class="py-line"> <tt class="py-name">normalized</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">sub</tt><tt class="py-op">(</tt><tt class="py-string">r"\s"</tt><tt class="py-op">,</tt> <tt class="py-string">"_"</tt><tt class="py-op">,</tt> <tt class="py-name">normalized</tt><tt class="py-op">)</tt> <tt class="py-comment"># convert all whitespace to '_'</tt> </tt>
<a name="L1819"></a><tt class="py-lineno">1819</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">normalized</tt> </tt>
</div><a name="L1820"></a><tt class="py-lineno">1820</tt> <tt class="py-line"> </tt>
<a name="sanitizeEnvironment"></a><div id="sanitizeEnvironment-def"><a name="L1821"></a><tt class="py-lineno">1821</tt> <tt class="py-line"> </tt>
<a name="L1822"></a><tt class="py-lineno">1822</tt> <tt class="py-line"><tt class="py-comment">#################################</tt> </tt>
<a name="L1823"></a><tt class="py-lineno">1823</tt> <tt class="py-line"><tt class="py-comment"># sanitizeEnvironment() function</tt> </tt>
<a name="L1824"></a><tt class="py-lineno">1824</tt> <tt class="py-line"><tt class="py-comment">#################################</tt> </tt>
<a name="L1825"></a><tt class="py-lineno">1825</tt> <tt class="py-line"> </tt>
<a name="L1826"></a><tt class="py-lineno">1826</tt> <a class="py-toggle" href="#" id="sanitizeEnvironment-toggle" onclick="return toggle('sanitizeEnvironment');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#sanitizeEnvironment">sanitizeEnvironment</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sanitizeEnvironment-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="sanitizeEnvironment-expanded"><a name="L1827"></a><tt class="py-lineno">1827</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1828"></a><tt class="py-lineno">1828</tt> <tt class="py-line"><tt class="py-docstring"> Sanitizes the operating system environment.</tt> </tt>
<a name="L1829"></a><tt class="py-lineno">1829</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1830"></a><tt class="py-lineno">1830</tt> <tt class="py-line"><tt class="py-docstring"> The operating system environment is contained in C{os.environ}. This method</tt> </tt>
<a name="L1831"></a><tt class="py-lineno">1831</tt> <tt class="py-line"><tt class="py-docstring"> sanitizes the contents of that dictionary.</tt> </tt>
<a name="L1832"></a><tt class="py-lineno">1832</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1833"></a><tt class="py-lineno">1833</tt> <tt class="py-line"><tt class="py-docstring"> Currently, all it does is reset the locale (removing C{$LC_*}) and set the</tt> </tt>
<a name="L1834"></a><tt class="py-lineno">1834</tt> <tt class="py-line"><tt class="py-docstring"> default language (C{$LANG}) to L{DEFAULT_LANGUAGE}. This way, we can count</tt> </tt>
<a name="L1835"></a><tt class="py-lineno">1835</tt> <tt class="py-line"><tt class="py-docstring"> on consistent localization regardless of what the end-user has configured.</tt> </tt>
<a name="L1836"></a><tt class="py-lineno">1836</tt> <tt class="py-line"><tt class="py-docstring"> This is important for code that needs to parse program output.</tt> </tt>
<a name="L1837"></a><tt class="py-lineno">1837</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1838"></a><tt class="py-lineno">1838</tt> <tt class="py-line"><tt class="py-docstring"> The C{os.environ} dictionary is modifed in-place. If C{$LANG} is already</tt> </tt>
<a name="L1839"></a><tt class="py-lineno">1839</tt> <tt class="py-line"><tt class="py-docstring"> set to the proper value, it is not re-set, so we can avoid the memory leaks</tt> </tt>
<a name="L1840"></a><tt class="py-lineno">1840</tt> <tt class="py-line"><tt class="py-docstring"> that are documented to occur on BSD-based systems.</tt> </tt>
<a name="L1841"></a><tt class="py-lineno">1841</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1842"></a><tt class="py-lineno">1842</tt> <tt class="py-line"><tt class="py-docstring"> @return: Copy of the sanitized environment.</tt> </tt>
<a name="L1843"></a><tt class="py-lineno">1843</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1844"></a><tt class="py-lineno">1844</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">var</tt> <tt class="py-keyword">in</tt> <tt id="link-328" class="py-name"><a title="CedarBackup3.util.LOCALE_VARS" class="py-name" href="#" onclick="return doclink('link-328', 'LOCALE_VARS', 'link-37');">LOCALE_VARS</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1845"></a><tt class="py-lineno">1845</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">var</tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">:</tt> </tt>
<a name="L1846"></a><tt class="py-lineno">1846</tt> <tt class="py-line"> <tt class="py-keyword">del</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">[</tt><tt class="py-name">var</tt><tt class="py-op">]</tt> </tt>
<a name="L1847"></a><tt class="py-lineno">1847</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-329" class="py-name"><a title="CedarBackup3.util.LANG_VAR" class="py-name" href="#" onclick="return doclink('link-329', 'LANG_VAR', 'link-36');">LANG_VAR</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">:</tt> </tt>
<a name="L1848"></a><tt class="py-lineno">1848</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">[</tt><tt id="link-330" class="py-name"><a title="CedarBackup3.util.LANG_VAR" class="py-name" href="#" onclick="return doclink('link-330', 'LANG_VAR', 'link-36');">LANG_VAR</a></tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt id="link-331" class="py-name"><a title="CedarBackup3.util.DEFAULT_LANGUAGE" class="py-name" href="#" onclick="return doclink('link-331', 'DEFAULT_LANGUAGE', 'link-35');">DEFAULT_LANGUAGE</a></tt><tt class="py-op">:</tt> <tt class="py-comment"># no need to reset if it exists (avoid leaks on BSD systems)</tt> </tt>
<a name="L1849"></a><tt class="py-lineno">1849</tt> <tt class="py-line"> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">[</tt><tt id="link-332" class="py-name"><a title="CedarBackup3.util.LANG_VAR" class="py-name" href="#" onclick="return doclink('link-332', 'LANG_VAR', 'link-36');">LANG_VAR</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-333" class="py-name"><a title="CedarBackup3.util.DEFAULT_LANGUAGE" class="py-name" href="#" onclick="return doclink('link-333', 'DEFAULT_LANGUAGE', 'link-35');">DEFAULT_LANGUAGE</a></tt> </tt>
<a name="L1850"></a><tt class="py-lineno">1850</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">.</tt><tt class="py-name">copy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1851"></a><tt class="py-lineno">1851</tt> <tt class="py-line"> </tt>
<a name="dereferenceLink"></a><div id="dereferenceLink-def"><a name="L1852"></a><tt class="py-lineno">1852</tt> <tt class="py-line"> </tt>
<a name="L1853"></a><tt class="py-lineno">1853</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1854"></a><tt class="py-lineno">1854</tt> <tt class="py-line"><tt class="py-comment"># dereferenceLink() function</tt> </tt>
<a name="L1855"></a><tt class="py-lineno">1855</tt> <tt class="py-line"><tt class="py-comment">#############################</tt> </tt>
<a name="L1856"></a><tt class="py-lineno">1856</tt> <tt class="py-line"> </tt>
<a name="L1857"></a><tt class="py-lineno">1857</tt> <a class="py-toggle" href="#" id="dereferenceLink-toggle" onclick="return toggle('dereferenceLink');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#dereferenceLink">dereferenceLink</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">absolute</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="dereferenceLink-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="dereferenceLink-expanded"><a name="L1858"></a><tt class="py-lineno">1858</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1859"></a><tt class="py-lineno">1859</tt> <tt class="py-line"><tt class="py-docstring"> Deference a soft link, optionally normalizing it to an absolute path.</tt> </tt>
<a name="L1860"></a><tt class="py-lineno">1860</tt> <tt class="py-line"><tt class="py-docstring"> @param path: Path of link to dereference</tt> </tt>
<a name="L1861"></a><tt class="py-lineno">1861</tt> <tt class="py-line"><tt class="py-docstring"> @param absolute: Whether to normalize the result to an absolute path</tt> </tt>
<a name="L1862"></a><tt class="py-lineno">1862</tt> <tt class="py-line"><tt class="py-docstring"> @return: Dereferenced path, or original path if original is not a link.</tt> </tt>
<a name="L1863"></a><tt class="py-lineno">1863</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1864"></a><tt class="py-lineno">1864</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">islink</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1865"></a><tt class="py-lineno">1865</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">readlink</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1866"></a><tt class="py-lineno">1866</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">absolute</tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">isabs</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1867"></a><tt class="py-lineno">1867</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">abspath</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">dirname</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">result</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1868"></a><tt class="py-lineno">1868</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
<a name="L1869"></a><tt class="py-lineno">1869</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">path</tt> </tt>
</div><a name="L1870"></a><tt class="py-lineno">1870</tt> <tt class="py-line"> </tt>
<a name="checkUnique"></a><div id="checkUnique-def"><a name="L1871"></a><tt class="py-lineno">1871</tt> <tt class="py-line"> </tt>
<a name="L1872"></a><tt class="py-lineno">1872</tt> <tt class="py-line"><tt class="py-comment">#########################</tt> </tt>
<a name="L1873"></a><tt class="py-lineno">1873</tt> <tt class="py-line"><tt class="py-comment"># checkUnique() function</tt> </tt>
<a name="L1874"></a><tt class="py-lineno">1874</tt> <tt class="py-line"><tt class="py-comment">#########################</tt> </tt>
<a name="L1875"></a><tt class="py-lineno">1875</tt> <tt class="py-line"> </tt>
<a name="L1876"></a><tt class="py-lineno">1876</tt> <a class="py-toggle" href="#" id="checkUnique-toggle" onclick="return toggle('checkUnique');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#checkUnique">checkUnique</a><tt class="py-op">(</tt><tt class="py-param">prefix</tt><tt class="py-op">,</tt> <tt class="py-param">values</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="checkUnique-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="checkUnique-expanded"><a name="L1877"></a><tt class="py-lineno">1877</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1878"></a><tt class="py-lineno">1878</tt> <tt class="py-line"><tt class="py-docstring"> Checks that all values are unique.</tt> </tt>
<a name="L1879"></a><tt class="py-lineno">1879</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1880"></a><tt class="py-lineno">1880</tt> <tt class="py-line"><tt class="py-docstring"> The values list is checked for duplicate values. If there are</tt> </tt>
<a name="L1881"></a><tt class="py-lineno">1881</tt> <tt class="py-line"><tt class="py-docstring"> duplicates, an exception is thrown. All duplicate values are listed in</tt> </tt>
<a name="L1882"></a><tt class="py-lineno">1882</tt> <tt class="py-line"><tt class="py-docstring"> the exception.</tt> </tt>
<a name="L1883"></a><tt class="py-lineno">1883</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1884"></a><tt class="py-lineno">1884</tt> <tt class="py-line"><tt class="py-docstring"> @param prefix: Prefix to use in the thrown exception</tt> </tt>
<a name="L1885"></a><tt class="py-lineno">1885</tt> <tt class="py-line"><tt class="py-docstring"> @param values: List of values to check</tt> </tt>
<a name="L1886"></a><tt class="py-lineno">1886</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1887"></a><tt class="py-lineno">1887</tt> <tt class="py-line"><tt class="py-docstring"> @raise ValueError: If there are duplicates in the list</tt> </tt>
<a name="L1888"></a><tt class="py-lineno">1888</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1889"></a><tt class="py-lineno">1889</tt> <tt class="py-line"> <tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1890"></a><tt class="py-lineno">1890</tt> <tt class="py-line"> <tt class="py-name">duplicates</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1891"></a><tt class="py-lineno">1891</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">values</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1892"></a><tt class="py-lineno">1892</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L1893"></a><tt class="py-lineno">1893</tt> <tt class="py-line"> <tt class="py-name">duplicates</tt><tt class="py-op">.</tt><tt id="link-334" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-334', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">values</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1894"></a><tt class="py-lineno">1894</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">duplicates</tt><tt class="py-op">:</tt> </tt>
<a name="L1895"></a><tt class="py-lineno">1895</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">"%s %s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">prefix</tt><tt class="py-op">,</tt> <tt class="py-name">duplicates</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1896"></a><tt class="py-lineno">1896</tt> <tt class="py-line"> </tt>
<a name="parseCommaSeparatedString"></a><div id="parseCommaSeparatedString-def"><a name="L1897"></a><tt class="py-lineno">1897</tt> <tt class="py-line"> </tt>
<a name="L1898"></a><tt class="py-lineno">1898</tt> <tt class="py-line"><tt class="py-comment">#######################################</tt> </tt>
<a name="L1899"></a><tt class="py-lineno">1899</tt> <tt class="py-line"><tt class="py-comment"># parseCommaSeparatedString() function</tt> </tt>
<a name="L1900"></a><tt class="py-lineno">1900</tt> <tt class="py-line"><tt class="py-comment">#######################################</tt> </tt>
<a name="L1901"></a><tt class="py-lineno">1901</tt> <tt class="py-line"> </tt>
<a name="L1902"></a><tt class="py-lineno">1902</tt> <a class="py-toggle" href="#" id="parseCommaSeparatedString-toggle" onclick="return toggle('parseCommaSeparatedString');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="CedarBackup3.util-module.html#parseCommaSeparatedString">parseCommaSeparatedString</a><tt class="py-op">(</tt><tt class="py-param">commaString</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="parseCommaSeparatedString-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="parseCommaSeparatedString-expanded"><a name="L1903"></a><tt class="py-lineno">1903</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
<a name="L1904"></a><tt class="py-lineno">1904</tt> <tt class="py-line"><tt class="py-docstring"> Parses a list of values out of a comma-separated string.</tt> </tt>
<a name="L1905"></a><tt class="py-lineno">1905</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1906"></a><tt class="py-lineno">1906</tt> <tt class="py-line"><tt class="py-docstring"> The items in the list are split by comma, and then have whitespace</tt> </tt>
<a name="L1907"></a><tt class="py-lineno">1907</tt> <tt class="py-line"><tt class="py-docstring"> stripped. As a special case, if C{commaString} is C{None}, then C{None}</tt> </tt>
<a name="L1908"></a><tt class="py-lineno">1908</tt> <tt class="py-line"><tt class="py-docstring"> will be returned.</tt> </tt>
<a name="L1909"></a><tt class="py-lineno">1909</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1910"></a><tt class="py-lineno">1910</tt> <tt class="py-line"><tt class="py-docstring"> @param commaString: List of values in comma-separated string format.</tt> </tt>
<a name="L1911"></a><tt class="py-lineno">1911</tt> <tt class="py-line"><tt class="py-docstring"> @return: Values from commaString split into a list, or C{None}.</tt> </tt>
<a name="L1912"></a><tt class="py-lineno">1912</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
<a name="L1913"></a><tt class="py-lineno">1913</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">commaString</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1914"></a><tt class="py-lineno">1914</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
<a name="L1915"></a><tt class="py-lineno">1915</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1916"></a><tt class="py-lineno">1916</tt> <tt class="py-line"> <tt class="py-name">pass1</tt> <tt class="py-op">=</tt> <tt class="py-name">commaString</tt><tt class="py-op">.</tt><tt id="link-335" class="py-name"><a title="CedarBackup3.extend.split
CedarBackup3.extend.split.LocalConfig.split" class="py-name" href="#" onclick="return doclink('link-335', 'split', 'link-233');">split</a></tt><tt class="py-op">(</tt><tt class="py-string">","</tt><tt class="py-op">)</tt> </tt>
<a name="L1917"></a><tt class="py-lineno">1917</tt> <tt class="py-line"> <tt class="py-name">pass2</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1918"></a><tt class="py-lineno">1918</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">pass1</tt><tt class="py-op">:</tt> </tt>
<a name="L1919"></a><tt class="py-lineno">1919</tt> <tt class="py-line"> <tt class="py-name">item</tt> <tt class="py-op">=</tt> <tt class="py-name">item</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1920"></a><tt class="py-lineno">1920</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt> <tt class="py-op">></tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1921"></a><tt class="py-lineno">1921</tt> <tt class="py-line"> <tt class="py-name">pass2</tt><tt class="py-op">.</tt><tt id="link-336" class="py-name"><a title="CedarBackup3.util.AbsolutePathList.append
CedarBackup3.util.ObjectTypeList.append
CedarBackup3.util.RegexList.append
CedarBackup3.util.RegexMatchList.append
CedarBackup3.util.RestrictedContentList.append" class="py-name" href="#" onclick="return doclink('link-336', 'append', 'link-70');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt> </tt>
<a name="L1922"></a><tt class="py-lineno">1922</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">pass2</tt> </tt>
</div><a name="L1923"></a><tt class="py-lineno">1923</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="CedarBackup3-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://bitbucket.org/cedarsolutions/cedar-backup3">CedarBackup3</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
|