summaryrefslogtreecommitdiff
path: root/docstrings/pyinotify-pysrc.html
blob: 4b9af14226595041591dea7b74c1e41e5b30210c (plain)
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
<?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>pyinotify</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 bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;pyinotify
      </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&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyinotify-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pyinotify-module.html">Module pyinotify</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">   1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python</tt> </tt>
<a name="L2"></a><tt class="py-lineno">   2</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: iso-8859-1 -*-</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"># pyinotify.py - python interface to inotify</tt> </tt>
<a name="L5"></a><tt class="py-lineno">   5</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) S&#233;bastien Martini &lt;sebastien.martini@gmail.com&gt;</tt> </tt>
<a name="L6"></a><tt class="py-lineno">   6</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L7"></a><tt class="py-lineno">   7</tt>  <tt class="py-line"><tt class="py-comment"># This program is free software; you can redistribute it and/or</tt> </tt>
<a name="L8"></a><tt class="py-lineno">   8</tt>  <tt class="py-line"><tt class="py-comment"># modify it under the terms of the GNU General Public License</tt> </tt>
<a name="L9"></a><tt class="py-lineno">   9</tt>  <tt class="py-line"><tt class="py-comment"># as published by the Free Software Foundation; either version 2</tt> </tt>
<a name="L10"></a><tt class="py-lineno">  10</tt>  <tt class="py-line"><tt class="py-comment"># of the License, or (at your option) any later version.</tt> </tt>
<a name="L11"></a><tt class="py-lineno">  11</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L12"></a><tt class="py-lineno">  12</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="L13"></a><tt class="py-lineno">  13</tt>  <tt class="py-line"><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L14"></a><tt class="py-lineno">  14</tt>  <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L15"></a><tt class="py-lineno">  15</tt>  <tt class="py-line"><tt class="py-comment"># GNU General Public License for more details.</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"># You should have received a copy of the GNU General Public License</tt> </tt>
<a name="L18"></a><tt class="py-lineno">  18</tt>  <tt class="py-line"><tt class="py-comment"># along with this program; if not, write to the Free Software</tt> </tt>
<a name="L19"></a><tt class="py-lineno">  19</tt>  <tt class="py-line"><tt class="py-comment"># Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA</tt> </tt>
<a name="L20"></a><tt class="py-lineno">  20</tt>  <tt class="py-line"><tt class="py-comment"># 02110-1301, USA.</tt> </tt>
<a name="L21"></a><tt class="py-lineno">  21</tt>  <tt class="py-line"> </tt>
<a name="L22"></a><tt class="py-lineno">  22</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L23"></a><tt class="py-lineno">  23</tt>  <tt class="py-line"><tt class="py-docstring">pyinotify</tt> </tt>
<a name="L24"></a><tt class="py-lineno">  24</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L25"></a><tt class="py-lineno">  25</tt>  <tt class="py-line"><tt class="py-docstring">@author: Sebastien Martini</tt> </tt>
<a name="L26"></a><tt class="py-lineno">  26</tt>  <tt class="py-line"><tt class="py-docstring">@license: GPLv2+</tt> </tt>
<a name="L27"></a><tt class="py-lineno">  27</tt>  <tt class="py-line"><tt class="py-docstring">@contact: seb@dbzteam.org</tt> </tt>
<a name="L28"></a><tt class="py-lineno">  28</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="PyinotifyError"></a><div id="PyinotifyError-def"><a name="L29"></a><tt class="py-lineno">  29</tt>  <tt class="py-line"> </tt>
<a name="L30"></a><tt class="py-lineno">  30</tt> <a class="py-toggle" href="#" id="PyinotifyError-toggle" onclick="return toggle('PyinotifyError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.PyinotifyError-class.html">PyinotifyError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyinotifyError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="PyinotifyError-expanded"><a name="L31"></a><tt class="py-lineno">  31</tt>  <tt class="py-line">    <tt class="py-docstring">"""Indicates exceptions raised by a Pyinotify class."""</tt> </tt>
</div><a name="L32"></a><tt class="py-lineno">  32</tt>  <tt class="py-line"> </tt>
<a name="UnsupportedPythonVersionError"></a><div id="UnsupportedPythonVersionError-def"><a name="L33"></a><tt class="py-lineno">  33</tt>  <tt class="py-line"> </tt>
<a name="L34"></a><tt class="py-lineno">  34</tt> <a class="py-toggle" href="#" id="UnsupportedPythonVersionError-toggle" onclick="return toggle('UnsupportedPythonVersionError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.UnsupportedPythonVersionError-class.html">UnsupportedPythonVersionError</a><tt class="py-op">(</tt><tt class="py-base-class">PyinotifyError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnsupportedPythonVersionError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="UnsupportedPythonVersionError-expanded"><a name="L35"></a><tt class="py-lineno">  35</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L36"></a><tt class="py-lineno">  36</tt>  <tt class="py-line"><tt class="py-docstring">    Raised for unsupported Python version.</tt> </tt>
<a name="L37"></a><tt class="py-lineno">  37</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="UnsupportedPythonVersionError.__init__"></a><div id="UnsupportedPythonVersionError.__init__-def"><a name="L38"></a><tt class="py-lineno">  38</tt> <a class="py-toggle" href="#" id="UnsupportedPythonVersionError.__init__-toggle" onclick="return toggle('UnsupportedPythonVersionError.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.UnsupportedPythonVersionError-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">version</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnsupportedPythonVersionError.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="UnsupportedPythonVersionError.__init__-expanded"><a name="L39"></a><tt class="py-lineno">  39</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L40"></a><tt class="py-lineno">  40</tt>  <tt class="py-line"><tt class="py-docstring">        @param version: Current Python version</tt> </tt>
<a name="L41"></a><tt class="py-lineno">  41</tt>  <tt class="py-line"><tt class="py-docstring">        @type version: string</tt> </tt>
<a name="L42"></a><tt class="py-lineno">  42</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L43"></a><tt class="py-lineno">  43</tt>  <tt class="py-line">        <tt id="link-0" class="py-name" targets="Class pyinotify.PyinotifyError=pyinotify.PyinotifyError-class.html"><a title="pyinotify.PyinotifyError" class="py-name" href="#" onclick="return doclink('link-0', 'PyinotifyError', 'link-0');">PyinotifyError</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Method pyinotify.AsyncNotifier.__init__()=pyinotify.AsyncNotifier-class.html#__init__,Method pyinotify.Event.__init__()=pyinotify.Event-class.html#__init__,Method pyinotify.ExcludeFilter.__init__()=pyinotify.ExcludeFilter-class.html#__init__,Method pyinotify.Notifier.__init__()=pyinotify.Notifier-class.html#__init__,Method pyinotify.NotifierError.__init__()=pyinotify.NotifierError-class.html#__init__,Method pyinotify.ProcessEvent.__init__()=pyinotify.ProcessEvent-class.html#__init__,Method pyinotify.ProcessEventError.__init__()=pyinotify.ProcessEventError-class.html#__init__,Method pyinotify.SysCtlINotify.__init__()=pyinotify.SysCtlINotify-class.html#__init__,Method pyinotify.ThreadedNotifier.__init__()=pyinotify.ThreadedNotifier-class.html#__init__,Method pyinotify.UnicodeLogRecord.__init__()=pyinotify.UnicodeLogRecord-class.html#__init__,Method pyinotify.UnsupportedLibcVersionError.__init__()=pyinotify.UnsupportedLibcVersionError-class.html#__init__,Method pyinotify.UnsupportedPythonVersionError.__init__()=pyinotify.UnsupportedPythonVersionError-class.html#__init__,Method pyinotify.Watch.__init__()=pyinotify.Watch-class.html#__init__,Method pyinotify.WatchManager.__init__()=pyinotify.WatchManager-class.html#__init__,Method pyinotify.WatchManagerError.__init__()=pyinotify.WatchManagerError-class.html#__init__,Method pyinotify._Event.__init__()=pyinotify._Event-class.html#__init__,Method pyinotify._RawEvent.__init__()=pyinotify._RawEvent-class.html#__init__,Method pyinotify._SysProcessEvent.__init__()=pyinotify._SysProcessEvent-class.html#__init__"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-1', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> </tt>
<a name="L44"></a><tt class="py-lineno">  44</tt>  <tt class="py-line">                                <tt class="py-op">(</tt><tt class="py-string">'Python %s is unsupported, requires '</tt> </tt>
<a name="L45"></a><tt class="py-lineno">  45</tt>  <tt class="py-line">                                <tt class="py-string">'at least Python 2.4'</tt><tt class="py-op">)</tt> <tt class="py-op">%</tt> <tt class="py-name">version</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L46"></a><tt class="py-lineno">  46</tt>  <tt class="py-line"> </tt>
<a name="UnsupportedLibcVersionError"></a><div id="UnsupportedLibcVersionError-def"><a name="L47"></a><tt class="py-lineno">  47</tt>  <tt class="py-line"> </tt>
<a name="L48"></a><tt class="py-lineno">  48</tt> <a class="py-toggle" href="#" id="UnsupportedLibcVersionError-toggle" onclick="return toggle('UnsupportedLibcVersionError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.UnsupportedLibcVersionError-class.html">UnsupportedLibcVersionError</a><tt class="py-op">(</tt><tt class="py-base-class">PyinotifyError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnsupportedLibcVersionError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="UnsupportedLibcVersionError-expanded"><a name="L49"></a><tt class="py-lineno">  49</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L50"></a><tt class="py-lineno">  50</tt>  <tt class="py-line"><tt class="py-docstring">    Raised for unsupported libc version.</tt> </tt>
<a name="L51"></a><tt class="py-lineno">  51</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="UnsupportedLibcVersionError.__init__"></a><div id="UnsupportedLibcVersionError.__init__-def"><a name="L52"></a><tt class="py-lineno">  52</tt> <a class="py-toggle" href="#" id="UnsupportedLibcVersionError.__init__-toggle" onclick="return toggle('UnsupportedLibcVersionError.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.UnsupportedLibcVersionError-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">version</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnsupportedLibcVersionError.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="UnsupportedLibcVersionError.__init__-expanded"><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">        @param version: Current Libc version</tt> </tt>
<a name="L55"></a><tt class="py-lineno">  55</tt>  <tt class="py-line"><tt class="py-docstring">        @type version: string</tt> </tt>
<a name="L56"></a><tt class="py-lineno">  56</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L57"></a><tt class="py-lineno">  57</tt>  <tt class="py-line">        <tt id="link-2" class="py-name"><a title="pyinotify.PyinotifyError" class="py-name" href="#" onclick="return doclink('link-2', 'PyinotifyError', 'link-0');">PyinotifyError</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-3', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> </tt>
<a name="L58"></a><tt class="py-lineno">  58</tt>  <tt class="py-line">                                <tt class="py-op">(</tt><tt class="py-string">'Libc %s is unsupported, requires '</tt> </tt>
<a name="L59"></a><tt class="py-lineno">  59</tt>  <tt class="py-line">                                <tt class="py-string">'at least Libc 2.4'</tt><tt class="py-op">)</tt> <tt class="py-op">%</tt> <tt class="py-name">version</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L60"></a><tt class="py-lineno">  60</tt>  <tt class="py-line"> </tt>
<a name="L61"></a><tt class="py-lineno">  61</tt>  <tt class="py-line"> </tt>
<a name="L62"></a><tt class="py-lineno">  62</tt>  <tt class="py-line"><tt class="py-comment"># Check Python version</tt> </tt>
<a name="L63"></a><tt class="py-lineno">  63</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
<a name="L64"></a><tt class="py-lineno">  64</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">version</tt> <tt class="py-op">&lt;</tt> <tt class="py-string">'2.4'</tt><tt class="py-op">:</tt> </tt>
<a name="L65"></a><tt class="py-lineno">  65</tt>  <tt class="py-line">    <tt class="py-keyword">raise</tt> <tt id="link-4" class="py-name" targets="Class pyinotify.UnsupportedPythonVersionError=pyinotify.UnsupportedPythonVersionError-class.html"><a title="pyinotify.UnsupportedPythonVersionError" class="py-name" href="#" onclick="return doclink('link-4', 'UnsupportedPythonVersionError', 'link-4');">UnsupportedPythonVersionError</a></tt><tt class="py-op">(</tt><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">version</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno">  66</tt>  <tt class="py-line"> </tt>
<a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line"> </tt>
<a name="L68"></a><tt class="py-lineno">  68</tt>  <tt class="py-line"><tt class="py-comment"># Import directives</tt> </tt>
<a name="L69"></a><tt class="py-lineno">  69</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">threading</tt> </tt>
<a name="L70"></a><tt class="py-lineno">  70</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L71"></a><tt class="py-lineno">  71</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">select</tt> </tt>
<a name="L72"></a><tt class="py-lineno">  72</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">struct</tt> </tt>
<a name="L73"></a><tt class="py-lineno">  73</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">fcntl</tt> </tt>
<a name="L74"></a><tt class="py-lineno">  74</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">errno</tt> </tt>
<a name="L75"></a><tt class="py-lineno">  75</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">termios</tt> </tt>
<a name="L76"></a><tt class="py-lineno">  76</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">array</tt> </tt>
<a name="L77"></a><tt class="py-lineno">  77</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L78"></a><tt class="py-lineno">  78</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">atexit</tt> </tt>
<a name="L79"></a><tt class="py-lineno">  79</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">collections</tt> <tt class="py-keyword">import</tt> <tt class="py-name">deque</tt> </tt>
<a name="L80"></a><tt class="py-lineno">  80</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">datetime</tt> <tt class="py-keyword">import</tt> <tt class="py-name">datetime</tt><tt class="py-op">,</tt> <tt class="py-name">timedelta</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">time</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">fnmatch</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">re</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">ctypes</tt> </tt>
<a name="L85"></a><tt class="py-lineno">  85</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">util</tt> </tt>
<a name="L86"></a><tt class="py-lineno">  86</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">types</tt> </tt>
<a name="L87"></a><tt class="py-lineno">  87</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">asyncore</tt> </tt>
<a name="L88"></a><tt class="py-lineno">  88</tt>  <tt class="py-line"> </tt>
<a name="L89"></a><tt class="py-lineno">  89</tt>  <tt class="py-line"><tt id="link-5" class="py-name" targets="Variable pyinotify.__author__=pyinotify-module.html#__author__"><a title="pyinotify.__author__" class="py-name" href="#" onclick="return doclink('link-5', '__author__', 'link-5');">__author__</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"seb@dbzteam.org (Sebastien Martini)"</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-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-string">"0.8.6"</tt> </tt>
<a name="L92"></a><tt class="py-lineno">  92</tt>  <tt class="py-line"> </tt>
<a name="L93"></a><tt class="py-lineno">  93</tt>  <tt class="py-line"><tt class="py-name">__metaclass__</tt> <tt class="py-op">=</tt> <tt class="py-name">type</tt>  <tt class="py-comment"># Use new-style classes by default</tt> </tt>
<a name="L94"></a><tt class="py-lineno">  94</tt>  <tt class="py-line"> </tt>
<a name="L95"></a><tt class="py-lineno">  95</tt>  <tt class="py-line"> </tt>
<a name="L96"></a><tt class="py-lineno">  96</tt>  <tt class="py-line"><tt class="py-comment"># Compatibity mode: set to True to improve compatibility with</tt> </tt>
<a name="L97"></a><tt class="py-lineno">  97</tt>  <tt class="py-line"><tt class="py-comment"># Pyinotify 0.7.1. Do not set this variable yourself, call the</tt> </tt>
<a name="L98"></a><tt class="py-lineno">  98</tt>  <tt class="py-line"><tt class="py-comment"># function compatibility_mode() instead.</tt> </tt>
<a name="L99"></a><tt class="py-lineno">  99</tt>  <tt class="py-line"><tt id="link-6" class="py-name" targets="Variable pyinotify.COMPATIBILITY_MODE=pyinotify-module.html#COMPATIBILITY_MODE"><a title="pyinotify.COMPATIBILITY_MODE" class="py-name" href="#" onclick="return doclink('link-6', 'COMPATIBILITY_MODE', 'link-6');">COMPATIBILITY_MODE</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </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>
<a name="L102"></a><tt class="py-lineno"> 102</tt>  <tt class="py-line"><tt class="py-comment"># load libc</tt> </tt>
<a name="L103"></a><tt class="py-lineno"> 103</tt>  <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable pyinotify.LIBC=pyinotify-module.html#LIBC"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-7', 'LIBC', 'link-7');">LIBC</a></tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">cdll</tt><tt class="py-op">.</tt><tt class="py-name">LoadLibrary</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">util</tt><tt class="py-op">.</tt><tt class="py-name">find_library</tt><tt class="py-op">(</tt><tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">)</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 class="py-comment"># the libc version &gt; 2.4 check.</tt> </tt>
<a name="L106"></a><tt class="py-lineno"> 106</tt>  <tt class="py-line"><tt class="py-comment"># XXX: Maybe it is better to check if the libc has the needed functions inside?</tt> </tt>
<a name="L107"></a><tt class="py-lineno"> 107</tt>  <tt class="py-line"><tt class="py-comment">#      Because there are inotify patches for libc 2.3.6.</tt> </tt>
<a name="L108"></a><tt class="py-lineno"> 108</tt>  <tt class="py-line"><tt id="link-8" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-8', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">gnu_get_libc_version</tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_char_p</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 pyinotify.LIBC_VERSION=pyinotify-module.html#LIBC_VERSION"><a title="pyinotify.LIBC_VERSION" class="py-name" href="#" onclick="return doclink('link-9', 'LIBC_VERSION', 'link-9');">LIBC_VERSION</a></tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-10', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">gnu_get_libc_version</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno"> 110</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt id="link-11" class="py-name"><a title="pyinotify.LIBC_VERSION" class="py-name" href="#" onclick="return doclink('link-11', 'LIBC_VERSION', 'link-9');">LIBC_VERSION</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">)</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">&lt;</tt> <tt class="py-number">2</tt> <tt class="py-keyword">or</tt> </tt>
<a name="L111"></a><tt class="py-lineno"> 111</tt>  <tt class="py-line">    <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt id="link-12" class="py-name"><a title="pyinotify.LIBC_VERSION" class="py-name" href="#" onclick="return doclink('link-12', 'LIBC_VERSION', 'link-9');">LIBC_VERSION</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">)</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-number">2</tt> <tt class="py-keyword">and</tt> </tt>
<a name="L112"></a><tt class="py-lineno"> 112</tt>  <tt class="py-line">     <tt class="py-name">int</tt><tt class="py-op">(</tt><tt id="link-13" class="py-name"><a title="pyinotify.LIBC_VERSION" class="py-name" href="#" onclick="return doclink('link-13', 'LIBC_VERSION', 'link-9');">LIBC_VERSION</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</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-op">&lt;</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L113"></a><tt class="py-lineno"> 113</tt>  <tt class="py-line">    <tt class="py-keyword">raise</tt> <tt id="link-14" class="py-name" targets="Class pyinotify.UnsupportedLibcVersionError=pyinotify.UnsupportedLibcVersionError-class.html"><a title="pyinotify.UnsupportedLibcVersionError" class="py-name" href="#" onclick="return doclink('link-14', 'UnsupportedLibcVersionError', 'link-14');">UnsupportedLibcVersionError</a></tt><tt class="py-op">(</tt><tt id="link-15" class="py-name"><a title="pyinotify.LIBC_VERSION" class="py-name" href="#" onclick="return doclink('link-15', 'LIBC_VERSION', 'link-9');">LIBC_VERSION</a></tt><tt class="py-op">)</tt> </tt>
<a name="PyinotifyLogger"></a><div id="PyinotifyLogger-def"><a name="L114"></a><tt class="py-lineno"> 114</tt>  <tt class="py-line"> </tt>
<a name="L115"></a><tt class="py-lineno"> 115</tt>  <tt class="py-line"> </tt>
<a name="L116"></a><tt class="py-lineno"> 116</tt> <a class="py-toggle" href="#" id="PyinotifyLogger-toggle" onclick="return toggle('PyinotifyLogger');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.PyinotifyLogger-class.html">PyinotifyLogger</a><tt class="py-op">(</tt><tt class="py-base-class">logging</tt><tt class="py-op">.</tt><tt class="py-base-class">Logger</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PyinotifyLogger-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="PyinotifyLogger-expanded"><a name="PyinotifyLogger.makeRecord"></a><div id="PyinotifyLogger.makeRecord-def"><a name="L117"></a><tt class="py-lineno"> 117</tt> <a class="py-toggle" href="#" id="PyinotifyLogger.makeRecord-toggle" onclick="return toggle('PyinotifyLogger.makeRecord');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.PyinotifyLogger-class.html#makeRecord">makeRecord</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">level</tt><tt class="py-op">,</tt> <tt class="py-param">fn</tt><tt class="py-op">,</tt> <tt class="py-param">lno</tt><tt class="py-op">,</tt> <tt class="py-param">msg</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-param">exc_info</tt><tt class="py-op">,</tt> <tt class="py-param">func</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L118"></a><tt class="py-lineno"> 118</tt>  <tt class="py-line">                   <tt class="py-param">extra</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="PyinotifyLogger.makeRecord-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="PyinotifyLogger.makeRecord-expanded"><a name="L119"></a><tt class="py-lineno"> 119</tt>  <tt class="py-line">        <tt class="py-name">rv</tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name" targets="Class pyinotify.UnicodeLogRecord=pyinotify.UnicodeLogRecord-class.html"><a title="pyinotify.UnicodeLogRecord" class="py-name" href="#" onclick="return doclink('link-16', 'UnicodeLogRecord', 'link-16');">UnicodeLogRecord</a></tt><tt class="py-op">(</tt><tt id="link-17" class="py-name" targets="Variable pyinotify.name=pyinotify-module.html#name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-17', 'name', 'link-17');">name</a></tt><tt class="py-op">,</tt> <tt class="py-name">level</tt><tt class="py-op">,</tt> <tt class="py-name">fn</tt><tt class="py-op">,</tt> <tt class="py-name">lno</tt><tt class="py-op">,</tt> <tt class="py-name">msg</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">exc_info</tt><tt class="py-op">,</tt> <tt class="py-name">func</tt><tt class="py-op">)</tt> </tt>
<a name="L120"></a><tt class="py-lineno"> 120</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">extra</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="L121"></a><tt class="py-lineno"> 121</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">extra</tt><tt class="py-op">:</tt> </tt>
<a name="L122"></a><tt class="py-lineno"> 122</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">"message"</tt><tt class="py-op">,</tt> <tt class="py-string">"asctime"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">rv</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L123"></a><tt class="py-lineno"> 123</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> <tt class="py-name">KeyError</tt><tt class="py-op">(</tt><tt class="py-string">"Attempt to overwrite %r in LogRecord"</tt> <tt class="py-op">%</tt> <tt class="py-name">key</tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno"> 124</tt>  <tt class="py-line">                <tt class="py-name">rv</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</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">extra</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
<a name="L125"></a><tt class="py-lineno"> 125</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">rv</tt> </tt>
</div></div><a name="L126"></a><tt class="py-lineno"> 126</tt>  <tt class="py-line"> </tt>
<a name="UnicodeLogRecord"></a><div id="UnicodeLogRecord-def"><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> <a class="py-toggle" href="#" id="UnicodeLogRecord-toggle" onclick="return toggle('UnicodeLogRecord');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.UnicodeLogRecord-class.html">UnicodeLogRecord</a><tt class="py-op">(</tt><tt class="py-base-class">logging</tt><tt class="py-op">.</tt><tt class="py-base-class">LogRecord</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UnicodeLogRecord-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="UnicodeLogRecord-expanded"><a name="UnicodeLogRecord.__init__"></a><div id="UnicodeLogRecord.__init__-def"><a name="L129"></a><tt class="py-lineno"> 129</tt> <a class="py-toggle" href="#" id="UnicodeLogRecord.__init__-toggle" onclick="return toggle('UnicodeLogRecord.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.UnicodeLogRecord-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-param">level</tt><tt class="py-op">,</tt> <tt class="py-param">pathname</tt><tt class="py-op">,</tt> <tt class="py-param">lineno</tt><tt class="py-op">,</tt> </tt>
<a name="L130"></a><tt class="py-lineno"> 130</tt>  <tt class="py-line">                 <tt class="py-param">msg</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">,</tt> <tt class="py-param">exc_info</tt><tt class="py-op">,</tt> <tt class="py-param">func</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="UnicodeLogRecord.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="UnicodeLogRecord.__init__-expanded"><a name="L131"></a><tt class="py-lineno"> 131</tt>  <tt class="py-line">        <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">LogRecord</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-18', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt id="link-19" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-19', 'name', 'link-17');">name</a></tt><tt class="py-op">,</tt> <tt class="py-name">level</tt><tt class="py-op">,</tt> <tt class="py-name">pathname</tt><tt class="py-op">,</tt> <tt class="py-name">lineno</tt><tt class="py-op">,</tt> </tt>
<a name="L132"></a><tt class="py-lineno"> 132</tt>  <tt class="py-line">                                   <tt class="py-name">msg</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">exc_info</tt><tt class="py-op">,</tt> <tt class="py-name">func</tt><tt class="py-op">)</tt> </tt>
</div><a name="L133"></a><tt class="py-lineno"> 133</tt>  <tt class="py-line"> </tt>
<a name="UnicodeLogRecord.getMessage"></a><div id="UnicodeLogRecord.getMessage-def"><a name="L134"></a><tt class="py-lineno"> 134</tt> <a class="py-toggle" href="#" id="UnicodeLogRecord.getMessage-toggle" onclick="return toggle('UnicodeLogRecord.getMessage');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.UnicodeLogRecord-class.html#getMessage">getMessage</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="UnicodeLogRecord.getMessage-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="UnicodeLogRecord.getMessage-expanded"><a name="L135"></a><tt class="py-lineno"> 135</tt>  <tt class="py-line">        <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt> </tt>
<a name="L136"></a><tt class="py-lineno"> 136</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">msg</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">unicode</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L137"></a><tt class="py-lineno"> 137</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L138"></a><tt class="py-lineno"> 138</tt>  <tt class="py-line">                <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno"> 139</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">UnicodeError</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno"> 140</tt>  <tt class="py-line">                <tt class="py-keyword">pass</tt> </tt>
<a name="L141"></a><tt class="py-lineno"> 141</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">args</tt><tt class="py-op">:</tt> </tt>
<a name="L142"></a><tt class="py-lineno"> 142</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">self</tt><tt class="py-op">.</tt><tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">tuple</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L143"></a><tt class="py-lineno"> 143</tt>  <tt class="py-line">                <tt class="py-keyword">def</tt> <tt class="py-def-name">StrToUnicode</tt><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L144"></a><tt class="py-lineno"> 144</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">s</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L145"></a><tt class="py-lineno"> 145</tt>  <tt class="py-line">                        <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
<a name="L146"></a><tt class="py-lineno"> 146</tt>  <tt class="py-line">                    <tt class="py-keyword">return</tt> <tt class="py-name">unicode</tt><tt class="py-op">(</tt><tt class="py-name">s</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-op">)</tt> </tt>
</div><a name="L147"></a><tt class="py-lineno"> 147</tt>  <tt class="py-line">                <tt class="py-name">args</tt> <tt class="py-op">=</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">StrToUnicode</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">m</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">args</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L148"></a><tt class="py-lineno"> 148</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L149"></a><tt class="py-lineno"> 149</tt>  <tt class="py-line">                <tt class="py-name">args</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">args</tt> </tt>
<a name="L150"></a><tt class="py-lineno"> 150</tt>  <tt class="py-line">            <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-name">msg</tt> <tt class="py-op">%</tt> <tt class="py-name">args</tt> </tt>
<a name="L151"></a><tt class="py-lineno"> 151</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">msg</tt><tt class="py-op">,</tt> <tt class="py-name">unicode</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L152"></a><tt class="py-lineno"> 152</tt>  <tt class="py-line">            <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-name">unicode</tt><tt class="py-op">(</tt><tt class="py-name">msg</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-op">)</tt> </tt>
<a name="L153"></a><tt class="py-lineno"> 153</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">msg</tt> </tt>
</div></div><a name="L154"></a><tt class="py-lineno"> 154</tt>  <tt class="py-line"> </tt>
<a name="L155"></a><tt class="py-lineno"> 155</tt>  <tt class="py-line"> </tt>
<a name="L156"></a><tt class="py-lineno"> 156</tt>  <tt class="py-line"><tt class="py-comment"># logging</tt> </tt>
<a name="L157"></a><tt class="py-lineno"> 157</tt>  <tt class="py-line"><tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">setLoggerClass</tt><tt class="py-op">(</tt><tt id="link-20" class="py-name" targets="Class pyinotify.PyinotifyLogger=pyinotify.PyinotifyLogger-class.html"><a title="pyinotify.PyinotifyLogger" class="py-name" href="#" onclick="return doclink('link-20', 'PyinotifyLogger', 'link-20');">PyinotifyLogger</a></tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno"> 158</tt>  <tt class="py-line"><tt id="link-21" class="py-name" targets="Variable pyinotify.log=pyinotify-module.html#log"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-21', 'log', 'link-21');">log</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">"pyinotify"</tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno"> 159</tt>  <tt class="py-line"><tt id="link-22" class="py-name" targets="Variable pyinotify.console_handler=pyinotify-module.html#console_handler"><a title="pyinotify.console_handler" class="py-name" href="#" onclick="return doclink('link-22', 'console_handler', 'link-22');">console_handler</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">StreamHandler</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno"> 160</tt>  <tt class="py-line"><tt id="link-23" class="py-name"><a title="pyinotify.console_handler" class="py-name" href="#" onclick="return doclink('link-23', 'console_handler', 'link-22');">console_handler</a></tt><tt class="py-op">.</tt><tt class="py-name">setFormatter</tt><tt class="py-op">(</tt><tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">Formatter</tt><tt class="py-op">(</tt><tt class="py-string">"%(levelname)s: %(message)s"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno"> 161</tt>  <tt class="py-line"><tt id="link-24" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-24', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">addHandler</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name"><a title="pyinotify.console_handler" class="py-name" href="#" onclick="return doclink('link-25', 'console_handler', 'link-22');">console_handler</a></tt><tt class="py-op">)</tt> </tt>
<a name="L162"></a><tt class="py-lineno"> 162</tt>  <tt class="py-line"><tt id="link-26" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-26', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">setLevel</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">)</tt> </tt>
<a name="L163"></a><tt class="py-lineno"> 163</tt>  <tt class="py-line"> </tt>
<a name="L164"></a><tt class="py-lineno"> 164</tt>  <tt class="py-line"> </tt>
<a name="L165"></a><tt class="py-lineno"> 165</tt>  <tt class="py-line"><tt class="py-comment"># Try to speed-up execution with psyco</tt> </tt>
<a name="L166"></a><tt class="py-lineno"> 166</tt>  <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L167"></a><tt class="py-lineno"> 167</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">False</tt><tt class="py-op">:</tt> </tt>
<a name="L168"></a><tt class="py-lineno"> 168</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">psyco</tt> </tt>
<a name="L169"></a><tt class="py-lineno"> 169</tt>  <tt class="py-line">        <tt class="py-name">psyco</tt><tt class="py-op">.</tt><tt class="py-name">full</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno"> 170</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="L171"></a><tt class="py-lineno"> 171</tt>  <tt class="py-line">    <tt class="py-comment"># Cannot import psyco</tt> </tt>
<a name="L172"></a><tt class="py-lineno"> 172</tt>  <tt class="py-line">    <tt class="py-keyword">pass</tt> </tt>
<a name="SysCtlINotify"></a><div id="SysCtlINotify-def"><a name="L173"></a><tt class="py-lineno"> 173</tt>  <tt class="py-line"> </tt>
<a name="L174"></a><tt class="py-lineno"> 174</tt>  <tt class="py-line"> </tt>
<a name="L175"></a><tt class="py-lineno"> 175</tt>  <tt class="py-line"><tt class="py-comment">### inotify's variables ###</tt> </tt>
<a name="L176"></a><tt class="py-lineno"> 176</tt>  <tt class="py-line"> </tt>
<a name="L177"></a><tt class="py-lineno"> 177</tt>  <tt class="py-line"> </tt>
<a name="L178"></a><tt class="py-lineno"> 178</tt> <a class="py-toggle" href="#" id="SysCtlINotify-toggle" onclick="return toggle('SysCtlINotify');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.SysCtlINotify-class.html">SysCtlINotify</a><tt class="py-op">:</tt> </tt>
</div><div id="SysCtlINotify-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="SysCtlINotify-expanded"><a name="L179"></a><tt class="py-lineno"> 179</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L180"></a><tt class="py-lineno"> 180</tt>  <tt class="py-line"><tt class="py-docstring">    Access (read, write) inotify's variables through sysctl.</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-docstring">    Examples:</tt> </tt>
<a name="L183"></a><tt class="py-lineno"> 183</tt>  <tt class="py-line"><tt class="py-docstring">      - Read variable: myvar = max_queued_events.value</tt> </tt>
<a name="L184"></a><tt class="py-lineno"> 184</tt>  <tt class="py-line"><tt class="py-docstring">      - Update variable: max_queued_events.value = 42</tt> </tt>
<a name="L185"></a><tt class="py-lineno"> 185</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L186"></a><tt class="py-lineno"> 186</tt>  <tt class="py-line"> </tt>
<a name="L187"></a><tt class="py-lineno"> 187</tt>  <tt class="py-line">    <tt id="link-27" class="py-name" targets="Variable pyinotify.SysCtlINotify.inotify_attrs=pyinotify.SysCtlINotify-class.html#inotify_attrs"><a title="pyinotify.SysCtlINotify.inotify_attrs" class="py-name" href="#" onclick="return doclink('link-27', 'inotify_attrs', 'link-27');">inotify_attrs</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'max_user_instances'</tt><tt class="py-op">:</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> </tt>
<a name="L188"></a><tt class="py-lineno"> 188</tt>  <tt class="py-line">                     <tt class="py-string">'max_user_watches'</tt><tt class="py-op">:</tt> <tt class="py-number">2</tt><tt class="py-op">,</tt> </tt>
<a name="L189"></a><tt class="py-lineno"> 189</tt>  <tt class="py-line">                     <tt class="py-string">'max_queued_events'</tt><tt class="py-op">:</tt> <tt class="py-number">3</tt><tt class="py-op">}</tt> </tt>
<a name="L190"></a><tt class="py-lineno"> 190</tt>  <tt class="py-line"> </tt>
<a name="SysCtlINotify.__init__"></a><div id="SysCtlINotify.__init__-def"><a name="L191"></a><tt class="py-lineno"> 191</tt> <a class="py-toggle" href="#" id="SysCtlINotify.__init__-toggle" onclick="return toggle('SysCtlINotify.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.SysCtlINotify-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">attrname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SysCtlINotify.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="SysCtlINotify.__init__-expanded"><a name="L192"></a><tt class="py-lineno"> 192</tt>  <tt class="py-line">        <tt class="py-name">sino</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt> <tt class="py-op">*</tt> <tt class="py-number">3</tt> </tt>
<a name="L193"></a><tt class="py-lineno"> 193</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_attrname</tt> <tt class="py-op">=</tt> <tt id="link-28" class="py-name" targets="Variable pyinotify.attrname=pyinotify-module.html#attrname"><a title="pyinotify.attrname" class="py-name" href="#" onclick="return doclink('link-28', 'attrname', 'link-28');">attrname</a></tt> </tt>
<a name="L194"></a><tt class="py-lineno"> 194</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_attr</tt> <tt class="py-op">=</tt> <tt class="py-name">sino</tt><tt class="py-op">(</tt><tt class="py-number">5</tt><tt class="py-op">,</tt> <tt class="py-number">20</tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name" targets="Class pyinotify.SysCtlINotify=pyinotify.SysCtlINotify-class.html"><a title="pyinotify.SysCtlINotify" class="py-name" href="#" onclick="return doclink('link-29', 'SysCtlINotify', 'link-29');">SysCtlINotify</a></tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="pyinotify.SysCtlINotify.inotify_attrs" class="py-name" href="#" onclick="return doclink('link-30', 'inotify_attrs', 'link-27');">inotify_attrs</a></tt><tt class="py-op">[</tt><tt id="link-31" class="py-name"><a title="pyinotify.attrname" class="py-name" href="#" onclick="return doclink('link-31', 'attrname', 'link-28');">attrname</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L195"></a><tt class="py-lineno"> 195</tt>  <tt class="py-line"> </tt>
<a name="SysCtlINotify.get_val"></a><div id="SysCtlINotify.get_val-def"><a name="L196"></a><tt class="py-lineno"> 196</tt> <a class="py-toggle" href="#" id="SysCtlINotify.get_val-toggle" onclick="return toggle('SysCtlINotify.get_val');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.SysCtlINotify-class.html#get_val">get_val</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="SysCtlINotify.get_val-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="SysCtlINotify.get_val-expanded"><a name="L197"></a><tt class="py-lineno"> 197</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L198"></a><tt class="py-lineno"> 198</tt>  <tt class="py-line"><tt class="py-docstring">        @return: stored value.</tt> </tt>
<a name="L199"></a><tt class="py-lineno"> 199</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: int</tt> </tt>
<a name="L200"></a><tt class="py-lineno"> 200</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L201"></a><tt class="py-lineno"> 201</tt>  <tt class="py-line">        <tt class="py-name">oldv</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L202"></a><tt class="py-lineno"> 202</tt>  <tt class="py-line">        <tt class="py-name">size</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">sizeof</tt><tt class="py-op">(</tt><tt class="py-name">oldv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L203"></a><tt class="py-lineno"> 203</tt>  <tt class="py-line">        <tt id="link-32" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-32', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">sysctl</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_attr</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">,</tt> </tt>
<a name="L204"></a><tt class="py-lineno"> 204</tt>  <tt class="py-line">                    <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_voidp</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">oldv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L205"></a><tt class="py-lineno"> 205</tt>  <tt class="py-line">                    <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L206"></a><tt class="py-lineno"> 206</tt>  <tt class="py-line">                    <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-number">0</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">oldv</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name" targets="Variable pyinotify.SysCtlINotify.value=pyinotify.SysCtlINotify-class.html#value"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-33', 'value', 'link-33');">value</a></tt> </tt>
</div><a name="L208"></a><tt class="py-lineno"> 208</tt>  <tt class="py-line"> </tt>
<a name="SysCtlINotify.set_val"></a><div id="SysCtlINotify.set_val-def"><a name="L209"></a><tt class="py-lineno"> 209</tt> <a class="py-toggle" href="#" id="SysCtlINotify.set_val-toggle" onclick="return toggle('SysCtlINotify.set_val');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.SysCtlINotify-class.html#set_val">set_val</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">nval</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SysCtlINotify.set_val-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="SysCtlINotify.set_val-expanded"><a name="L210"></a><tt class="py-lineno"> 210</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L211"></a><tt class="py-lineno"> 211</tt>  <tt class="py-line"><tt class="py-docstring">        @param nval: set to nval.</tt> </tt>
<a name="L212"></a><tt class="py-lineno"> 212</tt>  <tt class="py-line"><tt class="py-docstring">        @type nval: int</tt> </tt>
<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-name">oldv</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L215"></a><tt class="py-lineno"> 215</tt>  <tt class="py-line">        <tt class="py-name">sizeo</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">sizeof</tt><tt class="py-op">(</tt><tt class="py-name">oldv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L216"></a><tt class="py-lineno"> 216</tt>  <tt class="py-line">        <tt class="py-name">newv</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-name">nval</tt><tt class="py-op">)</tt> </tt>
<a name="L217"></a><tt class="py-lineno"> 217</tt>  <tt class="py-line">        <tt class="py-name">sizen</tt> <tt class="py-op">=</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">sizeof</tt><tt class="py-op">(</tt><tt class="py-name">newv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L218"></a><tt class="py-lineno"> 218</tt>  <tt class="py-line">        <tt id="link-34" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-34', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">sysctl</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_attr</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">,</tt> </tt>
<a name="L219"></a><tt class="py-lineno"> 219</tt>  <tt class="py-line">                    <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_voidp</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">oldv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L220"></a><tt class="py-lineno"> 220</tt>  <tt class="py-line">                    <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">sizeo</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">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_voidp</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">newv</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-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">addressof</tt><tt class="py-op">(</tt><tt class="py-name">sizen</tt><tt class="py-op">)</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="L224"></a><tt class="py-lineno"> 224</tt>  <tt class="py-line">    <tt id="link-35" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-35', 'value', 'link-33');">value</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-36" class="py-name" targets="Method pyinotify.SysCtlINotify.get_val()=pyinotify.SysCtlINotify-class.html#get_val"><a title="pyinotify.SysCtlINotify.get_val" class="py-name" href="#" onclick="return doclink('link-36', 'get_val', 'link-36');">get_val</a></tt><tt class="py-op">,</tt> <tt id="link-37" class="py-name" targets="Method pyinotify.SysCtlINotify.set_val()=pyinotify.SysCtlINotify-class.html#set_val"><a title="pyinotify.SysCtlINotify.set_val" class="py-name" href="#" onclick="return doclink('link-37', 'set_val', 'link-37');">set_val</a></tt><tt class="py-op">)</tt> </tt>
<a name="L225"></a><tt class="py-lineno"> 225</tt>  <tt class="py-line"> </tt>
<a name="SysCtlINotify.__repr__"></a><div id="SysCtlINotify.__repr__-def"><a name="L226"></a><tt class="py-lineno"> 226</tt> <a class="py-toggle" href="#" id="SysCtlINotify.__repr__-toggle" onclick="return toggle('SysCtlINotify.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.SysCtlINotify-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="SysCtlINotify.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="SysCtlINotify.__repr__-expanded"><a name="L227"></a><tt class="py-lineno"> 227</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'&lt;%s=%d&gt;'</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">_attrname</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="pyinotify.SysCtlINotify.get_val" class="py-name" href="#" onclick="return doclink('link-38', 'get_val', 'link-36');">get_val</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L228"></a><tt class="py-lineno"> 228</tt>  <tt class="py-line"> </tt>
<a name="L229"></a><tt class="py-lineno"> 229</tt>  <tt class="py-line"> </tt>
<a name="L230"></a><tt class="py-lineno"> 230</tt>  <tt class="py-line"><tt class="py-comment"># singleton instances</tt> </tt>
<a name="L231"></a><tt class="py-lineno"> 231</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L232"></a><tt class="py-lineno"> 232</tt>  <tt class="py-line"><tt class="py-comment"># read int: myvar = max_queued_events.value</tt> </tt>
<a name="L233"></a><tt class="py-lineno"> 233</tt>  <tt class="py-line"><tt class="py-comment"># update: max_queued_events.value = 42</tt> </tt>
<a name="L234"></a><tt class="py-lineno"> 234</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L235"></a><tt class="py-lineno"> 235</tt>  <tt class="py-line"><tt class="py-keyword">for</tt> <tt id="link-39" class="py-name"><a title="pyinotify.attrname" class="py-name" href="#" onclick="return doclink('link-39', 'attrname', 'link-28');">attrname</a></tt> <tt class="py-keyword">in</tt> <tt class="py-op">(</tt><tt class="py-string">'max_queued_events'</tt><tt class="py-op">,</tt> <tt class="py-string">'max_user_instances'</tt><tt class="py-op">,</tt> <tt class="py-string">'max_user_watches'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L236"></a><tt class="py-lineno"> 236</tt>  <tt class="py-line">    <tt class="py-name">globals</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt id="link-40" class="py-name"><a title="pyinotify.attrname" class="py-name" href="#" onclick="return doclink('link-40', 'attrname', 'link-28');">attrname</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-41" class="py-name"><a title="pyinotify.SysCtlINotify" class="py-name" href="#" onclick="return doclink('link-41', 'SysCtlINotify', 'link-29');">SysCtlINotify</a></tt><tt class="py-op">(</tt><tt id="link-42" class="py-name"><a title="pyinotify.attrname" class="py-name" href="#" onclick="return doclink('link-42', 'attrname', 'link-28');">attrname</a></tt><tt class="py-op">)</tt> </tt>
<a name="iglob"></a><div id="iglob-def"><a name="L237"></a><tt class="py-lineno"> 237</tt>  <tt class="py-line"> </tt>
<a name="L238"></a><tt class="py-lineno"> 238</tt>  <tt class="py-line"> </tt>
<a name="L239"></a><tt class="py-lineno"> 239</tt>  <tt class="py-line"><tt class="py-comment"># fixme: put those tests elsewhere</tt> </tt>
<a name="L240"></a><tt class="py-lineno"> 240</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L241"></a><tt class="py-lineno"> 241</tt>  <tt class="py-line"><tt class="py-comment"># print max_queued_events</tt> </tt>
<a name="L242"></a><tt class="py-lineno"> 242</tt>  <tt class="py-line"><tt class="py-comment"># print max_queued_events.value</tt> </tt>
<a name="L243"></a><tt class="py-lineno"> 243</tt>  <tt class="py-line"><tt class="py-comment"># save = max_queued_events.value</tt> </tt>
<a name="L244"></a><tt class="py-lineno"> 244</tt>  <tt class="py-line"><tt class="py-comment"># print save</tt> </tt>
<a name="L245"></a><tt class="py-lineno"> 245</tt>  <tt class="py-line"><tt class="py-comment"># max_queued_events.value += 42</tt> </tt>
<a name="L246"></a><tt class="py-lineno"> 246</tt>  <tt class="py-line"><tt class="py-comment"># print max_queued_events</tt> </tt>
<a name="L247"></a><tt class="py-lineno"> 247</tt>  <tt class="py-line"><tt class="py-comment"># max_queued_events.value = save</tt> </tt>
<a name="L248"></a><tt class="py-lineno"> 248</tt>  <tt class="py-line"><tt class="py-comment"># print max_queued_events</tt> </tt>
<a name="L249"></a><tt class="py-lineno"> 249</tt>  <tt class="py-line"> </tt>
<a name="L250"></a><tt class="py-lineno"> 250</tt>  <tt class="py-line"> </tt>
<a name="L251"></a><tt class="py-lineno"> 251</tt>  <tt class="py-line"><tt class="py-comment">### iglob ###</tt> </tt>
<a name="L252"></a><tt class="py-lineno"> 252</tt>  <tt class="py-line"> </tt>
<a name="L253"></a><tt class="py-lineno"> 253</tt>  <tt class="py-line"> </tt>
<a name="L254"></a><tt class="py-lineno"> 254</tt>  <tt class="py-line"><tt class="py-comment"># Code taken from standart Python Lib, slightly modified in order to work</tt> </tt>
<a name="L255"></a><tt class="py-lineno"> 255</tt>  <tt class="py-line"><tt class="py-comment"># with pyinotify (don't exclude dotted files/dirs like .foo).</tt> </tt>
<a name="L256"></a><tt class="py-lineno"> 256</tt>  <tt class="py-line"><tt class="py-comment"># Original version:</tt> </tt>
<a name="L257"></a><tt class="py-lineno"> 257</tt>  <tt class="py-line"><tt class="py-comment"># @see: http://svn.python.org/projects/python/trunk/Lib/glob.py</tt> </tt>
<a name="L258"></a><tt class="py-lineno"> 258</tt>  <tt class="py-line"> </tt>
<a name="L259"></a><tt class="py-lineno"> 259</tt> <a class="py-toggle" href="#" id="iglob-toggle" onclick="return toggle('iglob');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#iglob">iglob</a><tt class="py-op">(</tt><tt class="py-param">pathname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="iglob-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="iglob-expanded"><a name="L260"></a><tt class="py-lineno"> 260</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-43" class="py-name" targets="Function pyinotify.has_magic()=pyinotify-module.html#has_magic"><a title="pyinotify.has_magic" class="py-name" href="#" onclick="return doclink('link-43', 'has_magic', 'link-43');">has_magic</a></tt><tt class="py-op">(</tt><tt class="py-name">pathname</tt><tt class="py-op">)</tt><tt class="py-op">:</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">hasattr</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-string">'lexists'</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-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">lexists</tt><tt class="py-op">(</tt><tt class="py-name">pathname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L263"></a><tt class="py-lineno"> 263</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">pathname</tt> </tt>
<a name="L264"></a><tt class="py-lineno"> 264</tt>  <tt class="py-line">        <tt class="py-keyword">else</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">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">pathname</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</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 class="py-name">pathname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L266"></a><tt class="py-lineno"> 266</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">pathname</tt> </tt>
<a name="L267"></a><tt class="py-lineno"> 267</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> </tt>
<a name="L268"></a><tt class="py-lineno"> 268</tt>  <tt class="py-line">    <tt class="py-name">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</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">split</tt><tt class="py-op">(</tt><tt class="py-name">pathname</tt><tt class="py-op">)</tt> </tt>
<a name="L269"></a><tt class="py-lineno"> 269</tt>  <tt class="py-line">    <tt class="py-comment"># relative pathname</tt> </tt>
<a name="L270"></a><tt class="py-lineno"> 270</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">dirname</tt><tt class="py-op">:</tt> </tt>
<a name="L271"></a><tt class="py-lineno"> 271</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> </tt>
<a name="L272"></a><tt class="py-lineno"> 272</tt>  <tt class="py-line">    <tt class="py-comment"># absolute pathname</tt> </tt>
<a name="L273"></a><tt class="py-lineno"> 273</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-44" class="py-name"><a title="pyinotify.has_magic" class="py-name" href="#" onclick="return doclink('link-44', 'has_magic', 'link-43');">has_magic</a></tt><tt class="py-op">(</tt><tt class="py-name">dirname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L274"></a><tt class="py-lineno"> 274</tt>  <tt class="py-line">        <tt class="py-name">dirs</tt> <tt class="py-op">=</tt> <tt id="link-45" class="py-name" targets="Function pyinotify.iglob()=pyinotify-module.html#iglob"><a title="pyinotify.iglob" class="py-name" href="#" onclick="return doclink('link-45', 'iglob', 'link-45');">iglob</a></tt><tt class="py-op">(</tt><tt class="py-name">dirname</tt><tt class="py-op">)</tt> </tt>
<a name="L275"></a><tt class="py-lineno"> 275</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L276"></a><tt class="py-lineno"> 276</tt>  <tt class="py-line">        <tt class="py-name">dirs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">dirname</tt><tt class="py-op">]</tt> </tt>
<a name="L277"></a><tt class="py-lineno"> 277</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-46" class="py-name"><a title="pyinotify.has_magic" class="py-name" href="#" onclick="return doclink('link-46', 'has_magic', 'link-43');">has_magic</a></tt><tt class="py-op">(</tt><tt class="py-name">basename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L278"></a><tt class="py-lineno"> 278</tt>  <tt class="py-line">        <tt class="py-name">glob_in_dir</tt> <tt class="py-op">=</tt> <tt id="link-47" class="py-name" targets="Function pyinotify.glob1()=pyinotify-module.html#glob1"><a title="pyinotify.glob1" class="py-name" href="#" onclick="return doclink('link-47', 'glob1', 'link-47');">glob1</a></tt> </tt>
<a name="L279"></a><tt class="py-lineno"> 279</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L280"></a><tt class="py-lineno"> 280</tt>  <tt class="py-line">        <tt class="py-name">glob_in_dir</tt> <tt class="py-op">=</tt> <tt id="link-48" class="py-name" targets="Function pyinotify.glob0()=pyinotify-module.html#glob0"><a title="pyinotify.glob0" class="py-name" href="#" onclick="return doclink('link-48', 'glob0', 'link-48');">glob0</a></tt> </tt>
<a name="L281"></a><tt class="py-lineno"> 281</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">dirname</tt> <tt class="py-keyword">in</tt> <tt class="py-name">dirs</tt><tt class="py-op">:</tt> </tt>
<a name="L282"></a><tt class="py-lineno"> 282</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-49" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-49', 'name', 'link-17');">name</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">glob_in_dir</tt><tt class="py-op">(</tt><tt class="py-name">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L283"></a><tt class="py-lineno"> 283</tt>  <tt class="py-line">            <tt class="py-keyword">yield</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">dirname</tt><tt class="py-op">,</tt> <tt id="link-50" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-50', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L284"></a><tt class="py-lineno"> 284</tt>  <tt class="py-line"> </tt>
<a name="glob1"></a><div id="glob1-def"><a name="L285"></a><tt class="py-lineno"> 285</tt> <a class="py-toggle" href="#" id="glob1-toggle" onclick="return toggle('glob1');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#glob1">glob1</a><tt class="py-op">(</tt><tt class="py-param">dirname</tt><tt class="py-op">,</tt> <tt class="py-param">pattern</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="glob1-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="glob1-expanded"><a name="L286"></a><tt class="py-lineno"> 286</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">dirname</tt><tt class="py-op">:</tt> </tt>
<a name="L287"></a><tt class="py-lineno"> 287</tt>  <tt class="py-line">        <tt class="py-name">dirname</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">curdir</tt> </tt>
<a name="L288"></a><tt class="py-lineno"> 288</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L289"></a><tt class="py-lineno"> 289</tt>  <tt class="py-line">        <tt class="py-name">names</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">listdir</tt><tt class="py-op">(</tt><tt class="py-name">dirname</tt><tt class="py-op">)</tt> </tt>
<a name="L290"></a><tt class="py-lineno"> 290</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">:</tt> </tt>
<a name="L291"></a><tt class="py-lineno"> 291</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L292"></a><tt class="py-lineno"> 292</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">fnmatch</tt><tt class="py-op">.</tt><tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">names</tt><tt class="py-op">,</tt> <tt class="py-name">pattern</tt><tt class="py-op">)</tt> </tt>
</div><a name="L293"></a><tt class="py-lineno"> 293</tt>  <tt class="py-line"> </tt>
<a name="glob0"></a><div id="glob0-def"><a name="L294"></a><tt class="py-lineno"> 294</tt> <a class="py-toggle" href="#" id="glob0-toggle" onclick="return toggle('glob0');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#glob0">glob0</a><tt class="py-op">(</tt><tt class="py-param">dirname</tt><tt class="py-op">,</tt> <tt class="py-param">basename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="glob0-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="glob0-expanded"><a name="L295"></a><tt class="py-lineno"> 295</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">basename</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt> <tt class="py-keyword">and</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">dirname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L296"></a><tt class="py-lineno"> 296</tt>  <tt class="py-line">        <tt class="py-comment"># `os.path.split()` returns an empty basename for paths ending with a</tt> </tt>
<a name="L297"></a><tt class="py-lineno"> 297</tt>  <tt class="py-line">        <tt class="py-comment"># directory separator.  'q*x/' should match only directories.</tt> </tt>
<a name="L298"></a><tt class="py-lineno"> 298</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">basename</tt><tt class="py-op">]</tt> </tt>
<a name="L299"></a><tt class="py-lineno"> 299</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</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-string">'lexists'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L300"></a><tt class="py-lineno"> 300</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">lexists</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">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L301"></a><tt class="py-lineno"> 301</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">basename</tt><tt class="py-op">]</tt> </tt>
<a name="L302"></a><tt class="py-lineno"> 302</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L303"></a><tt class="py-lineno"> 303</tt>  <tt class="py-line">        <tt class="py-keyword">if</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">islink</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">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> </tt>
<a name="L304"></a><tt class="py-lineno"> 304</tt>  <tt class="py-line">            <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 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">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L305"></a><tt class="py-lineno"> 305</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">basename</tt><tt class="py-op">]</tt> </tt>
<a name="L306"></a><tt class="py-lineno"> 306</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
</div><a name="L307"></a><tt class="py-lineno"> 307</tt>  <tt class="py-line"> </tt>
<a name="L308"></a><tt class="py-lineno"> 308</tt>  <tt class="py-line"><tt id="link-51" class="py-name" targets="Variable pyinotify.magic_check=pyinotify-module.html#magic_check"><a title="pyinotify.magic_check" class="py-name" href="#" onclick="return doclink('link-51', 'magic_check', 'link-51');">magic_check</a></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-string">'[*?[]'</tt><tt class="py-op">)</tt> </tt>
<a name="has_magic"></a><div id="has_magic-def"><a name="L309"></a><tt class="py-lineno"> 309</tt>  <tt class="py-line"> </tt>
<a name="L310"></a><tt class="py-lineno"> 310</tt> <a class="py-toggle" href="#" id="has_magic-toggle" onclick="return toggle('has_magic');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#has_magic">has_magic</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="has_magic-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="has_magic-expanded"><a name="L311"></a><tt class="py-lineno"> 311</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-52" class="py-name"><a title="pyinotify.magic_check" class="py-name" href="#" onclick="return doclink('link-52', 'magic_check', 'link-51');">magic_check</a></tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L312"></a><tt class="py-lineno"> 312</tt>  <tt class="py-line"> </tt>
<a name="EventsCodes"></a><div id="EventsCodes-def"><a name="L313"></a><tt class="py-lineno"> 313</tt>  <tt class="py-line"> </tt>
<a name="L314"></a><tt class="py-lineno"> 314</tt>  <tt class="py-line"> </tt>
<a name="L315"></a><tt class="py-lineno"> 315</tt>  <tt class="py-line"><tt class="py-comment">### Core ###</tt> </tt>
<a name="L316"></a><tt class="py-lineno"> 316</tt>  <tt class="py-line"> </tt>
<a name="L317"></a><tt class="py-lineno"> 317</tt>  <tt class="py-line"> </tt>
<a name="L318"></a><tt class="py-lineno"> 318</tt> <a class="py-toggle" href="#" id="EventsCodes-toggle" onclick="return toggle('EventsCodes');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.EventsCodes-class.html">EventsCodes</a><tt class="py-op">:</tt> </tt>
</div><div id="EventsCodes-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="EventsCodes-expanded"><a name="L319"></a><tt class="py-lineno"> 319</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L320"></a><tt class="py-lineno"> 320</tt>  <tt class="py-line"><tt class="py-docstring">    Set of codes corresponding to each kind of events.</tt> </tt>
<a name="L321"></a><tt class="py-lineno"> 321</tt>  <tt class="py-line"><tt class="py-docstring">    Some of these flags are used to communicate with inotify, whereas</tt> </tt>
<a name="L322"></a><tt class="py-lineno"> 322</tt>  <tt class="py-line"><tt class="py-docstring">    the others are sent to userspace by inotify notifying some events.</tt> </tt>
<a name="L323"></a><tt class="py-lineno"> 323</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L324"></a><tt class="py-lineno"> 324</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_ACCESS: File was accessed.</tt> </tt>
<a name="L325"></a><tt class="py-lineno"> 325</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_ACCESS: int</tt> </tt>
<a name="L326"></a><tt class="py-lineno"> 326</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_MODIFY: File was modified.</tt> </tt>
<a name="L327"></a><tt class="py-lineno"> 327</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_MODIFY: int</tt> </tt>
<a name="L328"></a><tt class="py-lineno"> 328</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_ATTRIB: Metadata changed.</tt> </tt>
<a name="L329"></a><tt class="py-lineno"> 329</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_ATTRIB: int</tt> </tt>
<a name="L330"></a><tt class="py-lineno"> 330</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_CLOSE_WRITE: Writtable file was closed.</tt> </tt>
<a name="L331"></a><tt class="py-lineno"> 331</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_CLOSE_WRITE: int</tt> </tt>
<a name="L332"></a><tt class="py-lineno"> 332</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_CLOSE_NOWRITE: Unwrittable file closed.</tt> </tt>
<a name="L333"></a><tt class="py-lineno"> 333</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_CLOSE_NOWRITE: int</tt> </tt>
<a name="L334"></a><tt class="py-lineno"> 334</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_OPEN: File was opened.</tt> </tt>
<a name="L335"></a><tt class="py-lineno"> 335</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_OPEN: int</tt> </tt>
<a name="L336"></a><tt class="py-lineno"> 336</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_MOVED_FROM: File was moved from X.</tt> </tt>
<a name="L337"></a><tt class="py-lineno"> 337</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_MOVED_FROM: int</tt> </tt>
<a name="L338"></a><tt class="py-lineno"> 338</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_MOVED_TO: File was moved to Y.</tt> </tt>
<a name="L339"></a><tt class="py-lineno"> 339</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_MOVED_TO: int</tt> </tt>
<a name="L340"></a><tt class="py-lineno"> 340</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_CREATE: Subfile was created.</tt> </tt>
<a name="L341"></a><tt class="py-lineno"> 341</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_CREATE: int</tt> </tt>
<a name="L342"></a><tt class="py-lineno"> 342</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_DELETE: Subfile was deleted.</tt> </tt>
<a name="L343"></a><tt class="py-lineno"> 343</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_DELETE: int</tt> </tt>
<a name="L344"></a><tt class="py-lineno"> 344</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_DELETE_SELF: Self (watched item itself) was deleted.</tt> </tt>
<a name="L345"></a><tt class="py-lineno"> 345</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_DELETE_SELF: int</tt> </tt>
<a name="L346"></a><tt class="py-lineno"> 346</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_MOVE_SELF: Self (watched item itself) was moved.</tt> </tt>
<a name="L347"></a><tt class="py-lineno"> 347</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_MOVE_SELF: int</tt> </tt>
<a name="L348"></a><tt class="py-lineno"> 348</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_UNMOUNT: Backing fs was unmounted.</tt> </tt>
<a name="L349"></a><tt class="py-lineno"> 349</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_UNMOUNT: int</tt> </tt>
<a name="L350"></a><tt class="py-lineno"> 350</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_Q_OVERFLOW: Event queued overflowed.</tt> </tt>
<a name="L351"></a><tt class="py-lineno"> 351</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_Q_OVERFLOW: int</tt> </tt>
<a name="L352"></a><tt class="py-lineno"> 352</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_IGNORED: File was ignored.</tt> </tt>
<a name="L353"></a><tt class="py-lineno"> 353</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_IGNORED: int</tt> </tt>
<a name="L354"></a><tt class="py-lineno"> 354</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_ONLYDIR: only watch the path if it is a directory (new</tt> </tt>
<a name="L355"></a><tt class="py-lineno"> 355</tt>  <tt class="py-line"><tt class="py-docstring">                      in kernel 2.6.15).</tt> </tt>
<a name="L356"></a><tt class="py-lineno"> 356</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_ONLYDIR: int</tt> </tt>
<a name="L357"></a><tt class="py-lineno"> 357</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_DONT_FOLLOW: don't follow a symlink (new in kernel 2.6.15).</tt> </tt>
<a name="L358"></a><tt class="py-lineno"> 358</tt>  <tt class="py-line"><tt class="py-docstring">                          IN_ONLYDIR we can make sure that we don't watch</tt> </tt>
<a name="L359"></a><tt class="py-lineno"> 359</tt>  <tt class="py-line"><tt class="py-docstring">                          the target of symlinks.</tt> </tt>
<a name="L360"></a><tt class="py-lineno"> 360</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_DONT_FOLLOW: int</tt> </tt>
<a name="L361"></a><tt class="py-lineno"> 361</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_MASK_ADD: add to the mask of an already existing watch (new</tt> </tt>
<a name="L362"></a><tt class="py-lineno"> 362</tt>  <tt class="py-line"><tt class="py-docstring">                       in kernel 2.6.14).</tt> </tt>
<a name="L363"></a><tt class="py-lineno"> 363</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_MASK_ADD: int</tt> </tt>
<a name="L364"></a><tt class="py-lineno"> 364</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_ISDIR: Event occurred against dir.</tt> </tt>
<a name="L365"></a><tt class="py-lineno"> 365</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_ISDIR: int</tt> </tt>
<a name="L366"></a><tt class="py-lineno"> 366</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar IN_ONESHOT: Only send event once.</tt> </tt>
<a name="L367"></a><tt class="py-lineno"> 367</tt>  <tt class="py-line"><tt class="py-docstring">    @type IN_ONESHOT: int</tt> </tt>
<a name="L368"></a><tt class="py-lineno"> 368</tt>  <tt class="py-line"><tt class="py-docstring">    @cvar ALL_EVENTS: Alias for considering all of the events.</tt> </tt>
<a name="L369"></a><tt class="py-lineno"> 369</tt>  <tt class="py-line"><tt class="py-docstring">    @type ALL_EVENTS: int</tt> </tt>
<a name="L370"></a><tt class="py-lineno"> 370</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L371"></a><tt class="py-lineno"> 371</tt>  <tt class="py-line"> </tt>
<a name="L372"></a><tt class="py-lineno"> 372</tt>  <tt class="py-line">    <tt class="py-comment"># The idea here is 'configuration-as-code' - this way, we get our nice class</tt> </tt>
<a name="L373"></a><tt class="py-lineno"> 373</tt>  <tt class="py-line">    <tt class="py-comment"># constants, but we also get nice human-friendly text mappings to do lookups</tt> </tt>
<a name="L374"></a><tt class="py-lineno"> 374</tt>  <tt class="py-line">    <tt class="py-comment"># against as well, for free:</tt> </tt>
<a name="L375"></a><tt class="py-lineno"> 375</tt>  <tt class="py-line">    <tt id="link-53" class="py-name" targets="Variable pyinotify.EventsCodes.FLAG_COLLECTIONS=pyinotify.EventsCodes-class.html#FLAG_COLLECTIONS"><a title="pyinotify.EventsCodes.FLAG_COLLECTIONS" class="py-name" href="#" onclick="return doclink('link-53', 'FLAG_COLLECTIONS', 'link-53');">FLAG_COLLECTIONS</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'OP_FLAGS'</tt><tt class="py-op">:</tt> <tt class="py-op">{</tt> </tt>
<a name="L376"></a><tt class="py-lineno"> 376</tt>  <tt class="py-line">        <tt class="py-string">'IN_ACCESS'</tt>        <tt class="py-op">:</tt> <tt class="py-number">0x00000001</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was accessed</tt> </tt>
<a name="L377"></a><tt class="py-lineno"> 377</tt>  <tt class="py-line">        <tt class="py-string">'IN_MODIFY'</tt>        <tt class="py-op">:</tt> <tt class="py-number">0x00000002</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was modified</tt> </tt>
<a name="L378"></a><tt class="py-lineno"> 378</tt>  <tt class="py-line">        <tt class="py-string">'IN_ATTRIB'</tt>        <tt class="py-op">:</tt> <tt class="py-number">0x00000004</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Metadata changed</tt> </tt>
<a name="L379"></a><tt class="py-lineno"> 379</tt>  <tt class="py-line">        <tt class="py-string">'IN_CLOSE_WRITE'</tt>   <tt class="py-op">:</tt> <tt class="py-number">0x00000008</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Writable file was closed</tt> </tt>
<a name="L380"></a><tt class="py-lineno"> 380</tt>  <tt class="py-line">        <tt class="py-string">'IN_CLOSE_NOWRITE'</tt> <tt class="py-op">:</tt> <tt class="py-number">0x00000010</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Unwritable file closed</tt> </tt>
<a name="L381"></a><tt class="py-lineno"> 381</tt>  <tt class="py-line">        <tt class="py-string">'IN_OPEN'</tt>          <tt class="py-op">:</tt> <tt class="py-number">0x00000020</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was opened</tt> </tt>
<a name="L382"></a><tt class="py-lineno"> 382</tt>  <tt class="py-line">        <tt class="py-string">'IN_MOVED_FROM'</tt>    <tt class="py-op">:</tt> <tt class="py-number">0x00000040</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was moved from X</tt> </tt>
<a name="L383"></a><tt class="py-lineno"> 383</tt>  <tt class="py-line">        <tt class="py-string">'IN_MOVED_TO'</tt>      <tt class="py-op">:</tt> <tt class="py-number">0x00000080</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was moved to Y</tt> </tt>
<a name="L384"></a><tt class="py-lineno"> 384</tt>  <tt class="py-line">        <tt class="py-string">'IN_CREATE'</tt>        <tt class="py-op">:</tt> <tt class="py-number">0x00000100</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Subfile was created</tt> </tt>
<a name="L385"></a><tt class="py-lineno"> 385</tt>  <tt class="py-line">        <tt class="py-string">'IN_DELETE'</tt>        <tt class="py-op">:</tt> <tt class="py-number">0x00000200</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Subfile was deleted</tt> </tt>
<a name="L386"></a><tt class="py-lineno"> 386</tt>  <tt class="py-line">        <tt class="py-string">'IN_DELETE_SELF'</tt>   <tt class="py-op">:</tt> <tt class="py-number">0x00000400</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Self (watched item itself)</tt> </tt>
<a name="L387"></a><tt class="py-lineno"> 387</tt>  <tt class="py-line">                                          <tt class="py-comment"># was deleted</tt> </tt>
<a name="L388"></a><tt class="py-lineno"> 388</tt>  <tt class="py-line">        <tt class="py-string">'IN_MOVE_SELF'</tt>     <tt class="py-op">:</tt> <tt class="py-number">0x00000800</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Self (watched item itself) was moved</tt> </tt>
<a name="L389"></a><tt class="py-lineno"> 389</tt>  <tt class="py-line">        <tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L390"></a><tt class="py-lineno"> 390</tt>  <tt class="py-line">                        <tt class="py-string">'EVENT_FLAGS'</tt><tt class="py-op">:</tt> <tt class="py-op">{</tt> </tt>
<a name="L391"></a><tt class="py-lineno"> 391</tt>  <tt class="py-line">        <tt class="py-string">'IN_UNMOUNT'</tt>       <tt class="py-op">:</tt> <tt class="py-number">0x00002000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Backing fs was unmounted</tt> </tt>
<a name="L392"></a><tt class="py-lineno"> 392</tt>  <tt class="py-line">        <tt class="py-string">'IN_Q_OVERFLOW'</tt>    <tt class="py-op">:</tt> <tt class="py-number">0x00004000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># Event queued overflowed</tt> </tt>
<a name="L393"></a><tt class="py-lineno"> 393</tt>  <tt class="py-line">        <tt class="py-string">'IN_IGNORED'</tt>       <tt class="py-op">:</tt> <tt class="py-number">0x00008000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># File was ignored</tt> </tt>
<a name="L394"></a><tt class="py-lineno"> 394</tt>  <tt class="py-line">        <tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L395"></a><tt class="py-lineno"> 395</tt>  <tt class="py-line">                        <tt class="py-string">'SPECIAL_FLAGS'</tt><tt class="py-op">:</tt> <tt class="py-op">{</tt> </tt>
<a name="L396"></a><tt class="py-lineno"> 396</tt>  <tt class="py-line">        <tt class="py-string">'IN_ONLYDIR'</tt>       <tt class="py-op">:</tt> <tt class="py-number">0x01000000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># only watch the path if it is a</tt> </tt>
<a name="L397"></a><tt class="py-lineno"> 397</tt>  <tt class="py-line">                                          <tt class="py-comment"># directory</tt> </tt>
<a name="L398"></a><tt class="py-lineno"> 398</tt>  <tt class="py-line">        <tt class="py-string">'IN_DONT_FOLLOW'</tt>   <tt class="py-op">:</tt> <tt class="py-number">0x02000000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># don't follow a symlink</tt> </tt>
<a name="L399"></a><tt class="py-lineno"> 399</tt>  <tt class="py-line">        <tt class="py-string">'IN_MASK_ADD'</tt>      <tt class="py-op">:</tt> <tt class="py-number">0x20000000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># add to the mask of an already</tt> </tt>
<a name="L400"></a><tt class="py-lineno"> 400</tt>  <tt class="py-line">                                          <tt class="py-comment"># existing watch</tt> </tt>
<a name="L401"></a><tt class="py-lineno"> 401</tt>  <tt class="py-line">        <tt class="py-string">'IN_ISDIR'</tt>         <tt class="py-op">:</tt> <tt class="py-number">0x40000000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># event occurred against dir</tt> </tt>
<a name="L402"></a><tt class="py-lineno"> 402</tt>  <tt class="py-line">        <tt class="py-string">'IN_ONESHOT'</tt>       <tt class="py-op">:</tt> <tt class="py-number">0x80000000</tt><tt class="py-op">,</tt>  <tt class="py-comment"># only send event once</tt> </tt>
<a name="L403"></a><tt class="py-lineno"> 403</tt>  <tt class="py-line">        <tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L404"></a><tt class="py-lineno"> 404</tt>  <tt class="py-line">                        <tt class="py-op">}</tt> </tt>
<a name="L405"></a><tt class="py-lineno"> 405</tt>  <tt class="py-line"> </tt>
<a name="EventsCodes.maskname"></a><div id="EventsCodes.maskname-def"><a name="L406"></a><tt class="py-lineno"> 406</tt> <a class="py-toggle" href="#" id="EventsCodes.maskname-toggle" onclick="return toggle('EventsCodes.maskname');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.EventsCodes-class.html#maskname">maskname</a><tt class="py-op">(</tt><tt class="py-param">mask</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="EventsCodes.maskname-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="EventsCodes.maskname-expanded"><a name="L407"></a><tt class="py-lineno"> 407</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L408"></a><tt class="py-lineno"> 408</tt>  <tt class="py-line"><tt class="py-docstring">        Return the event name associated to mask. IN_ISDIR is appended when</tt> </tt>
<a name="L409"></a><tt class="py-lineno"> 409</tt>  <tt class="py-line"><tt class="py-docstring">        appropriate. Note: only one event is returned, because only one is</tt> </tt>
<a name="L410"></a><tt class="py-lineno"> 410</tt>  <tt class="py-line"><tt class="py-docstring">        raised once at a time.</tt> </tt>
<a name="L411"></a><tt class="py-lineno"> 411</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L412"></a><tt class="py-lineno"> 412</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: mask.</tt> </tt>
<a name="L413"></a><tt class="py-lineno"> 413</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L414"></a><tt class="py-lineno"> 414</tt>  <tt class="py-line"><tt class="py-docstring">        @return: event name.</tt> </tt>
<a name="L415"></a><tt class="py-lineno"> 415</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: str</tt> </tt>
<a name="L416"></a><tt class="py-lineno"> 416</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L417"></a><tt class="py-lineno"> 417</tt>  <tt class="py-line">        <tt class="py-name">ms</tt> <tt class="py-op">=</tt> <tt class="py-name">mask</tt> </tt>
<a name="L418"></a><tt class="py-lineno"> 418</tt>  <tt class="py-line">        <tt id="link-54" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-54', 'name', 'link-17');">name</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'%s'</tt> </tt>
<a name="L419"></a><tt class="py-lineno"> 419</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">mask</tt> <tt class="py-op">&amp;</tt> <tt id="link-55" class="py-name" targets="Variable pyinotify.IN_ISDIR=pyinotify-module.html#IN_ISDIR"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-55', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></tt><tt class="py-op">:</tt> </tt>
<a name="L420"></a><tt class="py-lineno"> 420</tt>  <tt class="py-line">            <tt class="py-name">ms</tt> <tt class="py-op">=</tt> <tt class="py-name">mask</tt> <tt class="py-op">-</tt> <tt id="link-56" class="py-name"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-56', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></tt> </tt>
<a name="L421"></a><tt class="py-lineno"> 421</tt>  <tt class="py-line">            <tt id="link-57" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-57', 'name', 'link-17');">name</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'%s|IN_ISDIR'</tt> </tt>
<a name="L422"></a><tt class="py-lineno"> 422</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-58" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-58', 'name', 'link-17');">name</a></tt> <tt class="py-op">%</tt> <tt id="link-59" class="py-name" targets="Class pyinotify.EventsCodes=pyinotify.EventsCodes-class.html"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-59', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-60" class="py-name" targets="Variable pyinotify.EventsCodes.ALL_VALUES=pyinotify.EventsCodes-class.html#ALL_VALUES"><a title="pyinotify.EventsCodes.ALL_VALUES" class="py-name" href="#" onclick="return doclink('link-60', 'ALL_VALUES', 'link-60');">ALL_VALUES</a></tt><tt class="py-op">[</tt><tt class="py-name">ms</tt><tt class="py-op">]</tt> </tt>
</div><a name="L423"></a><tt class="py-lineno"> 423</tt>  <tt class="py-line"> </tt>
<a name="L424"></a><tt class="py-lineno"> 424</tt>  <tt class="py-line">    <tt id="link-61" class="py-name" targets="Static Method pyinotify.EventsCodes.maskname()=pyinotify.EventsCodes-class.html#maskname"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-61', 'maskname', 'link-61');">maskname</a></tt> <tt class="py-op">=</tt> <tt class="py-name">staticmethod</tt><tt class="py-op">(</tt><tt id="link-62" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-62', 'maskname', 'link-61');">maskname</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L425"></a><tt class="py-lineno"> 425</tt>  <tt class="py-line"> </tt>
<a name="L426"></a><tt class="py-lineno"> 426</tt>  <tt class="py-line"> </tt>
<a name="L427"></a><tt class="py-lineno"> 427</tt>  <tt class="py-line"><tt class="py-comment"># So let's now turn the configuration into code</tt> </tt>
<a name="L428"></a><tt class="py-lineno"> 428</tt>  <tt class="py-line"><tt id="link-63" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-63', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-64" class="py-name" targets="Variable pyinotify.EventsCodes.ALL_FLAGS=pyinotify.EventsCodes-class.html#ALL_FLAGS"><a title="pyinotify.EventsCodes.ALL_FLAGS" class="py-name" href="#" onclick="return doclink('link-64', 'ALL_FLAGS', 'link-64');">ALL_FLAGS</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L429"></a><tt class="py-lineno"> 429</tt>  <tt class="py-line"><tt id="link-65" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-65', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-66" class="py-name"><a title="pyinotify.EventsCodes.ALL_VALUES" class="py-name" href="#" onclick="return doclink('link-66', 'ALL_VALUES', 'link-60');">ALL_VALUES</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L430"></a><tt class="py-lineno"> 430</tt>  <tt class="py-line"><tt class="py-keyword">for</tt> <tt id="link-67" class="py-name" targets="Variable pyinotify.flagc=pyinotify-module.html#flagc"><a title="pyinotify.flagc" class="py-name" href="#" onclick="return doclink('link-67', 'flagc', 'link-67');">flagc</a></tt><tt class="py-op">,</tt> <tt id="link-68" class="py-name" targets="Variable pyinotify.valc=pyinotify-module.html#valc"><a title="pyinotify.valc" class="py-name" href="#" onclick="return doclink('link-68', 'valc', 'link-68');">valc</a></tt> <tt class="py-keyword">in</tt> <tt id="link-69" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-69', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-70" class="py-name"><a title="pyinotify.EventsCodes.FLAG_COLLECTIONS" class="py-name" href="#" onclick="return doclink('link-70', 'FLAG_COLLECTIONS', 'link-53');">FLAG_COLLECTIONS</a></tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L431"></a><tt class="py-lineno"> 431</tt>  <tt class="py-line">    <tt class="py-comment"># Make the collections' members directly accessible through the</tt> </tt>
<a name="L432"></a><tt class="py-lineno"> 432</tt>  <tt class="py-line">    <tt class="py-comment"># class dictionary</tt> </tt>
<a name="L433"></a><tt class="py-lineno"> 433</tt>  <tt class="py-line">    <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-71" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-71', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">,</tt> <tt id="link-72" class="py-name"><a title="pyinotify.flagc" class="py-name" href="#" onclick="return doclink('link-72', 'flagc', 'link-67');">flagc</a></tt><tt class="py-op">,</tt> <tt id="link-73" class="py-name"><a title="pyinotify.valc" class="py-name" href="#" onclick="return doclink('link-73', 'valc', 'link-68');">valc</a></tt><tt class="py-op">)</tt> </tt>
<a name="L434"></a><tt class="py-lineno"> 434</tt>  <tt class="py-line"> </tt>
<a name="L435"></a><tt class="py-lineno"> 435</tt>  <tt class="py-line">    <tt class="py-comment"># Collect all the flags under a common umbrella</tt> </tt>
<a name="L436"></a><tt class="py-lineno"> 436</tt>  <tt class="py-line">    <tt id="link-74" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-74', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-75" class="py-name"><a title="pyinotify.EventsCodes.ALL_FLAGS" class="py-name" href="#" onclick="return doclink('link-75', 'ALL_FLAGS', 'link-64');">ALL_FLAGS</a></tt><tt class="py-op">.</tt><tt class="py-name">update</tt><tt class="py-op">(</tt><tt id="link-76" class="py-name"><a title="pyinotify.valc" class="py-name" href="#" onclick="return doclink('link-76', 'valc', 'link-68');">valc</a></tt><tt class="py-op">)</tt> </tt>
<a name="L437"></a><tt class="py-lineno"> 437</tt>  <tt class="py-line"> </tt>
<a name="L438"></a><tt class="py-lineno"> 438</tt>  <tt class="py-line">    <tt class="py-comment"># Make the individual masks accessible as 'constants' at globals() scope</tt> </tt>
<a name="L439"></a><tt class="py-lineno"> 439</tt>  <tt class="py-line">    <tt class="py-comment"># and masknames accessible by values.</tt> </tt>
<a name="L440"></a><tt class="py-lineno"> 440</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt id="link-77" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-77', 'name', 'link-17');">name</a></tt><tt class="py-op">,</tt> <tt id="link-78" class="py-name" targets="Variable pyinotify.val=pyinotify-module.html#val"><a title="pyinotify.val" class="py-name" href="#" onclick="return doclink('link-78', 'val', 'link-78');">val</a></tt> <tt class="py-keyword">in</tt> <tt id="link-79" class="py-name"><a title="pyinotify.valc" class="py-name" href="#" onclick="return doclink('link-79', 'valc', 'link-68');">valc</a></tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L441"></a><tt class="py-lineno"> 441</tt>  <tt class="py-line">        <tt class="py-name">globals</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt id="link-80" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-80', 'name', 'link-17');">name</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-81" class="py-name"><a title="pyinotify.val" class="py-name" href="#" onclick="return doclink('link-81', 'val', 'link-78');">val</a></tt> </tt>
<a name="L442"></a><tt class="py-lineno"> 442</tt>  <tt class="py-line">        <tt id="link-82" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-82', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="pyinotify.EventsCodes.ALL_VALUES" class="py-name" href="#" onclick="return doclink('link-83', 'ALL_VALUES', 'link-60');">ALL_VALUES</a></tt><tt class="py-op">[</tt><tt id="link-84" class="py-name"><a title="pyinotify.val" class="py-name" href="#" onclick="return doclink('link-84', 'val', 'link-78');">val</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-85" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-85', 'name', 'link-17');">name</a></tt> </tt>
<a name="L443"></a><tt class="py-lineno"> 443</tt>  <tt class="py-line"> </tt>
<a name="L444"></a><tt class="py-lineno"> 444</tt>  <tt class="py-line"> </tt>
<a name="L445"></a><tt class="py-lineno"> 445</tt>  <tt class="py-line"><tt class="py-comment"># all 'normal' events</tt> </tt>
<a name="L446"></a><tt class="py-lineno"> 446</tt>  <tt class="py-line"><tt id="link-86" class="py-name" targets="Variable pyinotify.ALL_EVENTS=pyinotify-module.html#ALL_EVENTS"><a title="pyinotify.ALL_EVENTS" class="py-name" href="#" onclick="return doclink('link-86', 'ALL_EVENTS', 'link-86');">ALL_EVENTS</a></tt> <tt class="py-op">=</tt> <tt class="py-name">reduce</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-name">y</tt><tt class="py-op">:</tt> <tt class="py-name">x</tt> <tt class="py-op">|</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt id="link-87" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-87', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-88" class="py-name" targets="Variable pyinotify.EventsCodes.OP_FLAGS=pyinotify.EventsCodes-class.html#OP_FLAGS"><a title="pyinotify.EventsCodes.OP_FLAGS" class="py-name" href="#" onclick="return doclink('link-88', 'OP_FLAGS', 'link-88');">OP_FLAGS</a></tt><tt class="py-op">.</tt><tt class="py-name">itervalues</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L447"></a><tt class="py-lineno"> 447</tt>  <tt class="py-line"><tt id="link-89" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-89', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="pyinotify.EventsCodes.ALL_FLAGS" class="py-name" href="#" onclick="return doclink('link-90', 'ALL_FLAGS', 'link-64');">ALL_FLAGS</a></tt><tt class="py-op">[</tt><tt class="py-string">'ALL_EVENTS'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-91" class="py-name"><a title="pyinotify.ALL_EVENTS" class="py-name" href="#" onclick="return doclink('link-91', 'ALL_EVENTS', 'link-86');">ALL_EVENTS</a></tt> </tt>
<a name="L448"></a><tt class="py-lineno"> 448</tt>  <tt class="py-line"><tt id="link-92" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-92', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="pyinotify.EventsCodes.ALL_VALUES" class="py-name" href="#" onclick="return doclink('link-93', 'ALL_VALUES', 'link-60');">ALL_VALUES</a></tt><tt class="py-op">[</tt><tt id="link-94" class="py-name"><a title="pyinotify.ALL_EVENTS" class="py-name" href="#" onclick="return doclink('link-94', 'ALL_EVENTS', 'link-86');">ALL_EVENTS</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'ALL_EVENTS'</tt> </tt>
<a name="_Event"></a><div id="_Event-def"><a name="L449"></a><tt class="py-lineno"> 449</tt>  <tt class="py-line"> </tt>
<a name="L450"></a><tt class="py-lineno"> 450</tt>  <tt class="py-line"> </tt>
<a name="L451"></a><tt class="py-lineno"> 451</tt> <a class="py-toggle" href="#" id="_Event-toggle" onclick="return toggle('_Event');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify._Event-class.html">_Event</a><tt class="py-op">:</tt> </tt>
</div><div id="_Event-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_Event-expanded"><a name="L452"></a><tt class="py-lineno"> 452</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L453"></a><tt class="py-lineno"> 453</tt>  <tt class="py-line"><tt class="py-docstring">    Event structure, represent events raised by the system. This</tt> </tt>
<a name="L454"></a><tt class="py-lineno"> 454</tt>  <tt class="py-line"><tt class="py-docstring">    is the base class and should be subclassed.</tt> </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">    """</tt> </tt>
<a name="_Event.__init__"></a><div id="_Event.__init__-def"><a name="L457"></a><tt class="py-lineno"> 457</tt> <a class="py-toggle" href="#" id="_Event.__init__-toggle" onclick="return toggle('_Event.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._Event-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">dict_</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Event.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_Event.__init__-expanded"><a name="L458"></a><tt class="py-lineno"> 458</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L459"></a><tt class="py-lineno"> 459</tt>  <tt class="py-line"><tt class="py-docstring">        Attach attributes (contained in dict_) to self.</tt> </tt>
<a name="L460"></a><tt class="py-lineno"> 460</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L461"></a><tt class="py-lineno"> 461</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">tpl</tt> <tt class="py-keyword">in</tt> <tt class="py-name">dict_</tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L462"></a><tt class="py-lineno"> 462</tt>  <tt class="py-line">            <tt class="py-name">setattr</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-name">tpl</tt><tt class="py-op">)</tt> </tt>
</div><a name="L463"></a><tt class="py-lineno"> 463</tt>  <tt class="py-line"> </tt>
<a name="_Event.__repr__"></a><div id="_Event.__repr__-def"><a name="L464"></a><tt class="py-lineno"> 464</tt> <a class="py-toggle" href="#" id="_Event.__repr__-toggle" onclick="return toggle('_Event.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._Event-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="_Event.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_Event.__repr__-expanded"><a name="L465"></a><tt class="py-lineno"> 465</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L466"></a><tt class="py-lineno"> 466</tt>  <tt class="py-line"><tt class="py-docstring">        @return: String representation.</tt> </tt>
<a name="L467"></a><tt class="py-lineno"> 467</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: str</tt> </tt>
<a name="L468"></a><tt class="py-lineno"> 468</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L469"></a><tt class="py-lineno"> 469</tt>  <tt class="py-line">        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L470"></a><tt class="py-lineno"> 470</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">attr</tt><tt class="py-op">,</tt> <tt id="link-95" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-95', 'value', 'link-33');">value</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</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 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-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>
<a name="L471"></a><tt class="py-lineno"> 471</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">attr</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">'_'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L472"></a><tt class="py-lineno"> 472</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L473"></a><tt class="py-lineno"> 473</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">attr</tt> <tt class="py-op">==</tt> <tt class="py-string">'mask'</tt><tt class="py-op">:</tt> </tt>
<a name="L474"></a><tt class="py-lineno"> 474</tt>  <tt class="py-line">                <tt id="link-96" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-96', 'value', 'link-33');">value</a></tt> <tt class="py-op">=</tt> <tt class="py-name">hex</tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">attr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L475"></a><tt class="py-lineno"> 475</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt id="link-97" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-97', 'value', 'link-33');">value</a></tt><tt class="py-op">,</tt> <tt class="py-name">basestring</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt id="link-98" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-98', 'value', 'link-33');">value</a></tt><tt class="py-op">:</tt> </tt>
<a name="L476"></a><tt class="py-lineno"> 476</tt>  <tt class="py-line">                <tt id="link-99" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-99', 'value', 'link-33');">value</a></tt> <tt class="py-op">=</tt><tt class="py-string">"''"</tt> </tt>
<a name="L477"></a><tt class="py-lineno"> 477</tt>  <tt class="py-line">            <tt class="py-name">s</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 id="link-100" class="py-name" targets="Class pyinotify.Color=pyinotify.Color-class.html"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-100', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-101" class="py-name" targets="Static Method pyinotify.Color.FieldName()=pyinotify.Color-class.html#FieldName"><a title="pyinotify.Color.FieldName" class="py-name" href="#" onclick="return doclink('link-101', 'FieldName', 'link-101');">FieldName</a></tt><tt class="py-op">(</tt><tt class="py-name">attr</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L478"></a><tt class="py-lineno"> 478</tt>  <tt class="py-line">                              <tt id="link-102" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-102', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-103" class="py-name" targets="Static Method pyinotify.Color.Punctuation()=pyinotify.Color-class.html#Punctuation"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-103', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L479"></a><tt class="py-lineno"> 479</tt>  <tt class="py-line">                              <tt id="link-104" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-104', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-105" class="py-name" targets="Static Method pyinotify.Color.FieldValue()=pyinotify.Color-class.html#FieldValue"><a title="pyinotify.Color.FieldValue" class="py-name" href="#" onclick="return doclink('link-105', 'FieldValue', 'link-105');">FieldValue</a></tt><tt class="py-op">(</tt><tt id="link-106" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-106', 'value', 'link-33');">value</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>
<a name="L481"></a><tt class="py-lineno"> 481</tt>  <tt class="py-line">        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">'%s%s%s %s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-107" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-107', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-108" class="py-name"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-108', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'&lt;'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L482"></a><tt class="py-lineno"> 482</tt>  <tt class="py-line">                           <tt id="link-109" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-109', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-110" class="py-name" targets="Static Method pyinotify.Color.ClassName()=pyinotify.Color-class.html#ClassName"><a title="pyinotify.Color.ClassName" class="py-name" href="#" onclick="return doclink('link-110', 'ClassName', 'link-110');">ClassName</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L483"></a><tt class="py-lineno"> 483</tt>  <tt class="py-line">                           <tt class="py-name">s</tt><tt class="py-op">,</tt> </tt>
<a name="L484"></a><tt class="py-lineno"> 484</tt>  <tt class="py-line">                           <tt id="link-111" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-111', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-112" class="py-name"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-112', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'&gt;'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L485"></a><tt class="py-lineno"> 485</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
</div></div><a name="L486"></a><tt class="py-lineno"> 486</tt>  <tt class="py-line"> </tt>
<a name="_RawEvent"></a><div id="_RawEvent-def"><a name="L487"></a><tt class="py-lineno"> 487</tt>  <tt class="py-line"> </tt>
<a name="L488"></a><tt class="py-lineno"> 488</tt> <a class="py-toggle" href="#" id="_RawEvent-toggle" onclick="return toggle('_RawEvent');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify._RawEvent-class.html">_RawEvent</a><tt class="py-op">(</tt><tt class="py-base-class">_Event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_RawEvent-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_RawEvent-expanded"><a name="L489"></a><tt class="py-lineno"> 489</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L490"></a><tt class="py-lineno"> 490</tt>  <tt class="py-line"><tt class="py-docstring">    Raw event, it contains only the informations provided by the system.</tt> </tt>
<a name="L491"></a><tt class="py-lineno"> 491</tt>  <tt class="py-line"><tt class="py-docstring">    It doesn't infer anything.</tt> </tt>
<a name="L492"></a><tt class="py-lineno"> 492</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="_RawEvent.__init__"></a><div id="_RawEvent.__init__-def"><a name="L493"></a><tt class="py-lineno"> 493</tt> <a class="py-toggle" href="#" id="_RawEvent.__init__-toggle" onclick="return toggle('_RawEvent.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._RawEvent-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">wd</tt><tt class="py-op">,</tt> <tt class="py-param">mask</tt><tt class="py-op">,</tt> <tt class="py-param">cookie</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="_RawEvent.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_RawEvent.__init__-expanded"><a name="L494"></a><tt class="py-lineno"> 494</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L495"></a><tt class="py-lineno"> 495</tt>  <tt class="py-line"><tt class="py-docstring">        @param wd: Watch Descriptor.</tt> </tt>
<a name="L496"></a><tt class="py-lineno"> 496</tt>  <tt class="py-line"><tt class="py-docstring">        @type wd: int</tt> </tt>
<a name="L497"></a><tt class="py-lineno"> 497</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: Bitmask of events.</tt> </tt>
<a name="L498"></a><tt class="py-lineno"> 498</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L499"></a><tt class="py-lineno"> 499</tt>  <tt class="py-line"><tt class="py-docstring">        @param cookie: Cookie.</tt> </tt>
<a name="L500"></a><tt class="py-lineno"> 500</tt>  <tt class="py-line"><tt class="py-docstring">        @type cookie: int</tt> </tt>
<a name="L501"></a><tt class="py-lineno"> 501</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: Basename of the file or directory against which the</tt> </tt>
<a name="L502"></a><tt class="py-lineno"> 502</tt>  <tt class="py-line"><tt class="py-docstring">                     event was raised, in case where the watched directory</tt> </tt>
<a name="L503"></a><tt class="py-lineno"> 503</tt>  <tt class="py-line"><tt class="py-docstring">                     is the parent directory. None if the event was raised</tt> </tt>
<a name="L504"></a><tt class="py-lineno"> 504</tt>  <tt class="py-line"><tt class="py-docstring">                     on the watched item itself.</tt> </tt>
<a name="L505"></a><tt class="py-lineno"> 505</tt>  <tt class="py-line"><tt class="py-docstring">        @type name: string or None</tt> </tt>
<a name="L506"></a><tt class="py-lineno"> 506</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L507"></a><tt class="py-lineno"> 507</tt>  <tt class="py-line">        <tt class="py-comment"># name: remove trailing '\0'</tt> </tt>
<a name="L508"></a><tt class="py-lineno"> 508</tt>  <tt class="py-line">        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-113" class="py-name" targets="Class pyinotify._RawEvent=pyinotify._RawEvent-class.html"><a title="pyinotify._RawEvent" class="py-name" href="#" onclick="return doclink('link-113', '_RawEvent', 'link-113');">_RawEvent</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-114" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-114', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-op">{</tt><tt class="py-string">'wd'</tt><tt class="py-op">:</tt> <tt class="py-name">wd</tt><tt class="py-op">,</tt> </tt>
<a name="L509"></a><tt class="py-lineno"> 509</tt>  <tt class="py-line">                                         <tt class="py-string">'mask'</tt><tt class="py-op">:</tt> <tt class="py-name">mask</tt><tt class="py-op">,</tt> </tt>
<a name="L510"></a><tt class="py-lineno"> 510</tt>  <tt class="py-line">                                         <tt class="py-string">'cookie'</tt><tt class="py-op">:</tt> <tt class="py-name">cookie</tt><tt class="py-op">,</tt> </tt>
<a name="L511"></a><tt class="py-lineno"> 511</tt>  <tt class="py-line">                                         <tt class="py-string">'name'</tt><tt class="py-op">:</tt> <tt id="link-115" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-115', 'name', 'link-17');">name</a></tt><tt class="py-op">.</tt><tt class="py-name">rstrip</tt><tt class="py-op">(</tt><tt class="py-string">'\0'</tt><tt class="py-op">)</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
<a name="L512"></a><tt class="py-lineno"> 512</tt>  <tt class="py-line">        <tt id="link-116" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-116', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L513"></a><tt class="py-lineno"> 513</tt>  <tt class="py-line"> </tt>
<a name="Event"></a><div id="Event-def"><a name="L514"></a><tt class="py-lineno"> 514</tt>  <tt class="py-line"> </tt>
<a name="L515"></a><tt class="py-lineno"> 515</tt> <a class="py-toggle" href="#" id="Event-toggle" onclick="return toggle('Event');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.Event-class.html">Event</a><tt class="py-op">(</tt><tt class="py-base-class">_Event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Event-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Event-expanded"><a name="L516"></a><tt class="py-lineno"> 516</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L517"></a><tt class="py-lineno"> 517</tt>  <tt class="py-line"><tt class="py-docstring">    This class contains all the useful informations about the observed</tt> </tt>
<a name="L518"></a><tt class="py-lineno"> 518</tt>  <tt class="py-line"><tt class="py-docstring">    event. However, the incorporation of each field is not guaranteed and</tt> </tt>
<a name="L519"></a><tt class="py-lineno"> 519</tt>  <tt class="py-line"><tt class="py-docstring">    depends on the type of event. In effect, some fields are irrelevant</tt> </tt>
<a name="L520"></a><tt class="py-lineno"> 520</tt>  <tt class="py-line"><tt class="py-docstring">    for some kind of event (for example 'cookie' is meaningless for</tt> </tt>
<a name="L521"></a><tt class="py-lineno"> 521</tt>  <tt class="py-line"><tt class="py-docstring">    IN_CREATE whereas it is useful for IN_MOVE_TO).</tt> </tt>
<a name="L522"></a><tt class="py-lineno"> 522</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L523"></a><tt class="py-lineno"> 523</tt>  <tt class="py-line"><tt class="py-docstring">    The possible fields are:</tt> </tt>
<a name="L524"></a><tt class="py-lineno"> 524</tt>  <tt class="py-line"><tt class="py-docstring">      - wd (int): Watch Descriptor.</tt> </tt>
<a name="L525"></a><tt class="py-lineno"> 525</tt>  <tt class="py-line"><tt class="py-docstring">      - mask (int): Mask.</tt> </tt>
<a name="L526"></a><tt class="py-lineno"> 526</tt>  <tt class="py-line"><tt class="py-docstring">      - maskname (str): Readable event name.</tt> </tt>
<a name="L527"></a><tt class="py-lineno"> 527</tt>  <tt class="py-line"><tt class="py-docstring">      - path (str): path of the file or directory being watched.</tt> </tt>
<a name="L528"></a><tt class="py-lineno"> 528</tt>  <tt class="py-line"><tt class="py-docstring">      - name (str): Basename of the file or directory against which the</tt> </tt>
<a name="L529"></a><tt class="py-lineno"> 529</tt>  <tt class="py-line"><tt class="py-docstring">              event was raised, in case where the watched directory</tt> </tt>
<a name="L530"></a><tt class="py-lineno"> 530</tt>  <tt class="py-line"><tt class="py-docstring">              is the parent directory. None if the event was raised</tt> </tt>
<a name="L531"></a><tt class="py-lineno"> 531</tt>  <tt class="py-line"><tt class="py-docstring">              on the watched item itself. This field is always provided</tt> </tt>
<a name="L532"></a><tt class="py-lineno"> 532</tt>  <tt class="py-line"><tt class="py-docstring">              even if the string is ''.</tt> </tt>
<a name="L533"></a><tt class="py-lineno"> 533</tt>  <tt class="py-line"><tt class="py-docstring">      - pathname (str): absolute path of: path + name</tt> </tt>
<a name="L534"></a><tt class="py-lineno"> 534</tt>  <tt class="py-line"><tt class="py-docstring">      - cookie (int): Cookie.</tt> </tt>
<a name="L535"></a><tt class="py-lineno"> 535</tt>  <tt class="py-line"><tt class="py-docstring">      - dir (bool): is the event raised against directory.</tt> </tt>
<a name="L536"></a><tt class="py-lineno"> 536</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L537"></a><tt class="py-lineno"> 537</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="Event.__init__"></a><div id="Event.__init__-def"><a name="L538"></a><tt class="py-lineno"> 538</tt> <a class="py-toggle" href="#" id="Event.__init__-toggle" onclick="return toggle('Event.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Event-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">raw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Event.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Event.__init__-expanded"><a name="L539"></a><tt class="py-lineno"> 539</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L540"></a><tt class="py-lineno"> 540</tt>  <tt class="py-line"><tt class="py-docstring">        Concretely, this is the raw event plus inferred infos.</tt> </tt>
<a name="L541"></a><tt class="py-lineno"> 541</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L542"></a><tt class="py-lineno"> 542</tt>  <tt class="py-line">        <tt id="link-117" class="py-name" targets="Class pyinotify._Event=pyinotify._Event-class.html"><a title="pyinotify._Event" class="py-name" href="#" onclick="return doclink('link-117', '_Event', 'link-117');">_Event</a></tt><tt class="py-op">.</tt><tt id="link-118" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-118', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">raw</tt><tt class="py-op">)</tt> </tt>
<a name="L543"></a><tt class="py-lineno"> 543</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-119', 'maskname', 'link-61');">maskname</a></tt> <tt class="py-op">=</tt> <tt id="link-120" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-120', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-121" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-121', 'maskname', 'link-61');">maskname</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">)</tt> </tt>
<a name="L544"></a><tt class="py-lineno"> 544</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-122" class="py-name"><a title="pyinotify.COMPATIBILITY_MODE" class="py-name" href="#" onclick="return doclink('link-122', 'COMPATIBILITY_MODE', 'link-6');">COMPATIBILITY_MODE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L545"></a><tt class="py-lineno"> 545</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">event_name</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-123', 'maskname', 'link-61');">maskname</a></tt> </tt>
<a name="L546"></a><tt class="py-lineno"> 546</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L547"></a><tt class="py-lineno"> 547</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-124" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-124', 'name', 'link-17');">name</a></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">self</tt><tt class="py-op">.</tt><tt class="py-name">pathname</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">self</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> </tt>
<a name="L549"></a><tt class="py-lineno"> 549</tt>  <tt class="py-line">                                                             <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-125" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-125', 'name', 'link-17');">name</a></tt><tt class="py-op">)</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">else</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">self</tt><tt class="py-op">.</tt><tt class="py-name">pathname</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">self</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L552"></a><tt class="py-lineno"> 552</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">AttributeError</tt><tt class="py-op">:</tt> </tt>
<a name="L553"></a><tt class="py-lineno"> 553</tt>  <tt class="py-line">            <tt class="py-keyword">pass</tt> </tt>
</div></div><a name="L554"></a><tt class="py-lineno"> 554</tt>  <tt class="py-line"> </tt>
<a name="ProcessEventError"></a><div id="ProcessEventError-def"><a name="L555"></a><tt class="py-lineno"> 555</tt>  <tt class="py-line"> </tt>
<a name="L556"></a><tt class="py-lineno"> 556</tt> <a class="py-toggle" href="#" id="ProcessEventError-toggle" onclick="return toggle('ProcessEventError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.ProcessEventError-class.html">ProcessEventError</a><tt class="py-op">(</tt><tt class="py-base-class">PyinotifyError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEventError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ProcessEventError-expanded"><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-docstring">    ProcessEventError Exception. Raised on ProcessEvent error.</tt> </tt>
<a name="L559"></a><tt class="py-lineno"> 559</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="ProcessEventError.__init__"></a><div id="ProcessEventError.__init__-def"><a name="L560"></a><tt class="py-lineno"> 560</tt> <a class="py-toggle" href="#" id="ProcessEventError.__init__-toggle" onclick="return toggle('ProcessEventError.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEventError-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">err</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEventError.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEventError.__init__-expanded"><a name="L561"></a><tt class="py-lineno"> 561</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L562"></a><tt class="py-lineno"> 562</tt>  <tt class="py-line"><tt class="py-docstring">        @param err: Exception error description.</tt> </tt>
<a name="L563"></a><tt class="py-lineno"> 563</tt>  <tt class="py-line"><tt class="py-docstring">        @type err: string</tt> </tt>
<a name="L564"></a><tt class="py-lineno"> 564</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L565"></a><tt class="py-lineno"> 565</tt>  <tt class="py-line">        <tt id="link-126" class="py-name"><a title="pyinotify.PyinotifyError" class="py-name" href="#" onclick="return doclink('link-126', 'PyinotifyError', 'link-0');">PyinotifyError</a></tt><tt class="py-op">.</tt><tt id="link-127" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-127', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L566"></a><tt class="py-lineno"> 566</tt>  <tt class="py-line"> </tt>
<a name="_ProcessEvent"></a><div id="_ProcessEvent-def"><a name="L567"></a><tt class="py-lineno"> 567</tt>  <tt class="py-line"> </tt>
<a name="L568"></a><tt class="py-lineno"> 568</tt> <a class="py-toggle" href="#" id="_ProcessEvent-toggle" onclick="return toggle('_ProcessEvent');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify._ProcessEvent-class.html">_ProcessEvent</a><tt class="py-op">:</tt> </tt>
</div><div id="_ProcessEvent-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_ProcessEvent-expanded"><a name="L569"></a><tt class="py-lineno"> 569</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L570"></a><tt class="py-lineno"> 570</tt>  <tt class="py-line"><tt class="py-docstring">    Abstract processing event class.</tt> </tt>
<a name="L571"></a><tt class="py-lineno"> 571</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="_ProcessEvent.__call__"></a><div id="_ProcessEvent.__call__-def"><a name="L572"></a><tt class="py-lineno"> 572</tt> <a class="py-toggle" href="#" id="_ProcessEvent.__call__-toggle" onclick="return toggle('_ProcessEvent.__call__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._ProcessEvent-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_ProcessEvent.__call__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_ProcessEvent.__call__-expanded"><a name="L573"></a><tt class="py-lineno"> 573</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L574"></a><tt class="py-lineno"> 574</tt>  <tt class="py-line"><tt class="py-docstring">        To behave like a functor the object must be callable.</tt> </tt>
<a name="L575"></a><tt class="py-lineno"> 575</tt>  <tt class="py-line"><tt class="py-docstring">        This method is a dispatch method. Lookup order:</tt> </tt>
<a name="L576"></a><tt class="py-lineno"> 576</tt>  <tt class="py-line"><tt class="py-docstring">          1. process_MASKNAME method</tt> </tt>
<a name="L577"></a><tt class="py-lineno"> 577</tt>  <tt class="py-line"><tt class="py-docstring">          2. process_FAMILY_NAME method</tt> </tt>
<a name="L578"></a><tt class="py-lineno"> 578</tt>  <tt class="py-line"><tt class="py-docstring">          3. otherwise call process_default</tt> </tt>
<a name="L579"></a><tt class="py-lineno"> 579</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L580"></a><tt class="py-lineno"> 580</tt>  <tt class="py-line"><tt class="py-docstring">        @param event: Event to be processed.</tt> </tt>
<a name="L581"></a><tt class="py-lineno"> 581</tt>  <tt class="py-line"><tt class="py-docstring">        @type event: Event object</tt> </tt>
<a name="L582"></a><tt class="py-lineno"> 582</tt>  <tt class="py-line"><tt class="py-docstring">        @return: By convention when used from the ProcessEvent class:</tt> </tt>
<a name="L583"></a><tt class="py-lineno"> 583</tt>  <tt class="py-line"><tt class="py-docstring">                 - Returning False or None (default value) means keep on</tt> </tt>
<a name="L584"></a><tt class="py-lineno"> 584</tt>  <tt class="py-line"><tt class="py-docstring">                 executing next chained functors (see chain.py example).</tt> </tt>
<a name="L585"></a><tt class="py-lineno"> 585</tt>  <tt class="py-line"><tt class="py-docstring">                 - Returning True instead means do not execute next</tt> </tt>
<a name="L586"></a><tt class="py-lineno"> 586</tt>  <tt class="py-line"><tt class="py-docstring">                   processing functions.</tt> </tt>
<a name="L587"></a><tt class="py-lineno"> 587</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: bool</tt> </tt>
<a name="L588"></a><tt class="py-lineno"> 588</tt>  <tt class="py-line"><tt class="py-docstring">        @raise ProcessEventError: Event object undispatchable,</tt> </tt>
<a name="L589"></a><tt class="py-lineno"> 589</tt>  <tt class="py-line"><tt class="py-docstring">                                  unknown event.</tt> </tt>
<a name="L590"></a><tt class="py-lineno"> 590</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L591"></a><tt class="py-lineno"> 591</tt>  <tt class="py-line">        <tt class="py-name">stripped_mask</tt> <tt class="py-op">=</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt> <tt class="py-op">&amp;</tt> <tt id="link-128" class="py-name"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-128', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></tt><tt class="py-op">)</tt> </tt>
<a name="L592"></a><tt class="py-lineno"> 592</tt>  <tt class="py-line">        <tt id="link-129" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-129', 'maskname', 'link-61');">maskname</a></tt> <tt class="py-op">=</tt> <tt id="link-130" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-130', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-131" class="py-name"><a title="pyinotify.EventsCodes.ALL_VALUES" class="py-name" href="#" onclick="return doclink('link-131', 'ALL_VALUES', 'link-60');">ALL_VALUES</a></tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">stripped_mask</tt><tt class="py-op">)</tt> </tt>
<a name="L593"></a><tt class="py-lineno"> 593</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-132" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-132', 'maskname', 'link-61');">maskname</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L594"></a><tt class="py-lineno"> 594</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-133" class="py-name" targets="Class pyinotify.ProcessEventError=pyinotify.ProcessEventError-class.html"><a title="pyinotify.ProcessEventError" class="py-name" href="#" onclick="return doclink('link-133', 'ProcessEventError', 'link-133');">ProcessEventError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Unknown mask 0x%08x"</tt> <tt class="py-op">%</tt> <tt class="py-name">stripped_mask</tt><tt class="py-op">)</tt> </tt>
<a name="L595"></a><tt class="py-lineno"> 595</tt>  <tt class="py-line"> </tt>
<a name="L596"></a><tt class="py-lineno"> 596</tt>  <tt class="py-line">        <tt class="py-comment"># 1- look for process_MASKNAME</tt> </tt>
<a name="L597"></a><tt class="py-lineno"> 597</tt>  <tt class="py-line">        <tt class="py-name">meth</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-string">'process_'</tt> <tt class="py-op">+</tt> <tt id="link-134" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-134', 'maskname', 'link-61');">maskname</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L598"></a><tt class="py-lineno"> 598</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">meth</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="L599"></a><tt class="py-lineno"> 599</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">meth</tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
<a name="L600"></a><tt class="py-lineno"> 600</tt>  <tt class="py-line">        <tt class="py-comment"># 2- look for process_FAMILY_NAME</tt> </tt>
<a name="L601"></a><tt class="py-lineno"> 601</tt>  <tt class="py-line">        <tt class="py-name">meth</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-string">'process_IN_'</tt> <tt class="py-op">+</tt> <tt id="link-135" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-135', 'maskname', 'link-61');">maskname</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'_'</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-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L602"></a><tt class="py-lineno"> 602</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">meth</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="L603"></a><tt class="py-lineno"> 603</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">meth</tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
<a name="L604"></a><tt class="py-lineno"> 604</tt>  <tt class="py-line">        <tt class="py-comment"># 3- default call method process_default</tt> </tt>
<a name="L605"></a><tt class="py-lineno"> 605</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-136" class="py-name" targets="Method pyinotify.ChainIfTrue.process_default()=pyinotify.ChainIfTrue-class.html#process_default,Method pyinotify.ProcessEvent.process_default()=pyinotify.ProcessEvent-class.html#process_default,Method pyinotify.Stats.process_default()=pyinotify.Stats-class.html#process_default,Method pyinotify._SysProcessEvent.process_default()=pyinotify._SysProcessEvent-class.html#process_default"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-136', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
</div><a name="L606"></a><tt class="py-lineno"> 606</tt>  <tt class="py-line"> </tt>
<a name="_ProcessEvent.__repr__"></a><div id="_ProcessEvent.__repr__-def"><a name="L607"></a><tt class="py-lineno"> 607</tt> <a class="py-toggle" href="#" id="_ProcessEvent.__repr__-toggle" onclick="return toggle('_ProcessEvent.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._ProcessEvent-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="_ProcessEvent.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_ProcessEvent.__repr__-expanded"><a name="L608"></a><tt class="py-lineno"> 608</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'&lt;%s&gt;'</tt> <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt> </tt>
</div></div><a name="L609"></a><tt class="py-lineno"> 609</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent"></a><div id="_SysProcessEvent-def"><a name="L610"></a><tt class="py-lineno"> 610</tt>  <tt class="py-line"> </tt>
<a name="L611"></a><tt class="py-lineno"> 611</tt> <a class="py-toggle" href="#" id="_SysProcessEvent-toggle" onclick="return toggle('_SysProcessEvent');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html">_SysProcessEvent</a><tt class="py-op">(</tt><tt class="py-base-class">_ProcessEvent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_SysProcessEvent-expanded"><a name="L612"></a><tt class="py-lineno"> 612</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L613"></a><tt class="py-lineno"> 613</tt>  <tt class="py-line"><tt class="py-docstring">    There is three kind of processing according to each event:</tt> </tt>
<a name="L614"></a><tt class="py-lineno"> 614</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L615"></a><tt class="py-lineno"> 615</tt>  <tt class="py-line"><tt class="py-docstring">      1. special handling (deletion from internal container, bug, ...).</tt> </tt>
<a name="L616"></a><tt class="py-lineno"> 616</tt>  <tt class="py-line"><tt class="py-docstring">      2. default treatment: which is applied to most of events.</tt> </tt>
<a name="L617"></a><tt class="py-lineno"> 617</tt>  <tt class="py-line"><tt class="py-docstring">      4. IN_ISDIR is never sent alone, he is piggybacked with a standart</tt> </tt>
<a name="L618"></a><tt class="py-lineno"> 618</tt>  <tt class="py-line"><tt class="py-docstring">         event, he is not processed as the others events, instead, its</tt> </tt>
<a name="L619"></a><tt class="py-lineno"> 619</tt>  <tt class="py-line"><tt class="py-docstring">         value is captured and appropriately aggregated to dst event.</tt> </tt>
<a name="L620"></a><tt class="py-lineno"> 620</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="_SysProcessEvent.__init__"></a><div id="_SysProcessEvent.__init__-def"><a name="L621"></a><tt class="py-lineno"> 621</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.__init__-toggle" onclick="return toggle('_SysProcessEvent.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-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">wm</tt><tt class="py-op">,</tt> <tt class="py-param">notifier</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.__init__-expanded"><a name="L622"></a><tt class="py-lineno"> 622</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L623"></a><tt class="py-lineno"> 623</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L624"></a><tt class="py-lineno"> 624</tt>  <tt class="py-line"><tt class="py-docstring">        @param wm: Watch Manager.</tt> </tt>
<a name="L625"></a><tt class="py-lineno"> 625</tt>  <tt class="py-line"><tt class="py-docstring">        @type wm: WatchManager instance</tt> </tt>
<a name="L626"></a><tt class="py-lineno"> 626</tt>  <tt class="py-line"><tt class="py-docstring">        @param notifier: notifier.</tt> </tt>
<a name="L627"></a><tt class="py-lineno"> 627</tt>  <tt class="py-line"><tt class="py-docstring">        @type notifier: Instance of Notifier.</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-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt> <tt class="py-op">=</tt> <tt class="py-name">wm</tt>  <tt class="py-comment"># watch manager</tt> </tt>
<a name="L630"></a><tt class="py-lineno"> 630</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_notifier</tt> <tt class="py-op">=</tt> <tt class="py-name">notifier</tt>  <tt class="py-comment"># notifier</tt> </tt>
<a name="L631"></a><tt class="py-lineno"> 631</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv_cookie</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># {cookie(int): (src_path(str), date), ...}</tt> </tt>
<a name="L632"></a><tt class="py-lineno"> 632</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># {src_path(str): (dst_path(str), date), ...}</tt> </tt>
</div><a name="L633"></a><tt class="py-lineno"> 633</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.cleanup"></a><div id="_SysProcessEvent.cleanup-def"><a name="L634"></a><tt class="py-lineno"> 634</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.cleanup-toggle" onclick="return toggle('_SysProcessEvent.cleanup');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#cleanup">cleanup</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="_SysProcessEvent.cleanup-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.cleanup-expanded"><a name="L635"></a><tt class="py-lineno"> 635</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L636"></a><tt class="py-lineno"> 636</tt>  <tt class="py-line"><tt class="py-docstring">        Cleanup (delete) old (&gt;1mn) records contained in self._mv_cookie</tt> </tt>
<a name="L637"></a><tt class="py-lineno"> 637</tt>  <tt class="py-line"><tt class="py-docstring">        and self._mv.</tt> </tt>
<a name="L638"></a><tt class="py-lineno"> 638</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L639"></a><tt class="py-lineno"> 639</tt>  <tt class="py-line">        <tt class="py-name">date_cur_</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L640"></a><tt class="py-lineno"> 640</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">seq</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv_cookie</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L641"></a><tt class="py-lineno"> 641</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-name">seq</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="L642"></a><tt class="py-lineno"> 642</tt>  <tt class="py-line">               <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">date_cur_</tt> <tt class="py-op">-</tt> <tt class="py-name">seq</tt><tt class="py-op">[</tt><tt class="py-name">k</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-op">&gt;</tt> <tt class="py-name">timedelta</tt><tt class="py-op">(</tt><tt class="py-name">minutes</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="L643"></a><tt class="py-lineno"> 643</tt>  <tt class="py-line">                   <tt id="link-137" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-137', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'cleanup: deleting entry %s'</tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">[</tt><tt class="py-name">k</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L644"></a><tt class="py-lineno"> 644</tt>  <tt class="py-line">                   <tt class="py-keyword">del</tt> <tt class="py-name">seq</tt><tt class="py-op">[</tt><tt class="py-name">k</tt><tt class="py-op">]</tt> </tt>
</div><a name="L645"></a><tt class="py-lineno"> 645</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_CREATE"></a><div id="_SysProcessEvent.process_IN_CREATE-def"><a name="L646"></a><tt class="py-lineno"> 646</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_CREATE-toggle" onclick="return toggle('_SysProcessEvent.process_IN_CREATE');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_CREATE">process_IN_CREATE</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_CREATE-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_CREATE-expanded"><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-docstring">        If the event concerns a directory and the auto_add flag of the</tt> </tt>
<a name="L649"></a><tt class="py-lineno"> 649</tt>  <tt class="py-line"><tt class="py-docstring">        targetted watch is set to True, a new watch is added on this</tt> </tt>
<a name="L650"></a><tt class="py-lineno"> 650</tt>  <tt class="py-line"><tt class="py-docstring">        new directory, with the same attributes's values than those of</tt> </tt>
<a name="L651"></a><tt class="py-lineno"> 651</tt>  <tt class="py-line"><tt class="py-docstring">        this watch.</tt> </tt>
<a name="L652"></a><tt class="py-lineno"> 652</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L653"></a><tt class="py-lineno"> 653</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt> <tt class="py-op">&amp;</tt> <tt id="link-138" class="py-name"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-138', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></tt><tt class="py-op">:</tt> </tt>
<a name="L654"></a><tt class="py-lineno"> 654</tt>  <tt class="py-line">            <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L655"></a><tt class="py-lineno"> 655</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">auto_add</tt><tt class="py-op">:</tt> </tt>
<a name="L656"></a><tt class="py-lineno"> 656</tt>  <tt class="py-line">                <tt class="py-name">addw</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt id="link-139" class="py-name" targets="Method pyinotify.WatchManager.add_watch()=pyinotify.WatchManager-class.html#add_watch"><a title="pyinotify.WatchManager.add_watch" class="py-name" href="#" onclick="return doclink('link-139', 'add_watch', 'link-139');">add_watch</a></tt> </tt>
<a name="L657"></a><tt class="py-lineno"> 657</tt>  <tt class="py-line">                <tt class="py-name">newwd</tt> <tt class="py-op">=</tt> <tt class="py-name">addw</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">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt id="link-140" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-140', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L658"></a><tt class="py-lineno"> 658</tt>  <tt class="py-line">                             <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">,</tt> <tt id="link-141" class="py-name" targets="Method pyinotify.Notifier.proc_fun()=pyinotify.Notifier-class.html#proc_fun"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-141', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">=</tt><tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-142', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">,</tt> </tt>
<a name="L659"></a><tt class="py-lineno"> 659</tt>  <tt class="py-line">                             <tt class="py-name">rec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">auto_add</tt><tt class="py-op">)</tt> </tt>
<a name="L660"></a><tt class="py-lineno"> 660</tt>  <tt class="py-line"> </tt>
<a name="L661"></a><tt class="py-lineno"> 661</tt>  <tt class="py-line">                <tt class="py-comment"># Trick to handle mkdir -p /t1/t2/t3 where t1 is watched and</tt> </tt>
<a name="L662"></a><tt class="py-lineno"> 662</tt>  <tt class="py-line">                <tt class="py-comment"># t2 and t3 are created.</tt> </tt>
<a name="L663"></a><tt class="py-lineno"> 663</tt>  <tt class="py-line">                <tt class="py-comment"># Since the directory is new, then everything inside it</tt> </tt>
<a name="L664"></a><tt class="py-lineno"> 664</tt>  <tt class="py-line">                <tt class="py-comment"># must also be new.</tt> </tt>
<a name="L665"></a><tt class="py-lineno"> 665</tt>  <tt class="py-line">                <tt class="py-name">base</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">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt id="link-143" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-143', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt> </tt>
<a name="L666"></a><tt class="py-lineno"> 666</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">newwd</tt><tt class="py-op">[</tt><tt class="py-name">base</tt><tt class="py-op">]</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L667"></a><tt class="py-lineno"> 667</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt id="link-144" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-144', 'name', 'link-17');">name</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">listdir</tt><tt class="py-op">(</tt><tt class="py-name">base</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L668"></a><tt class="py-lineno"> 668</tt>  <tt class="py-line">                        <tt class="py-name">inner</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">base</tt><tt class="py-op">,</tt> <tt id="link-145" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-145', 'name', 'link-17');">name</a></tt><tt class="py-op">)</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-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">isdir</tt><tt class="py-op">(</tt><tt class="py-name">inner</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> </tt>
<a name="L670"></a><tt class="py-lineno"> 670</tt>  <tt class="py-line">                            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt id="link-146" class="py-name" targets="Method pyinotify.WatchManager.get_wd()=pyinotify.WatchManager-class.html#get_wd"><a title="pyinotify.WatchManager.get_wd" class="py-name" href="#" onclick="return doclink('link-146', 'get_wd', 'link-146');">get_wd</a></tt><tt class="py-op">(</tt><tt class="py-name">inner</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L671"></a><tt class="py-lineno"> 671</tt>  <tt class="py-line">                            <tt class="py-comment"># Generate (simulate) creation event for sub</tt> </tt>
<a name="L672"></a><tt class="py-lineno"> 672</tt>  <tt class="py-line">                            <tt class="py-comment"># directories.</tt> </tt>
<a name="L673"></a><tt class="py-lineno"> 673</tt>  <tt class="py-line">                            <tt class="py-name">rawevent</tt> <tt class="py-op">=</tt> <tt id="link-147" class="py-name"><a title="pyinotify._RawEvent" class="py-name" href="#" onclick="return doclink('link-147', '_RawEvent', 'link-113');">_RawEvent</a></tt><tt class="py-op">(</tt><tt class="py-name">newwd</tt><tt class="py-op">[</tt><tt class="py-name">base</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L674"></a><tt class="py-lineno"> 674</tt>  <tt class="py-line">                                                 <tt id="link-148" class="py-name" targets="Variable pyinotify.IN_CREATE=pyinotify-module.html#IN_CREATE"><a title="pyinotify.IN_CREATE" class="py-name" href="#" onclick="return doclink('link-148', 'IN_CREATE', 'link-148');">IN_CREATE</a></tt> <tt class="py-op">|</tt> <tt id="link-149" class="py-name"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-149', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></tt><tt class="py-op">,</tt> </tt>
<a name="L675"></a><tt class="py-lineno"> 675</tt>  <tt class="py-line">                                                 <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt id="link-150" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-150', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt> </tt>
<a name="L676"></a><tt class="py-lineno"> 676</tt>  <tt class="py-line">                            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_notifier</tt><tt class="py-op">.</tt><tt class="py-name">_eventq</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">rawevent</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">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-151" class="py-name"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-151', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">)</tt> </tt>
</div><a name="L678"></a><tt class="py-lineno"> 678</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_MOVED_FROM"></a><div id="_SysProcessEvent.process_IN_MOVED_FROM-def"><a name="L679"></a><tt class="py-lineno"> 679</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_MOVED_FROM-toggle" onclick="return toggle('_SysProcessEvent.process_IN_MOVED_FROM');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_MOVED_FROM">process_IN_MOVED_FROM</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_MOVED_FROM-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_MOVED_FROM-expanded"><a name="L680"></a><tt class="py-lineno"> 680</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L681"></a><tt class="py-lineno"> 681</tt>  <tt class="py-line"><tt class="py-docstring">        Map the cookie with the source path (+ date for cleaning).</tt> </tt>
<a name="L682"></a><tt class="py-lineno"> 682</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L683"></a><tt class="py-lineno"> 683</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L684"></a><tt class="py-lineno"> 684</tt>  <tt class="py-line">        <tt class="py-name">path_</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> </tt>
<a name="L685"></a><tt class="py-lineno"> 685</tt>  <tt class="py-line">        <tt class="py-name">src_path</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">normpath</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">path_</tt><tt class="py-op">,</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt id="link-152" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-152', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L686"></a><tt class="py-lineno"> 686</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv_cookie</tt><tt class="py-op">[</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">cookie</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">src_path</tt><tt class="py-op">,</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</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 id="link-153" class="py-name"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-153', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-string">'cookie'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">cookie</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
</div><a name="L688"></a><tt class="py-lineno"> 688</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_MOVED_TO"></a><div id="_SysProcessEvent.process_IN_MOVED_TO-def"><a name="L689"></a><tt class="py-lineno"> 689</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_MOVED_TO-toggle" onclick="return toggle('_SysProcessEvent.process_IN_MOVED_TO');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_MOVED_TO">process_IN_MOVED_TO</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_MOVED_TO-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_MOVED_TO-expanded"><a name="L690"></a><tt class="py-lineno"> 690</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L691"></a><tt class="py-lineno"> 691</tt>  <tt class="py-line"><tt class="py-docstring">        Map the source path with the destination path (+ date for</tt> </tt>
<a name="L692"></a><tt class="py-lineno"> 692</tt>  <tt class="py-line"><tt class="py-docstring">        cleaning).</tt> </tt>
<a name="L693"></a><tt class="py-lineno"> 693</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L694"></a><tt class="py-lineno"> 694</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L695"></a><tt class="py-lineno"> 695</tt>  <tt class="py-line">        <tt class="py-name">path_</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> </tt>
<a name="L696"></a><tt class="py-lineno"> 696</tt>  <tt class="py-line">        <tt class="py-name">dst_path</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">normpath</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">path_</tt><tt class="py-op">,</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt id="link-154" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-154', 'name', 'link-17');">name</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L697"></a><tt class="py-lineno"> 697</tt>  <tt class="py-line">        <tt class="py-name">mv_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv_cookie</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">cookie</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">if</tt> <tt class="py-name">mv_</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">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv</tt><tt class="py-op">[</tt><tt class="py-name">mv_</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-op">(</tt><tt class="py-name">dst_path</tt><tt class="py-op">,</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L700"></a><tt class="py-lineno"> 700</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-155" class="py-name"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-155', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-string">'cookie'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">cookie</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
</div><a name="L701"></a><tt class="py-lineno"> 701</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_MOVE_SELF"></a><div id="_SysProcessEvent.process_IN_MOVE_SELF-def"><a name="L702"></a><tt class="py-lineno"> 702</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_MOVE_SELF-toggle" onclick="return toggle('_SysProcessEvent.process_IN_MOVE_SELF');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_MOVE_SELF">process_IN_MOVE_SELF</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_MOVE_SELF-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_MOVE_SELF-expanded"><a name="L703"></a><tt class="py-lineno"> 703</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L704"></a><tt class="py-lineno"> 704</tt>  <tt class="py-line"><tt class="py-docstring">        STATUS: the following bug has been fixed in the recent kernels (fixme:</tt> </tt>
<a name="L705"></a><tt class="py-lineno"> 705</tt>  <tt class="py-line"><tt class="py-docstring">        which version ?). Now it raises IN_DELETE_SELF instead.</tt> </tt>
<a name="L706"></a><tt class="py-lineno"> 706</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L707"></a><tt class="py-lineno"> 707</tt>  <tt class="py-line"><tt class="py-docstring">        Old kernels are bugged, this event is raised when the watched item</tt> </tt>
<a name="L708"></a><tt class="py-lineno"> 708</tt>  <tt class="py-line"><tt class="py-docstring">        was moved, so we must update its path, but under some circumstances it</tt> </tt>
<a name="L709"></a><tt class="py-lineno"> 709</tt>  <tt class="py-line"><tt class="py-docstring">        can be impossible: if its parent directory and its destination</tt> </tt>
<a name="L710"></a><tt class="py-lineno"> 710</tt>  <tt class="py-line"><tt class="py-docstring">        directory aren't watched. The kernel (see include/linux/fsnotify.h)</tt> </tt>
<a name="L711"></a><tt class="py-lineno"> 711</tt>  <tt class="py-line"><tt class="py-docstring">        doesn't bring us enough informations like the destination path of</tt> </tt>
<a name="L712"></a><tt class="py-lineno"> 712</tt>  <tt class="py-line"><tt class="py-docstring">        moved items.</tt> </tt>
<a name="L713"></a><tt class="py-lineno"> 713</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L714"></a><tt class="py-lineno"> 714</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L715"></a><tt class="py-lineno"> 715</tt>  <tt class="py-line">        <tt class="py-name">src_path</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> </tt>
<a name="L716"></a><tt class="py-lineno"> 716</tt>  <tt class="py-line">        <tt class="py-name">mv_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_mv</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">src_path</tt><tt class="py-op">)</tt> </tt>
<a name="L717"></a><tt class="py-lineno"> 717</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">mv_</tt><tt class="py-op">:</tt> </tt>
<a name="L718"></a><tt class="py-lineno"> 718</tt>  <tt class="py-line">            <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-name">mv_</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L719"></a><tt class="py-lineno"> 719</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L720"></a><tt class="py-lineno"> 720</tt>  <tt class="py-line">            <tt id="link-156" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-156', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">"The pathname '%s' of this watch %s has probably changed "</tt> </tt>
<a name="L721"></a><tt class="py-lineno"> 721</tt>  <tt class="py-line">                      <tt class="py-string">"and couldn't be updated, so it cannot be trusted "</tt> </tt>
<a name="L722"></a><tt class="py-lineno"> 722</tt>  <tt class="py-line">                      <tt class="py-string">"anymore. To fix this error move directories/files only "</tt> </tt>
<a name="L723"></a><tt class="py-lineno"> 723</tt>  <tt class="py-line">                      <tt class="py-string">"between watched parents directories, in this case eg. "</tt> </tt>
<a name="L724"></a><tt class="py-lineno"> 724</tt>  <tt class="py-line">                      <tt class="py-string">"put a watch on '%s'."</tt><tt class="py-op">,</tt> </tt>
<a name="L725"></a><tt class="py-lineno"> 725</tt>  <tt class="py-line">                      <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">watch_</tt><tt class="py-op">,</tt> </tt>
<a name="L726"></a><tt class="py-lineno"> 726</tt>  <tt class="py-line">                      <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">normpath</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">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> </tt>
<a name="L727"></a><tt class="py-lineno"> 727</tt>  <tt class="py-line">                                                    <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">pardir</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L728"></a><tt class="py-lineno"> 728</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">endswith</tt><tt class="py-op">(</tt><tt class="py-string">'-unknown-path'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L729"></a><tt class="py-lineno"> 729</tt>  <tt class="py-line">                <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> <tt class="py-op">+=</tt> <tt class="py-string">'-unknown-path'</tt> </tt>
<a name="L730"></a><tt class="py-lineno"> 730</tt>  <tt class="py-line">        <tt class="py-comment"># FIXME: should we pass the cookie even if this is not standard?</tt> </tt>
<a name="L731"></a><tt class="py-lineno"> 731</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-157" class="py-name"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-157', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">)</tt> </tt>
</div><a name="L732"></a><tt class="py-lineno"> 732</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_Q_OVERFLOW"></a><div id="_SysProcessEvent.process_IN_Q_OVERFLOW-def"><a name="L733"></a><tt class="py-lineno"> 733</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_Q_OVERFLOW-toggle" onclick="return toggle('_SysProcessEvent.process_IN_Q_OVERFLOW');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_Q_OVERFLOW">process_IN_Q_OVERFLOW</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_Q_OVERFLOW-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_Q_OVERFLOW-expanded"><a name="L734"></a><tt class="py-lineno"> 734</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L735"></a><tt class="py-lineno"> 735</tt>  <tt class="py-line"><tt class="py-docstring">        Only signal overflow, most of the common flags are irrelevant</tt> </tt>
<a name="L736"></a><tt class="py-lineno"> 736</tt>  <tt class="py-line"><tt class="py-docstring">        for this event (path, wd, name).</tt> </tt>
<a name="L737"></a><tt class="py-lineno"> 737</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L738"></a><tt class="py-lineno"> 738</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-158" class="py-name" targets="Class pyinotify.Event=pyinotify.Event-class.html"><a title="pyinotify.Event" class="py-name" href="#" onclick="return doclink('link-158', 'Event', 'link-158');">Event</a></tt><tt class="py-op">(</tt><tt class="py-op">{</tt><tt class="py-string">'mask'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
</div><a name="L739"></a><tt class="py-lineno"> 739</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_IN_IGNORED"></a><div id="_SysProcessEvent.process_IN_IGNORED-def"><a name="L740"></a><tt class="py-lineno"> 740</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_IN_IGNORED-toggle" onclick="return toggle('_SysProcessEvent.process_IN_IGNORED');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_IN_IGNORED">process_IN_IGNORED</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_IN_IGNORED-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_IN_IGNORED-expanded"><a name="L741"></a><tt class="py-lineno"> 741</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L742"></a><tt class="py-lineno"> 742</tt>  <tt class="py-line"><tt class="py-docstring">        The watch descriptor raised by this event is now ignored (forever),</tt> </tt>
<a name="L743"></a><tt class="py-lineno"> 743</tt>  <tt class="py-line"><tt class="py-docstring">        it can be safely deleted from watch manager dictionary.</tt> </tt>
<a name="L744"></a><tt class="py-lineno"> 744</tt>  <tt class="py-line"><tt class="py-docstring">        After this event we can be sure that neither the event queue</tt> </tt>
<a name="L745"></a><tt class="py-lineno"> 745</tt>  <tt class="py-line"><tt class="py-docstring">        neither the system will raise an event associated to this wd.</tt> </tt>
<a name="L746"></a><tt class="py-lineno"> 746</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L747"></a><tt class="py-lineno"> 747</tt>  <tt class="py-line">        <tt class="py-name">event_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-159" class="py-name"><a title="pyinotify.ChainIfTrue.process_default
pyinotify.ProcessEvent.process_default
pyinotify.Stats.process_default
pyinotify._SysProcessEvent.process_default" class="py-name" href="#" onclick="return doclink('link-159', 'process_default', 'link-136');">process_default</a></tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">)</tt> </tt>
<a name="L748"></a><tt class="py-lineno"> 748</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L749"></a><tt class="py-lineno"> 749</tt>  <tt class="py-line">            <tt class="py-keyword">del</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">[</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">]</tt> </tt>
<a name="L750"></a><tt class="py-lineno"> 750</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">,</tt> <tt class="py-name">err</tt><tt class="py-op">:</tt> </tt>
<a name="L751"></a><tt class="py-lineno"> 751</tt>  <tt class="py-line">            <tt id="link-160" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-160', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L752"></a><tt class="py-lineno"> 752</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">event_</tt> </tt>
</div><a name="L753"></a><tt class="py-lineno"> 753</tt>  <tt class="py-line"> </tt>
<a name="_SysProcessEvent.process_default"></a><div id="_SysProcessEvent.process_default-def"><a name="L754"></a><tt class="py-lineno"> 754</tt> <a class="py-toggle" href="#" id="_SysProcessEvent.process_default-toggle" onclick="return toggle('_SysProcessEvent.process_default');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify._SysProcessEvent-class.html#process_default">process_default</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">raw_event</tt><tt class="py-op">,</tt> <tt class="py-param">to_append</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_SysProcessEvent.process_default-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_SysProcessEvent.process_default-expanded"><a name="L755"></a><tt class="py-lineno"> 755</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L756"></a><tt class="py-lineno"> 756</tt>  <tt class="py-line"><tt class="py-docstring">        Common handling for the following events:</tt> </tt>
<a name="L757"></a><tt class="py-lineno"> 757</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L758"></a><tt class="py-lineno"> 758</tt>  <tt class="py-line"><tt class="py-docstring">        IN_ACCESS, IN_MODIFY, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE,</tt> </tt>
<a name="L759"></a><tt class="py-lineno"> 759</tt>  <tt class="py-line"><tt class="py-docstring">        IN_OPEN, IN_DELETE, IN_DELETE_SELF, IN_UNMOUNT.</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">ret</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L762"></a><tt class="py-lineno"> 762</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</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">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt> <tt class="py-op">&amp;</tt> <tt class="py-op">(</tt><tt id="link-161" class="py-name" targets="Variable pyinotify.IN_DELETE_SELF=pyinotify-module.html#IN_DELETE_SELF"><a title="pyinotify.IN_DELETE_SELF" class="py-name" href="#" onclick="return doclink('link-161', 'IN_DELETE_SELF', 'link-161');">IN_DELETE_SELF</a></tt> <tt class="py-op">|</tt> <tt id="link-162" class="py-name" targets="Variable pyinotify.IN_MOVE_SELF=pyinotify-module.html#IN_MOVE_SELF"><a title="pyinotify.IN_MOVE_SELF" class="py-name" href="#" onclick="return doclink('link-162', 'IN_MOVE_SELF', 'link-162');">IN_MOVE_SELF</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L764"></a><tt class="py-lineno"> 764</tt>  <tt class="py-line">            <tt class="py-comment"># Unfornulately this information is not provided by the kernel</tt> </tt>
<a name="L765"></a><tt class="py-lineno"> 765</tt>  <tt class="py-line">            <tt class="py-name">dir_</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">dir</tt> </tt>
<a name="L766"></a><tt class="py-lineno"> 766</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L767"></a><tt class="py-lineno"> 767</tt>  <tt class="py-line">            <tt class="py-name">dir_</tt> <tt class="py-op">=</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt> <tt class="py-op">&amp;</tt> <tt id="link-163" class="py-name"><a title="pyinotify.IN_ISDIR" class="py-name" href="#" onclick="return doclink('link-163', 'IN_ISDIR', 'link-55');">IN_ISDIR</a></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">dict_</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'wd'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">,</tt> </tt>
<a name="L769"></a><tt class="py-lineno"> 769</tt>  <tt class="py-line">                 <tt class="py-string">'mask'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">,</tt> </tt>
<a name="L770"></a><tt class="py-lineno"> 770</tt>  <tt class="py-line">                 <tt class="py-string">'path'</tt><tt class="py-op">:</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> </tt>
<a name="L771"></a><tt class="py-lineno"> 771</tt>  <tt class="py-line">                 <tt class="py-string">'name'</tt><tt class="py-op">:</tt> <tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt id="link-164" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-164', 'name', 'link-17');">name</a></tt><tt class="py-op">,</tt> </tt>
<a name="L772"></a><tt class="py-lineno"> 772</tt>  <tt class="py-line">                 <tt class="py-string">'dir'</tt><tt class="py-op">:</tt> <tt class="py-name">dir_</tt><tt class="py-op">}</tt> </tt>
<a name="L773"></a><tt class="py-lineno"> 773</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-165" class="py-name"><a title="pyinotify.COMPATIBILITY_MODE" class="py-name" href="#" onclick="return doclink('link-165', 'COMPATIBILITY_MODE', 'link-6');">COMPATIBILITY_MODE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L774"></a><tt class="py-lineno"> 774</tt>  <tt class="py-line">            <tt class="py-name">dict_</tt><tt class="py-op">[</tt><tt class="py-string">'is_dir'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">dir_</tt> </tt>
<a name="L775"></a><tt class="py-lineno"> 775</tt>  <tt class="py-line">        <tt class="py-name">dict_</tt><tt class="py-op">.</tt><tt class="py-name">update</tt><tt class="py-op">(</tt><tt class="py-name">to_append</tt><tt class="py-op">)</tt> </tt>
<a name="L776"></a><tt class="py-lineno"> 776</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-166" class="py-name"><a title="pyinotify.Event" class="py-name" href="#" onclick="return doclink('link-166', 'Event', 'link-158');">Event</a></tt><tt class="py-op">(</tt><tt class="py-name">dict_</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L777"></a><tt class="py-lineno"> 777</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent"></a><div id="ProcessEvent-def"><a name="L778"></a><tt class="py-lineno"> 778</tt>  <tt class="py-line"> </tt>
<a name="L779"></a><tt class="py-lineno"> 779</tt> <a class="py-toggle" href="#" id="ProcessEvent-toggle" onclick="return toggle('ProcessEvent');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-class.html">ProcessEvent</a><tt class="py-op">(</tt><tt class="py-base-class">_ProcessEvent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEvent-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ProcessEvent-expanded"><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">    Process events objects, can be specialized via subclassing, thus its</tt> </tt>
<a name="L782"></a><tt class="py-lineno"> 782</tt>  <tt class="py-line"><tt class="py-docstring">    behavior can be overriden:</tt> </tt>
<a name="L783"></a><tt class="py-lineno"> 783</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L784"></a><tt class="py-lineno"> 784</tt>  <tt class="py-line"><tt class="py-docstring">    Note: you should not override __init__ in your subclass instead define</tt> </tt>
<a name="L785"></a><tt class="py-lineno"> 785</tt>  <tt class="py-line"><tt class="py-docstring">    a my_init() method, this method will be called from the constructor of</tt> </tt>
<a name="L786"></a><tt class="py-lineno"> 786</tt>  <tt class="py-line"><tt class="py-docstring">    this class with optional parameters.</tt> </tt>
<a name="L787"></a><tt class="py-lineno"> 787</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L788"></a><tt class="py-lineno"> 788</tt>  <tt class="py-line"><tt class="py-docstring">      1. Provide methods, e.g. process_IN_DELETE for processing a given kind</tt> </tt>
<a name="L789"></a><tt class="py-lineno"> 789</tt>  <tt class="py-line"><tt class="py-docstring">         of event (eg. IN_DELETE in this case).</tt> </tt>
<a name="L790"></a><tt class="py-lineno"> 790</tt>  <tt class="py-line"><tt class="py-docstring">      2. Or/and provide methods for processing events by 'family', e.g.</tt> </tt>
<a name="L791"></a><tt class="py-lineno"> 791</tt>  <tt class="py-line"><tt class="py-docstring">         process_IN_CLOSE method will process both IN_CLOSE_WRITE and</tt> </tt>
<a name="L792"></a><tt class="py-lineno"> 792</tt>  <tt class="py-line"><tt class="py-docstring">         IN_CLOSE_NOWRITE events (if process_IN_CLOSE_WRITE and</tt> </tt>
<a name="L793"></a><tt class="py-lineno"> 793</tt>  <tt class="py-line"><tt class="py-docstring">         process_IN_CLOSE_NOWRITE aren't defined).</tt> </tt>
<a name="L794"></a><tt class="py-lineno"> 794</tt>  <tt class="py-line"><tt class="py-docstring">      3. Or/and override process_default for processing the remaining kind of</tt> </tt>
<a name="L795"></a><tt class="py-lineno"> 795</tt>  <tt class="py-line"><tt class="py-docstring">         events.</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 id="link-167" class="py-name" targets="Variable pyinotify.ProcessEvent.pevent=pyinotify.ProcessEvent-class.html#pevent"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-167', 'pevent', 'link-167');">pevent</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L798"></a><tt class="py-lineno"> 798</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent.__init__"></a><div id="ProcessEvent.__init__-def"><a name="L799"></a><tt class="py-lineno"> 799</tt> <a class="py-toggle" href="#" id="ProcessEvent.__init__-toggle" onclick="return toggle('ProcessEvent.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-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">pevent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEvent.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEvent.__init__-expanded"><a name="L800"></a><tt class="py-lineno"> 800</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L801"></a><tt class="py-lineno"> 801</tt>  <tt class="py-line"><tt class="py-docstring">        Enable chaining of ProcessEvent instances.</tt> </tt>
<a name="L802"></a><tt class="py-lineno"> 802</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L803"></a><tt class="py-lineno"> 803</tt>  <tt class="py-line"><tt class="py-docstring">        @param pevent: optional callable object, will be called on event</tt> </tt>
<a name="L804"></a><tt class="py-lineno"> 804</tt>  <tt class="py-line"><tt class="py-docstring">                       processing (before self).</tt> </tt>
<a name="L805"></a><tt class="py-lineno"> 805</tt>  <tt class="py-line"><tt class="py-docstring">        @type pevent: callable</tt> </tt>
<a name="L806"></a><tt class="py-lineno"> 806</tt>  <tt class="py-line"><tt class="py-docstring">        @param kargs: optional arguments delagated to template method my_init</tt> </tt>
<a name="L807"></a><tt class="py-lineno"> 807</tt>  <tt class="py-line"><tt class="py-docstring">        @type kargs: dict</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-name">self</tt><tt class="py-op">.</tt><tt id="link-168" class="py-name"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-168', 'pevent', 'link-167');">pevent</a></tt> <tt class="py-op">=</tt> <tt id="link-169" class="py-name"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-169', 'pevent', 'link-167');">pevent</a></tt> </tt>
<a name="L810"></a><tt class="py-lineno"> 810</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-170" class="py-name" targets="Method pyinotify.ChainIfTrue.my_init()=pyinotify.ChainIfTrue-class.html#my_init,Method pyinotify.ProcessEvent.my_init()=pyinotify.ProcessEvent-class.html#my_init,Method pyinotify.Stats.my_init()=pyinotify.Stats-class.html#my_init"><a title="pyinotify.ChainIfTrue.my_init
pyinotify.ProcessEvent.my_init
pyinotify.Stats.my_init" class="py-name" href="#" onclick="return doclink('link-170', 'my_init', 'link-170');">my_init</a></tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt class="py-name">kargs</tt><tt class="py-op">)</tt> </tt>
</div><a name="L811"></a><tt class="py-lineno"> 811</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent.my_init"></a><div id="ProcessEvent.my_init-def"><a name="L812"></a><tt class="py-lineno"> 812</tt> <a class="py-toggle" href="#" id="ProcessEvent.my_init-toggle" onclick="return toggle('ProcessEvent.my_init');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-class.html#my_init">my_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-param">kargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEvent.my_init-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEvent.my_init-expanded"><a name="L813"></a><tt class="py-lineno"> 813</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L814"></a><tt class="py-lineno"> 814</tt>  <tt class="py-line"><tt class="py-docstring">        Override this method when subclassing if you want to achieve</tt> </tt>
<a name="L815"></a><tt class="py-lineno"> 815</tt>  <tt class="py-line"><tt class="py-docstring">        custom initialization of your subclass' instance. You MUST pass</tt> </tt>
<a name="L816"></a><tt class="py-lineno"> 816</tt>  <tt class="py-line"><tt class="py-docstring">        keyword arguments. This method does nothing by default.</tt> </tt>
<a name="L817"></a><tt class="py-lineno"> 817</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L818"></a><tt class="py-lineno"> 818</tt>  <tt class="py-line"><tt class="py-docstring">        @param kargs: optional arguments delagated to template method my_init</tt> </tt>
<a name="L819"></a><tt class="py-lineno"> 819</tt>  <tt class="py-line"><tt class="py-docstring">        @type kargs: dict</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-keyword">pass</tt> </tt>
</div><a name="L822"></a><tt class="py-lineno"> 822</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent.__call__"></a><div id="ProcessEvent.__call__-def"><a name="L823"></a><tt class="py-lineno"> 823</tt> <a class="py-toggle" href="#" id="ProcessEvent.__call__-toggle" onclick="return toggle('ProcessEvent.__call__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEvent.__call__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEvent.__call__-expanded"><a name="L824"></a><tt class="py-lineno"> 824</tt>  <tt class="py-line">        <tt class="py-name">stop_chaining</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L825"></a><tt class="py-lineno"> 825</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-171" class="py-name"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-171', 'pevent', 'link-167');">pevent</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="L826"></a><tt class="py-lineno"> 826</tt>  <tt class="py-line">            <tt class="py-comment"># By default methods return None so we fix as guideline</tt> </tt>
<a name="L827"></a><tt class="py-lineno"> 827</tt>  <tt class="py-line">            <tt class="py-comment"># that methods asking for stop chaining must explicitely</tt> </tt>
<a name="L828"></a><tt class="py-lineno"> 828</tt>  <tt class="py-line">            <tt class="py-comment"># return non None or False values, otherwise the default</tt> </tt>
<a name="L829"></a><tt class="py-lineno"> 829</tt>  <tt class="py-line">            <tt class="py-comment"># behavior is to chain call to the corresponding local</tt> </tt>
<a name="L830"></a><tt class="py-lineno"> 830</tt>  <tt class="py-line">            <tt class="py-comment"># method.</tt> </tt>
<a name="L831"></a><tt class="py-lineno"> 831</tt>  <tt class="py-line">            <tt class="py-name">stop_chaining</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-172" class="py-name"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-172', 'pevent', 'link-167');">pevent</a></tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
<a name="L832"></a><tt class="py-lineno"> 832</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">stop_chaining</tt><tt class="py-op">:</tt> </tt>
<a name="L833"></a><tt class="py-lineno"> 833</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-173" class="py-name" targets="Class pyinotify._ProcessEvent=pyinotify._ProcessEvent-class.html"><a title="pyinotify._ProcessEvent" class="py-name" href="#" onclick="return doclink('link-173', '_ProcessEvent', 'link-173');">_ProcessEvent</a></tt><tt class="py-op">.</tt><tt id="link-174" class="py-name" targets="Method pyinotify.ExcludeFilter.__call__()=pyinotify.ExcludeFilter-class.html#__call__,Method pyinotify.ProcessEvent.__call__()=pyinotify.ProcessEvent-class.html#__call__,Method pyinotify._ProcessEvent.__call__()=pyinotify._ProcessEvent-class.html#__call__"><a title="pyinotify.ExcludeFilter.__call__
pyinotify.ProcessEvent.__call__
pyinotify._ProcessEvent.__call__" class="py-name" href="#" onclick="return doclink('link-174', '__call__', 'link-174');">__call__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
</div><a name="L834"></a><tt class="py-lineno"> 834</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent.nested_pevent"></a><div id="ProcessEvent.nested_pevent-def"><a name="L835"></a><tt class="py-lineno"> 835</tt> <a class="py-toggle" href="#" id="ProcessEvent.nested_pevent-toggle" onclick="return toggle('ProcessEvent.nested_pevent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-class.html#nested_pevent">nested_pevent</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="ProcessEvent.nested_pevent-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEvent.nested_pevent-expanded"><a name="L836"></a><tt class="py-lineno"> 836</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-175" class="py-name"><a title="pyinotify.ProcessEvent.pevent" class="py-name" href="#" onclick="return doclink('link-175', 'pevent', 'link-167');">pevent</a></tt> </tt>
</div><a name="L837"></a><tt class="py-lineno"> 837</tt>  <tt class="py-line"> </tt>
<a name="ProcessEvent.process_default"></a><div id="ProcessEvent.process_default-def"><a name="L838"></a><tt class="py-lineno"> 838</tt> <a class="py-toggle" href="#" id="ProcessEvent.process_default-toggle" onclick="return toggle('ProcessEvent.process_default');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ProcessEvent-class.html#process_default">process_default</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ProcessEvent.process_default-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ProcessEvent.process_default-expanded"><a name="L839"></a><tt class="py-lineno"> 839</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L840"></a><tt class="py-lineno"> 840</tt>  <tt class="py-line"><tt class="py-docstring">        Default default processing event method. Print event</tt> </tt>
<a name="L841"></a><tt class="py-lineno"> 841</tt>  <tt class="py-line"><tt class="py-docstring">        on standart output.</tt> </tt>
<a name="L842"></a><tt class="py-lineno"> 842</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L843"></a><tt class="py-lineno"> 843</tt>  <tt class="py-line"><tt class="py-docstring">        @param event: Event to be processed.</tt> </tt>
<a name="L844"></a><tt class="py-lineno"> 844</tt>  <tt class="py-line"><tt class="py-docstring">        @type event: Event instance</tt> </tt>
<a name="L845"></a><tt class="py-lineno"> 845</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L846"></a><tt class="py-lineno"> 846</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L847"></a><tt class="py-lineno"> 847</tt>  <tt class="py-line"> </tt>
<a name="ChainIfTrue"></a><div id="ChainIfTrue-def"><a name="L848"></a><tt class="py-lineno"> 848</tt>  <tt class="py-line"> </tt>
<a name="L849"></a><tt class="py-lineno"> 849</tt> <a class="py-toggle" href="#" id="ChainIfTrue-toggle" onclick="return toggle('ChainIfTrue');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.ChainIfTrue-class.html">ChainIfTrue</a><tt class="py-op">(</tt><tt class="py-base-class">ProcessEvent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ChainIfTrue-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ChainIfTrue-expanded"><a name="L850"></a><tt class="py-lineno"> 850</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L851"></a><tt class="py-lineno"> 851</tt>  <tt class="py-line"><tt class="py-docstring">    Makes conditional chaining depending on the result of the nested</tt> </tt>
<a name="L852"></a><tt class="py-lineno"> 852</tt>  <tt class="py-line"><tt class="py-docstring">    processing instance.</tt> </tt>
<a name="L853"></a><tt class="py-lineno"> 853</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="ChainIfTrue.my_init"></a><div id="ChainIfTrue.my_init-def"><a name="L854"></a><tt class="py-lineno"> 854</tt> <a class="py-toggle" href="#" id="ChainIfTrue.my_init-toggle" onclick="return toggle('ChainIfTrue.my_init');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ChainIfTrue-class.html#my_init">my_init</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">func</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ChainIfTrue.my_init-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ChainIfTrue.my_init-expanded"><a name="L855"></a><tt class="py-lineno"> 855</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_func</tt> <tt class="py-op">=</tt> <tt class="py-name">func</tt> </tt>
</div><a name="L856"></a><tt class="py-lineno"> 856</tt>  <tt class="py-line"> </tt>
<a name="ChainIfTrue.process_default"></a><div id="ChainIfTrue.process_default-def"><a name="L857"></a><tt class="py-lineno"> 857</tt> <a class="py-toggle" href="#" id="ChainIfTrue.process_default-toggle" onclick="return toggle('ChainIfTrue.process_default');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ChainIfTrue-class.html#process_default">process_default</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ChainIfTrue.process_default-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ChainIfTrue.process_default-expanded"><a name="L858"></a><tt class="py-lineno"> 858</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_func</tt><tt class="py-op">(</tt><tt class="py-name">event</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L859"></a><tt class="py-lineno"> 859</tt>  <tt class="py-line"> </tt>
<a name="Stats"></a><div id="Stats-def"><a name="L860"></a><tt class="py-lineno"> 860</tt>  <tt class="py-line"> </tt>
<a name="L861"></a><tt class="py-lineno"> 861</tt> <a class="py-toggle" href="#" id="Stats-toggle" onclick="return toggle('Stats');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.Stats-class.html">Stats</a><tt class="py-op">(</tt><tt class="py-base-class">ProcessEvent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Stats-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Stats-expanded"><a name="Stats.my_init"></a><div id="Stats.my_init-def"><a name="L862"></a><tt class="py-lineno"> 862</tt> <a class="py-toggle" href="#" id="Stats.my_init-toggle" onclick="return toggle('Stats.my_init');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-class.html#my_init">my_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="Stats.my_init-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats.my_init-expanded"><a name="L863"></a><tt class="py-lineno"> 863</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_start_time</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>
<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">_stats</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-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats_lock</tt> <tt class="py-op">=</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">Lock</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L866"></a><tt class="py-lineno"> 866</tt>  <tt class="py-line"> </tt>
<a name="Stats.process_default"></a><div id="Stats.process_default-def"><a name="L867"></a><tt class="py-lineno"> 867</tt> <a class="py-toggle" href="#" id="Stats.process_default-toggle" onclick="return toggle('Stats.process_default');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-class.html#process_default">process_default</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Stats.process_default-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats.process_default-expanded"><a name="L868"></a><tt class="py-lineno"> 868</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats_lock</tt><tt class="py-op">.</tt><tt class="py-name">acquire</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L869"></a><tt class="py-lineno"> 869</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L870"></a><tt class="py-lineno"> 870</tt>  <tt class="py-line">            <tt class="py-name">events</tt> <tt class="py-op">=</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt id="link-176" class="py-name"><a title="pyinotify.EventsCodes.maskname" class="py-name" href="#" onclick="return doclink('link-176', 'maskname', 'link-61');">maskname</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'|'</tt><tt class="py-op">)</tt> </tt>
<a name="L871"></a><tt class="py-lineno"> 871</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">event_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">events</tt><tt class="py-op">:</tt> </tt>
<a name="L872"></a><tt class="py-lineno"> 872</tt>  <tt class="py-line">                <tt class="py-name">count</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">event_name</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L873"></a><tt class="py-lineno"> 873</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats</tt><tt class="py-op">[</tt><tt class="py-name">event_name</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">count</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
<a name="L874"></a><tt class="py-lineno"> 874</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L875"></a><tt class="py-lineno"> 875</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats_lock</tt><tt class="py-op">.</tt><tt class="py-name">release</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L876"></a><tt class="py-lineno"> 876</tt>  <tt class="py-line"> </tt>
<a name="Stats._stats_copy"></a><div id="Stats._stats_copy-def"><a name="L877"></a><tt class="py-lineno"> 877</tt> <a class="py-toggle" href="#" id="Stats._stats_copy-toggle" onclick="return toggle('Stats._stats_copy');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-class.html#_stats_copy">_stats_copy</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="Stats._stats_copy-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats._stats_copy-expanded"><a name="L878"></a><tt class="py-lineno"> 878</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats_lock</tt><tt class="py-op">.</tt><tt class="py-name">acquire</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L879"></a><tt class="py-lineno"> 879</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L880"></a><tt class="py-lineno"> 880</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">_stats</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="L881"></a><tt class="py-lineno"> 881</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L882"></a><tt class="py-lineno"> 882</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stats_lock</tt><tt class="py-op">.</tt><tt class="py-name">release</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L883"></a><tt class="py-lineno"> 883</tt>  <tt class="py-line"> </tt>
<a name="Stats.__repr__"></a><div id="Stats.__repr__-def"><a name="L884"></a><tt class="py-lineno"> 884</tt> <a class="py-toggle" href="#" id="Stats.__repr__-toggle" onclick="return toggle('Stats.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-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="Stats.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats.__repr__-expanded"><a name="L885"></a><tt class="py-lineno"> 885</tt>  <tt class="py-line">        <tt class="py-name">stats</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-177" class="py-name" targets="Method pyinotify.Stats._stats_copy()=pyinotify.Stats-class.html#_stats_copy"><a title="pyinotify.Stats._stats_copy" class="py-name" href="#" onclick="return doclink('link-177', '_stats_copy', 'link-177');">_stats_copy</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L886"></a><tt class="py-lineno"> 886</tt>  <tt class="py-line"> </tt>
<a name="L887"></a><tt class="py-lineno"> 887</tt>  <tt class="py-line">        <tt class="py-name">t</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 class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_start_time</tt><tt class="py-op">)</tt> </tt>
<a name="L888"></a><tt class="py-lineno"> 888</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">t</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">60</tt><tt class="py-op">:</tt> </tt>
<a name="L889"></a><tt class="py-lineno"> 889</tt>  <tt class="py-line">            <tt class="py-name">ts</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">t</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'sec'</tt> </tt>
<a name="L890"></a><tt class="py-lineno"> 890</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-number">60</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">t</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">3600</tt><tt class="py-op">:</tt> </tt>
<a name="L891"></a><tt class="py-lineno"> 891</tt>  <tt class="py-line">            <tt class="py-name">ts</tt> <tt class="py-op">=</tt> <tt class="py-string">'%dmn%dsec'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">t</tt> <tt class="py-op">/</tt> <tt class="py-number">60</tt><tt class="py-op">,</tt> <tt class="py-name">t</tt> <tt class="py-op">%</tt> <tt class="py-number">60</tt><tt class="py-op">)</tt> </tt>
<a name="L892"></a><tt class="py-lineno"> 892</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-number">3600</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">t</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">86400</tt><tt class="py-op">:</tt> </tt>
<a name="L893"></a><tt class="py-lineno"> 893</tt>  <tt class="py-line">            <tt class="py-name">ts</tt> <tt class="py-op">=</tt> <tt class="py-string">'%dh%dmn'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">t</tt> <tt class="py-op">/</tt> <tt class="py-number">3600</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">t</tt> <tt class="py-op">%</tt> <tt class="py-number">3600</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-number">60</tt><tt class="py-op">)</tt> </tt>
<a name="L894"></a><tt class="py-lineno"> 894</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">t</tt> <tt class="py-op">&gt;=</tt> <tt class="py-number">86400</tt><tt class="py-op">:</tt> </tt>
<a name="L895"></a><tt class="py-lineno"> 895</tt>  <tt class="py-line">            <tt class="py-name">ts</tt> <tt class="py-op">=</tt> <tt class="py-string">'%dd%dh'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">t</tt> <tt class="py-op">/</tt> <tt class="py-number">86400</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">t</tt> <tt class="py-op">%</tt> <tt class="py-number">86400</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-number">3600</tt><tt class="py-op">)</tt> </tt>
<a name="L896"></a><tt class="py-lineno"> 896</tt>  <tt class="py-line">        <tt class="py-name">stats</tt><tt class="py-op">[</tt><tt class="py-string">'ElapsedTime'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">ts</tt> </tt>
<a name="L897"></a><tt class="py-lineno"> 897</tt>  <tt class="py-line"> </tt>
<a name="L898"></a><tt class="py-lineno"> 898</tt>  <tt class="py-line">        <tt class="py-name">l</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L899"></a><tt class="py-lineno"> 899</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">ev</tt><tt class="py-op">,</tt> <tt id="link-178" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-178', 'value', 'link-33');">value</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">stats</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 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-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>
<a name="L900"></a><tt class="py-lineno"> 900</tt>  <tt class="py-line">            <tt class="py-name">l</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">' %s=%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-179" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-179', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-180" class="py-name"><a title="pyinotify.Color.FieldName" class="py-name" href="#" onclick="return doclink('link-180', 'FieldName', 'link-101');">FieldName</a></tt><tt class="py-op">(</tt><tt class="py-name">ev</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L901"></a><tt class="py-lineno"> 901</tt>  <tt class="py-line">                                 <tt id="link-181" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-181', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-182" class="py-name"><a title="pyinotify.Color.FieldValue" class="py-name" href="#" onclick="return doclink('link-182', 'FieldValue', 'link-105');">FieldValue</a></tt><tt class="py-op">(</tt><tt id="link-183" class="py-name"><a title="pyinotify.SysCtlINotify.value" class="py-name" href="#" onclick="return doclink('link-183', 'value', 'link-33');">value</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L902"></a><tt class="py-lineno"> 902</tt>  <tt class="py-line">        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">'&lt;%s%s &gt;'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-184" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-184', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-185" class="py-name"><a title="pyinotify.Color.ClassName" class="py-name" href="#" onclick="return doclink('link-185', 'ClassName', 'link-110');">ClassName</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L903"></a><tt class="py-lineno"> 903</tt>  <tt class="py-line">                         <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">l</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L904"></a><tt class="py-lineno"> 904</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
</div><a name="L905"></a><tt class="py-lineno"> 905</tt>  <tt class="py-line"> </tt>
<a name="Stats.dump"></a><div id="Stats.dump-def"><a name="L906"></a><tt class="py-lineno"> 906</tt> <a class="py-toggle" href="#" id="Stats.dump-toggle" onclick="return toggle('Stats.dump');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-class.html#dump">dump</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Stats.dump-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats.dump-expanded"><a name="L907"></a><tt class="py-lineno"> 907</tt>  <tt class="py-line">        <tt class="py-name">fo</tt> <tt class="py-op">=</tt> <tt class="py-name">file</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt> <tt class="py-string">'wb'</tt><tt class="py-op">)</tt> </tt>
<a name="L908"></a><tt class="py-lineno"> 908</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L909"></a><tt class="py-lineno"> 909</tt>  <tt class="py-line">            <tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L910"></a><tt class="py-lineno"> 910</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L911"></a><tt class="py-lineno"> 911</tt>  <tt class="py-line">            <tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L912"></a><tt class="py-lineno"> 912</tt>  <tt class="py-line"> </tt>
<a name="Stats.__str__"></a><div id="Stats.__str__-def"><a name="L913"></a><tt class="py-lineno"> 913</tt> <a class="py-toggle" href="#" id="Stats.__str__-toggle" onclick="return toggle('Stats.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Stats-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">scale</tt><tt class="py-op">=</tt><tt class="py-number">45</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Stats.__str__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Stats.__str__-expanded"><a name="L914"></a><tt class="py-lineno"> 914</tt>  <tt class="py-line">        <tt class="py-name">stats</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-186" class="py-name"><a title="pyinotify.Stats._stats_copy" class="py-name" href="#" onclick="return doclink('link-186', '_stats_copy', 'link-177');">_stats_copy</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L915"></a><tt class="py-lineno"> 915</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">stats</tt><tt class="py-op">:</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">''</tt> </tt>
<a name="L917"></a><tt class="py-lineno"> 917</tt>  <tt class="py-line"> </tt>
<a name="L918"></a><tt class="py-lineno"> 918</tt>  <tt class="py-line">        <tt class="py-name">m</tt> <tt class="py-op">=</tt> <tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-name">stats</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="L919"></a><tt class="py-lineno"> 919</tt>  <tt class="py-line">        <tt class="py-name">unity</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">round</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-name">scale</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-number">1</tt> </tt>
<a name="L920"></a><tt class="py-lineno"> 920</tt>  <tt class="py-line">        <tt class="py-name">fmt</tt> <tt class="py-op">=</tt> <tt class="py-string">'%%-26s%%-%ds%%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-187" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-187', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-188" class="py-name"><a title="pyinotify.Color.FieldValue" class="py-name" href="#" onclick="return doclink('link-188', 'FieldValue', 'link-105');">FieldValue</a></tt><tt class="py-op">(</tt><tt class="py-string">'@'</tt> <tt class="py-op">*</tt> <tt class="py-name">scale</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L921"></a><tt class="py-lineno"> 921</tt>  <tt class="py-line">                                   <tt class="py-op">+</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L922"></a><tt class="py-lineno"> 922</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">func</tt><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L923"></a><tt class="py-lineno"> 923</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-op">(</tt><tt id="link-189" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-189', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-190" class="py-name"><a title="pyinotify.Color.FieldName" class="py-name" href="#" onclick="return doclink('link-190', 'FieldName', 'link-101');">FieldName</a></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>
<a name="L924"></a><tt class="py-lineno"> 924</tt>  <tt class="py-line">                          <tt id="link-191" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-191', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-192" class="py-name"><a title="pyinotify.Color.FieldValue" class="py-name" href="#" onclick="return doclink('link-192', 'FieldValue', 'link-105');">FieldValue</a></tt><tt class="py-op">(</tt><tt class="py-string">'@'</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">unity</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L925"></a><tt class="py-lineno"> 925</tt>  <tt class="py-line">                          <tt id="link-193" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-193', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-194" class="py-name" targets="Static Method pyinotify.Color.Simple()=pyinotify.Color-class.html#Simple"><a title="pyinotify.Color.Simple" class="py-name" href="#" onclick="return doclink('link-194', 'Simple', 'link-194');">Simple</a></tt><tt class="py-op">(</tt><tt class="py-string">'%d'</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-string">'yellow'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L926"></a><tt class="py-lineno"> 926</tt>  <tt class="py-line">        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">func</tt><tt class="py-op">,</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">stats</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 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-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-op">)</tt> </tt>
<a name="L927"></a><tt class="py-lineno"> 927</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
</div></div><a name="L928"></a><tt class="py-lineno"> 928</tt>  <tt class="py-line"> </tt>
<a name="NotifierError"></a><div id="NotifierError-def"><a name="L929"></a><tt class="py-lineno"> 929</tt>  <tt class="py-line"> </tt>
<a name="L930"></a><tt class="py-lineno"> 930</tt> <a class="py-toggle" href="#" id="NotifierError-toggle" onclick="return toggle('NotifierError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.NotifierError-class.html">NotifierError</a><tt class="py-op">(</tt><tt class="py-base-class">PyinotifyError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NotifierError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="NotifierError-expanded"><a name="L931"></a><tt class="py-lineno"> 931</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L932"></a><tt class="py-lineno"> 932</tt>  <tt class="py-line"><tt class="py-docstring">    Notifier Exception. Raised on Notifier error.</tt> </tt>
<a name="L933"></a><tt class="py-lineno"> 933</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L934"></a><tt class="py-lineno"> 934</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="NotifierError.__init__"></a><div id="NotifierError.__init__-def"><a name="L935"></a><tt class="py-lineno"> 935</tt> <a class="py-toggle" href="#" id="NotifierError.__init__-toggle" onclick="return toggle('NotifierError.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.NotifierError-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">err</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NotifierError.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="NotifierError.__init__-expanded"><a name="L936"></a><tt class="py-lineno"> 936</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L937"></a><tt class="py-lineno"> 937</tt>  <tt class="py-line"><tt class="py-docstring">        @param err: Exception string's description.</tt> </tt>
<a name="L938"></a><tt class="py-lineno"> 938</tt>  <tt class="py-line"><tt class="py-docstring">        @type err: string</tt> </tt>
<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 id="link-195" class="py-name"><a title="pyinotify.PyinotifyError" class="py-name" href="#" onclick="return doclink('link-195', 'PyinotifyError', 'link-0');">PyinotifyError</a></tt><tt class="py-op">.</tt><tt id="link-196" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-196', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L941"></a><tt class="py-lineno"> 941</tt>  <tt class="py-line"> </tt>
<a name="Notifier"></a><div id="Notifier-def"><a name="L942"></a><tt class="py-lineno"> 942</tt>  <tt class="py-line"> </tt>
<a name="L943"></a><tt class="py-lineno"> 943</tt> <a class="py-toggle" href="#" id="Notifier-toggle" onclick="return toggle('Notifier');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html">Notifier</a><tt class="py-op">:</tt> </tt>
</div><div id="Notifier-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Notifier-expanded"><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-docstring">    Read notifications, process events.</tt> </tt>
<a name="L946"></a><tt class="py-lineno"> 946</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L947"></a><tt class="py-lineno"> 947</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="Notifier.__init__"></a><div id="Notifier.__init__-def"><a name="L948"></a><tt class="py-lineno"> 948</tt> <a class="py-toggle" href="#" id="Notifier.__init__-toggle" onclick="return toggle('Notifier.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-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">watch_manager</tt><tt class="py-op">,</tt> <tt class="py-param">default_proc_fun</tt><tt class="py-op">=</tt><tt id="link-197" class="py-name" targets="Class pyinotify.ProcessEvent=pyinotify.ProcessEvent-class.html"><a title="pyinotify.ProcessEvent" class="py-name" href="#" onclick="return doclink('link-197', 'ProcessEvent', 'link-197');">ProcessEvent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L949"></a><tt class="py-lineno"> 949</tt>  <tt class="py-line">                 <tt class="py-param">read_freq</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">treshold</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</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="Notifier.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.__init__-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">        Initialization. read_freq, treshold and timeout parameters are used</tt> </tt>
<a name="L952"></a><tt class="py-lineno"> 952</tt>  <tt class="py-line"><tt class="py-docstring">        when looping.</tt> </tt>
<a name="L953"></a><tt class="py-lineno"> 953</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L954"></a><tt class="py-lineno"> 954</tt>  <tt class="py-line"><tt class="py-docstring">        @param watch_manager: Watch Manager.</tt> </tt>
<a name="L955"></a><tt class="py-lineno"> 955</tt>  <tt class="py-line"><tt class="py-docstring">        @type watch_manager: WatchManager instance</tt> </tt>
<a name="L956"></a><tt class="py-lineno"> 956</tt>  <tt class="py-line"><tt class="py-docstring">        @param default_proc_fun: Default processing method.</tt> </tt>
<a name="L957"></a><tt class="py-lineno"> 957</tt>  <tt class="py-line"><tt class="py-docstring">        @type default_proc_fun: instance of ProcessEvent</tt> </tt>
<a name="L958"></a><tt class="py-lineno"> 958</tt>  <tt class="py-line"><tt class="py-docstring">        @param read_freq: if read_freq == 0, events are read asap,</tt> </tt>
<a name="L959"></a><tt class="py-lineno"> 959</tt>  <tt class="py-line"><tt class="py-docstring">                          if read_freq is &gt; 0, this thread sleeps</tt> </tt>
<a name="L960"></a><tt class="py-lineno"> 960</tt>  <tt class="py-line"><tt class="py-docstring">                          max(0, read_freq - timeout) seconds. But if</tt> </tt>
<a name="L961"></a><tt class="py-lineno"> 961</tt>  <tt class="py-line"><tt class="py-docstring">                          timeout is None it can be different because</tt> </tt>
<a name="L962"></a><tt class="py-lineno"> 962</tt>  <tt class="py-line"><tt class="py-docstring">                          poll is blocking waiting for something to read.</tt> </tt>
<a name="L963"></a><tt class="py-lineno"> 963</tt>  <tt class="py-line"><tt class="py-docstring">        @type read_freq: int</tt> </tt>
<a name="L964"></a><tt class="py-lineno"> 964</tt>  <tt class="py-line"><tt class="py-docstring">        @param treshold: File descriptor will be read only if its size to</tt> </tt>
<a name="L965"></a><tt class="py-lineno"> 965</tt>  <tt class="py-line"><tt class="py-docstring">                         read is &gt;= treshold. If != 0, you likely want to</tt> </tt>
<a name="L966"></a><tt class="py-lineno"> 966</tt>  <tt class="py-line"><tt class="py-docstring">                         use it in combination with read_freq because</tt> </tt>
<a name="L967"></a><tt class="py-lineno"> 967</tt>  <tt class="py-line"><tt class="py-docstring">                         without that you keep looping without really reading</tt> </tt>
<a name="L968"></a><tt class="py-lineno"> 968</tt>  <tt class="py-line"><tt class="py-docstring">                         anything and that until the amount to read</tt> </tt>
<a name="L969"></a><tt class="py-lineno"> 969</tt>  <tt class="py-line"><tt class="py-docstring">                         is &gt;= treshold. At least with read_freq you may sleep.</tt> </tt>
<a name="L970"></a><tt class="py-lineno"> 970</tt>  <tt class="py-line"><tt class="py-docstring">        @type treshold: int</tt> </tt>
<a name="L971"></a><tt class="py-lineno"> 971</tt>  <tt class="py-line"><tt class="py-docstring">        @param timeout:</tt> </tt>
<a name="L972"></a><tt class="py-lineno"> 972</tt>  <tt class="py-line"><tt class="py-docstring">            http://docs.python.org/lib/poll-objects.html#poll-objects</tt> </tt>
<a name="L973"></a><tt class="py-lineno"> 973</tt>  <tt class="py-line"><tt class="py-docstring">        @type timeout: int</tt> </tt>
<a name="L974"></a><tt class="py-lineno"> 974</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L975"></a><tt class="py-lineno"> 975</tt>  <tt class="py-line">        <tt class="py-comment"># watch manager instance</tt> </tt>
<a name="L976"></a><tt class="py-lineno"> 976</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_manager</tt> </tt>
<a name="L977"></a><tt class="py-lineno"> 977</tt>  <tt class="py-line">        <tt class="py-comment"># file descriptor</tt> </tt>
<a name="L978"></a><tt class="py-lineno"> 978</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt> </tt>
<a name="L979"></a><tt class="py-lineno"> 979</tt>  <tt class="py-line">        <tt class="py-comment"># poll object and registration</tt> </tt>
<a name="L980"></a><tt class="py-lineno"> 980</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt> <tt class="py-op">=</tt> <tt class="py-name">select</tt><tt class="py-op">.</tt><tt class="py-name">poll</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L981"></a><tt class="py-lineno"> 981</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt><tt class="py-op">.</tt><tt class="py-name">register</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">select</tt><tt class="py-op">.</tt><tt class="py-name">POLLIN</tt><tt class="py-op">)</tt> </tt>
<a name="L982"></a><tt class="py-lineno"> 982</tt>  <tt class="py-line">        <tt class="py-comment"># This pipe is correctely initialized and used by ThreadedNotifier</tt> </tt>
<a name="L983"></a><tt class="py-lineno"> 983</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</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-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L984"></a><tt class="py-lineno"> 984</tt>  <tt class="py-line">        <tt class="py-comment"># event queue</tt> </tt>
<a name="L985"></a><tt class="py-lineno"> 985</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_eventq</tt> <tt class="py-op">=</tt> <tt class="py-name">deque</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L986"></a><tt class="py-lineno"> 986</tt>  <tt class="py-line">        <tt class="py-comment"># system processing functor, common to all events</tt> </tt>
<a name="L987"></a><tt class="py-lineno"> 987</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sys_proc_fun</tt> <tt class="py-op">=</tt> <tt id="link-198" class="py-name" targets="Class pyinotify._SysProcessEvent=pyinotify._SysProcessEvent-class.html"><a title="pyinotify._SysProcessEvent" class="py-name" href="#" onclick="return doclink('link-198', '_SysProcessEvent', 'link-198');">_SysProcessEvent</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L988"></a><tt class="py-lineno"> 988</tt>  <tt class="py-line">        <tt class="py-comment"># default processing method</tt> </tt>
<a name="L989"></a><tt class="py-lineno"> 989</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_default_proc_fun</tt> <tt class="py-op">=</tt> <tt class="py-name">default_proc_fun</tt> </tt>
<a name="L990"></a><tt class="py-lineno"> 990</tt>  <tt class="py-line">        <tt class="py-comment"># loop parameters</tt> </tt>
<a name="L991"></a><tt class="py-lineno"> 991</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_read_freq</tt> <tt class="py-op">=</tt> <tt class="py-name">read_freq</tt> </tt>
<a name="L992"></a><tt class="py-lineno"> 992</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_treshold</tt> <tt class="py-op">=</tt> <tt class="py-name">treshold</tt> </tt>
<a name="L993"></a><tt class="py-lineno"> 993</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_timeout</tt> <tt class="py-op">=</tt> <tt class="py-name">timeout</tt> </tt>
</div><a name="L994"></a><tt class="py-lineno"> 994</tt>  <tt class="py-line"> </tt>
<a name="Notifier.proc_fun"></a><div id="Notifier.proc_fun-def"><a name="L995"></a><tt class="py-lineno"> 995</tt> <a class="py-toggle" href="#" id="Notifier.proc_fun-toggle" onclick="return toggle('Notifier.proc_fun');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#proc_fun">proc_fun</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="Notifier.proc_fun-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.proc_fun-expanded"><a name="L996"></a><tt class="py-lineno"> 996</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">_default_proc_fun</tt> </tt>
</div><a name="L997"></a><tt class="py-lineno"> 997</tt>  <tt class="py-line"> </tt>
<a name="Notifier.check_events"></a><div id="Notifier.check_events-def"><a name="L998"></a><tt class="py-lineno"> 998</tt> <a class="py-toggle" href="#" id="Notifier.check_events-toggle" onclick="return toggle('Notifier.check_events');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#check_events">check_events</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="Notifier.check_events-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.check_events-expanded"><a name="L999"></a><tt class="py-lineno"> 999</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1000"></a><tt class="py-lineno">1000</tt>  <tt class="py-line"><tt class="py-docstring">        Check for new events available to read, blocks up to timeout</tt> </tt>
<a name="L1001"></a><tt class="py-lineno">1001</tt>  <tt class="py-line"><tt class="py-docstring">        milliseconds.</tt> </tt>
<a name="L1002"></a><tt class="py-lineno">1002</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1003"></a><tt class="py-lineno">1003</tt>  <tt class="py-line"><tt class="py-docstring">        @return: New events to read.</tt> </tt>
<a name="L1004"></a><tt class="py-lineno">1004</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: bool</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">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L1007"></a><tt class="py-lineno">1007</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1008"></a><tt class="py-lineno">1008</tt>  <tt class="py-line">                <tt class="py-comment"># blocks up to 'timeout' milliseconds</tt> </tt>
<a name="L1009"></a><tt class="py-lineno">1009</tt>  <tt class="py-line">                <tt class="py-name">ret</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt><tt class="py-op">.</tt><tt class="py-name">poll</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_timeout</tt><tt class="py-op">)</tt> </tt>
<a name="L1010"></a><tt class="py-lineno">1010</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">select</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">,</tt> <tt class="py-name">err</tt><tt class="py-op">:</tt> </tt>
<a name="L1011"></a><tt class="py-lineno">1011</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">err</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">errno</tt><tt class="py-op">.</tt><tt class="py-name">EINTR</tt><tt class="py-op">:</tt> </tt>
<a name="L1012"></a><tt class="py-lineno">1012</tt>  <tt class="py-line">                    <tt class="py-keyword">continue</tt> <tt class="py-comment"># interrupted, retry</tt> </tt>
<a name="L1013"></a><tt class="py-lineno">1013</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1014"></a><tt class="py-lineno">1014</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> </tt>
<a name="L1015"></a><tt class="py-lineno">1015</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1016"></a><tt class="py-lineno">1016</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
<a name="L1017"></a><tt class="py-lineno">1017</tt>  <tt class="py-line"> </tt>
<a name="L1018"></a><tt class="py-lineno">1018</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">ret</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</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">ret</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-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</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">False</tt> </tt>
<a name="L1020"></a><tt class="py-lineno">1020</tt>  <tt class="py-line">        <tt class="py-comment"># only one fd is polled</tt> </tt>
<a name="L1021"></a><tt class="py-lineno">1021</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret</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-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">&amp;</tt> <tt class="py-name">select</tt><tt class="py-op">.</tt><tt class="py-name">POLLIN</tt> </tt>
</div><a name="L1022"></a><tt class="py-lineno">1022</tt>  <tt class="py-line"> </tt>
<a name="Notifier.read_events"></a><div id="Notifier.read_events-def"><a name="L1023"></a><tt class="py-lineno">1023</tt> <a class="py-toggle" href="#" id="Notifier.read_events-toggle" onclick="return toggle('Notifier.read_events');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#read_events">read_events</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="Notifier.read_events-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.read_events-expanded"><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-docstring">        Read events from device, build _RawEvents, and enqueue them.</tt> </tt>
<a name="L1026"></a><tt class="py-lineno">1026</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1027"></a><tt class="py-lineno">1027</tt>  <tt class="py-line">        <tt class="py-name">buf_</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'i'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1028"></a><tt class="py-lineno">1028</tt>  <tt class="py-line">        <tt class="py-comment"># get event queue size</tt> </tt>
<a name="L1029"></a><tt class="py-lineno">1029</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">fcntl</tt><tt class="py-op">.</tt><tt class="py-name">ioctl</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">termios</tt><tt class="py-op">.</tt><tt class="py-name">FIONREAD</tt><tt class="py-op">,</tt> <tt class="py-name">buf_</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-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L1030"></a><tt class="py-lineno">1030</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L1031"></a><tt class="py-lineno">1031</tt>  <tt class="py-line">        <tt class="py-name">queue_size</tt> <tt class="py-op">=</tt> <tt class="py-name">buf_</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1032"></a><tt class="py-lineno">1032</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">queue_size</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_treshold</tt><tt class="py-op">:</tt> </tt>
<a name="L1033"></a><tt class="py-lineno">1033</tt>  <tt class="py-line">            <tt id="link-199" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-199', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'(fd: %d) %d bytes available to read but treshold is '</tt> </tt>
<a name="L1034"></a><tt class="py-lineno">1034</tt>  <tt class="py-line">                      <tt class="py-string">'fixed to %d bytes'</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">queue_size</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_treshold</tt><tt class="py-op">)</tt> </tt>
<a name="L1035"></a><tt class="py-lineno">1035</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L1036"></a><tt class="py-lineno">1036</tt>  <tt class="py-line"> </tt>
<a name="L1037"></a><tt class="py-lineno">1037</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1038"></a><tt class="py-lineno">1038</tt>  <tt class="py-line">            <tt class="py-comment"># read content from file</tt> </tt>
<a name="L1039"></a><tt class="py-lineno">1039</tt>  <tt class="py-line">            <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">queue_size</tt><tt class="py-op">)</tt> </tt>
<a name="L1040"></a><tt class="py-lineno">1040</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">msg</tt><tt class="py-op">:</tt> </tt>
<a name="L1041"></a><tt class="py-lineno">1041</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-200" class="py-name" targets="Class pyinotify.NotifierError=pyinotify.NotifierError-class.html"><a title="pyinotify.NotifierError" class="py-name" href="#" onclick="return doclink('link-200', 'NotifierError', 'link-200');">NotifierError</a></tt><tt class="py-op">(</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
<a name="L1042"></a><tt class="py-lineno">1042</tt>  <tt class="py-line">        <tt id="link-201" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-201', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'event queue size: %d'</tt><tt class="py-op">,</tt> <tt class="py-name">queue_size</tt><tt class="py-op">)</tt> </tt>
<a name="L1043"></a><tt class="py-lineno">1043</tt>  <tt class="py-line">        <tt class="py-name">rsum</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt>  <tt class="py-comment"># counter</tt> </tt>
<a name="L1044"></a><tt class="py-lineno">1044</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">rsum</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">queue_size</tt><tt class="py-op">:</tt> </tt>
<a name="L1045"></a><tt class="py-lineno">1045</tt>  <tt class="py-line">            <tt class="py-name">s_size</tt> <tt class="py-op">=</tt> <tt class="py-number">16</tt> </tt>
<a name="L1046"></a><tt class="py-lineno">1046</tt>  <tt class="py-line">            <tt class="py-comment"># retrieve wd, mask, cookie</tt> </tt>
<a name="L1047"></a><tt class="py-lineno">1047</tt>  <tt class="py-line">            <tt class="py-name">s_</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'iIII'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-name">rsum</tt><tt class="py-op">:</tt><tt class="py-name">rsum</tt><tt class="py-op">+</tt><tt class="py-name">s_size</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1048"></a><tt class="py-lineno">1048</tt>  <tt class="py-line">            <tt class="py-comment"># length of name</tt> </tt>
<a name="L1049"></a><tt class="py-lineno">1049</tt>  <tt class="py-line">            <tt class="py-name">fname_len</tt> <tt class="py-op">=</tt> <tt class="py-name">s_</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> </tt>
<a name="L1050"></a><tt class="py-lineno">1050</tt>  <tt class="py-line">            <tt class="py-comment"># field 'length' useless</tt> </tt>
<a name="L1051"></a><tt class="py-lineno">1051</tt>  <tt class="py-line">            <tt class="py-name">s_</tt> <tt class="py-op">=</tt> <tt class="py-name">s_</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>
<a name="L1052"></a><tt class="py-lineno">1052</tt>  <tt class="py-line">            <tt class="py-comment"># retrieve name</tt> </tt>
<a name="L1053"></a><tt class="py-lineno">1053</tt>  <tt class="py-line">            <tt class="py-name">s_</tt> <tt class="py-op">+=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'%ds'</tt> <tt class="py-op">%</tt> <tt class="py-name">fname_len</tt><tt class="py-op">,</tt> </tt>
<a name="L1054"></a><tt class="py-lineno">1054</tt>  <tt class="py-line">                                <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-name">rsum</tt> <tt class="py-op">+</tt> <tt class="py-name">s_size</tt><tt class="py-op">:</tt><tt class="py-name">rsum</tt> <tt class="py-op">+</tt> <tt class="py-name">s_size</tt> <tt class="py-op">+</tt> <tt class="py-name">fname_len</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1055"></a><tt class="py-lineno">1055</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_eventq</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt id="link-202" class="py-name"><a title="pyinotify._RawEvent" class="py-name" href="#" onclick="return doclink('link-202', '_RawEvent', 'link-113');">_RawEvent</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">s_</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1056"></a><tt class="py-lineno">1056</tt>  <tt class="py-line">            <tt class="py-name">rsum</tt> <tt class="py-op">+=</tt> <tt class="py-name">s_size</tt> <tt class="py-op">+</tt> <tt class="py-name">fname_len</tt> </tt>
</div><a name="L1057"></a><tt class="py-lineno">1057</tt>  <tt class="py-line"> </tt>
<a name="Notifier.process_events"></a><div id="Notifier.process_events-def"><a name="L1058"></a><tt class="py-lineno">1058</tt> <a class="py-toggle" href="#" id="Notifier.process_events-toggle" onclick="return toggle('Notifier.process_events');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#process_events">process_events</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="Notifier.process_events-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.process_events-expanded"><a name="L1059"></a><tt class="py-lineno">1059</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1060"></a><tt class="py-lineno">1060</tt>  <tt class="py-line"><tt class="py-docstring">        Routine for processing events from queue by calling their</tt> </tt>
<a name="L1061"></a><tt class="py-lineno">1061</tt>  <tt class="py-line"><tt class="py-docstring">        associated proccessing function (instance of ProcessEvent).</tt> </tt>
<a name="L1062"></a><tt class="py-lineno">1062</tt>  <tt class="py-line"><tt class="py-docstring">        It also do internal processings, to keep the system updated.</tt> </tt>
<a name="L1063"></a><tt class="py-lineno">1063</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1064"></a><tt class="py-lineno">1064</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_eventq</tt><tt class="py-op">:</tt> </tt>
<a name="L1065"></a><tt class="py-lineno">1065</tt>  <tt class="py-line">            <tt class="py-name">raw_event</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_eventq</tt><tt class="py-op">.</tt><tt class="py-name">popleft</tt><tt class="py-op">(</tt><tt class="py-op">)</tt>  <tt class="py-comment"># pop next event</tt> </tt>
<a name="L1066"></a><tt class="py-lineno">1066</tt>  <tt class="py-line">            <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_watch_manager</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">.</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L1067"></a><tt class="py-lineno">1067</tt>  <tt class="py-line">            <tt class="py-name">revent</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sys_proc_fun</tt><tt class="py-op">(</tt><tt class="py-name">raw_event</tt><tt class="py-op">)</tt>  <tt class="py-comment"># system processings</tt> </tt>
<a name="L1068"></a><tt class="py-lineno">1068</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">watch_</tt> <tt class="py-keyword">and</tt> <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt id="link-203" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-203', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1069"></a><tt class="py-lineno">1069</tt>  <tt class="py-line">                <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt id="link-204" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-204', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">(</tt><tt class="py-name">revent</tt><tt class="py-op">)</tt>  <tt class="py-comment"># user processings</tt> </tt>
<a name="L1070"></a><tt class="py-lineno">1070</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1071"></a><tt class="py-lineno">1071</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_default_proc_fun</tt><tt class="py-op">(</tt><tt class="py-name">revent</tt><tt class="py-op">)</tt> </tt>
<a name="L1072"></a><tt class="py-lineno">1072</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sys_proc_fun</tt><tt class="py-op">.</tt><tt id="link-205" class="py-name" targets="Method pyinotify._SysProcessEvent.cleanup()=pyinotify._SysProcessEvent-class.html#cleanup"><a title="pyinotify._SysProcessEvent.cleanup" class="py-name" href="#" onclick="return doclink('link-205', 'cleanup', 'link-205');">cleanup</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt>  <tt class="py-comment"># remove olds MOVED_* events records</tt> </tt>
</div><a name="L1073"></a><tt class="py-lineno">1073</tt>  <tt class="py-line"> </tt>
<a name="L1074"></a><tt class="py-lineno">1074</tt>  <tt class="py-line"> </tt>
<a name="Notifier.__daemonize"></a><div id="Notifier.__daemonize-def"><a name="L1075"></a><tt class="py-lineno">1075</tt> <a class="py-toggle" href="#" id="Notifier.__daemonize-toggle" onclick="return toggle('Notifier.__daemonize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#__daemonize">__daemonize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">pid_file</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">force_kill</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">stdin</tt><tt class="py-op">=</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">devnull</tt><tt class="py-op">,</tt> </tt>
<a name="L1076"></a><tt class="py-lineno">1076</tt>  <tt class="py-line">                    <tt class="py-param">stdout</tt><tt class="py-op">=</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">devnull</tt><tt class="py-op">,</tt> <tt class="py-param">stderr</tt><tt class="py-op">=</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">devnull</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Notifier.__daemonize-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.__daemonize-expanded"><a name="L1077"></a><tt class="py-lineno">1077</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1078"></a><tt class="py-lineno">1078</tt>  <tt class="py-line"><tt class="py-docstring">        pid_file: file to which pid will be written.</tt> </tt>
<a name="L1079"></a><tt class="py-lineno">1079</tt>  <tt class="py-line"><tt class="py-docstring">        force_kill: if True kill the process associated to pid_file.</tt> </tt>
<a name="L1080"></a><tt class="py-lineno">1080</tt>  <tt class="py-line"><tt class="py-docstring">        stdin, stdout, stderr: files associated to common streams.</tt> </tt>
<a name="L1081"></a><tt class="py-lineno">1081</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1082"></a><tt class="py-lineno">1082</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">pid_file</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1083"></a><tt class="py-lineno">1083</tt>  <tt class="py-line">            <tt class="py-name">dirname</tt> <tt class="py-op">=</tt> <tt class="py-string">'/var/run/'</tt> </tt>
<a name="L1084"></a><tt class="py-lineno">1084</tt>  <tt class="py-line">            <tt class="py-name">basename</tt> <tt class="py-op">=</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">argv</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">or</tt> <tt class="py-string">'pyinotify'</tt> </tt>
<a name="L1085"></a><tt class="py-lineno">1085</tt>  <tt class="py-line">            <tt class="py-name">pid_file</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">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">basename</tt> <tt class="py-op">+</tt> <tt class="py-string">'.pid'</tt><tt class="py-op">)</tt> </tt>
<a name="L1086"></a><tt class="py-lineno">1086</tt>  <tt class="py-line"> </tt>
<a name="L1087"></a><tt class="py-lineno">1087</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 class="py-name">pid_file</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1088"></a><tt class="py-lineno">1088</tt>  <tt class="py-line">            <tt class="py-name">fo</tt> <tt class="py-op">=</tt> <tt class="py-name">file</tt><tt class="py-op">(</tt><tt class="py-name">pid_file</tt><tt class="py-op">,</tt> <tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
<a name="L1089"></a><tt class="py-lineno">1089</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1090"></a><tt class="py-lineno">1090</tt>  <tt class="py-line">                <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1091"></a><tt class="py-lineno">1091</tt>  <tt class="py-line">                    <tt class="py-name">pid</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1092"></a><tt class="py-lineno">1092</tt>  <tt class="py-line">                <tt class="py-keyword">except</tt> <tt class="py-name">ValueError</tt><tt class="py-op">:</tt> </tt>
<a name="L1093"></a><tt class="py-lineno">1093</tt>  <tt class="py-line">                    <tt class="py-name">pid</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L1094"></a><tt class="py-lineno">1094</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">pid</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="L1095"></a><tt class="py-lineno">1095</tt>  <tt class="py-line">                    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1096"></a><tt class="py-lineno">1096</tt>  <tt class="py-line">                        <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">kill</tt><tt class="py-op">(</tt><tt class="py-name">pid</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1097"></a><tt class="py-lineno">1097</tt>  <tt class="py-line">                    <tt class="py-keyword">except</tt> <tt class="py-name">OSError</tt><tt class="py-op">,</tt> <tt class="py-name">err</tt><tt class="py-op">:</tt> </tt>
<a name="L1098"></a><tt class="py-lineno">1098</tt>  <tt class="py-line">                        <tt class="py-keyword">pass</tt> </tt>
<a name="L1099"></a><tt class="py-lineno">1099</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1100"></a><tt class="py-lineno">1100</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">force_kill</tt><tt class="py-op">:</tt> </tt>
<a name="L1101"></a><tt class="py-lineno">1101</tt>  <tt class="py-line">                            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">'There is already a pid file %s with pid %d'</tt> </tt>
<a name="L1102"></a><tt class="py-lineno">1102</tt>  <tt class="py-line">                            <tt class="py-keyword">raise</tt> <tt id="link-206" class="py-name"><a title="pyinotify.NotifierError" class="py-name" href="#" onclick="return doclink('link-206', 'NotifierError', 'link-200');">NotifierError</a></tt><tt class="py-op">(</tt><tt class="py-name">s</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">pid_file</tt><tt class="py-op">,</tt> <tt class="py-name">pid</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1103"></a><tt class="py-lineno">1103</tt>  <tt class="py-line">                        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1104"></a><tt class="py-lineno">1104</tt>  <tt class="py-line">                            <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">kill</tt><tt class="py-op">(</tt><tt class="py-name">pid</tt><tt class="py-op">,</tt> <tt class="py-number">9</tt><tt class="py-op">)</tt> </tt>
<a name="L1105"></a><tt class="py-lineno">1105</tt>  <tt class="py-line">            <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L1106"></a><tt class="py-lineno">1106</tt>  <tt class="py-line">                <tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1107"></a><tt class="py-lineno">1107</tt>  <tt class="py-line"> </tt>
<a name="L1108"></a><tt class="py-lineno">1108</tt>  <tt class="py-line"> </tt>
<a name="L1109"></a><tt class="py-lineno">1109</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">fork_daemon</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1110"></a><tt class="py-lineno">1110</tt>  <tt class="py-line">            <tt class="py-comment"># Adapted from Chad J. Schroeder's recipe</tt> </tt>
<a name="L1111"></a><tt class="py-lineno">1111</tt>  <tt class="py-line">            <tt class="py-name">pid</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">fork</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1112"></a><tt class="py-lineno">1112</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">pid</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1113"></a><tt class="py-lineno">1113</tt>  <tt class="py-line">                <tt class="py-comment"># parent 2</tt> </tt>
<a name="L1114"></a><tt class="py-lineno">1114</tt>  <tt class="py-line">                <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">setsid</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1115"></a><tt class="py-lineno">1115</tt>  <tt class="py-line">                <tt class="py-name">pid</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">fork</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1116"></a><tt class="py-lineno">1116</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">pid</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1117"></a><tt class="py-lineno">1117</tt>  <tt class="py-line">                    <tt class="py-comment"># child</tt> </tt>
<a name="L1118"></a><tt class="py-lineno">1118</tt>  <tt class="py-line">                    <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">chdir</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt> </tt>
<a name="L1119"></a><tt class="py-lineno">1119</tt>  <tt class="py-line">                    <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">umask</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1120"></a><tt class="py-lineno">1120</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1121"></a><tt class="py-lineno">1121</tt>  <tt class="py-line">                    <tt class="py-comment"># parent 2</tt> </tt>
<a name="L1122"></a><tt class="py-lineno">1122</tt>  <tt class="py-line">                    <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">_exit</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1123"></a><tt class="py-lineno">1123</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1124"></a><tt class="py-lineno">1124</tt>  <tt class="py-line">                <tt class="py-comment"># parent 1</tt> </tt>
<a name="L1125"></a><tt class="py-lineno">1125</tt>  <tt class="py-line">                <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">_exit</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1126"></a><tt class="py-lineno">1126</tt>  <tt class="py-line"> </tt>
<a name="L1127"></a><tt class="py-lineno">1127</tt>  <tt class="py-line">            <tt class="py-name">fd_inp</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">stdin</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_RDONLY</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">os</tt><tt class="py-op">.</tt><tt class="py-name">dup2</tt><tt class="py-op">(</tt><tt class="py-name">fd_inp</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1129"></a><tt class="py-lineno">1129</tt>  <tt class="py-line">            <tt class="py-name">fd_out</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">stdout</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_WRONLY</tt><tt class="py-op">|</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_CREAT</tt><tt class="py-op">)</tt> </tt>
<a name="L1130"></a><tt class="py-lineno">1130</tt>  <tt class="py-line">            <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">dup2</tt><tt class="py-op">(</tt><tt class="py-name">fd_out</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L1131"></a><tt class="py-lineno">1131</tt>  <tt class="py-line">            <tt class="py-name">fd_err</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">stderr</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_WRONLY</tt><tt class="py-op">|</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">O_CREAT</tt><tt class="py-op">)</tt> </tt>
<a name="L1132"></a><tt class="py-lineno">1132</tt>  <tt class="py-line">            <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">dup2</tt><tt class="py-op">(</tt><tt class="py-name">fd_err</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1133"></a><tt class="py-lineno">1133</tt>  <tt class="py-line"> </tt>
<a name="L1134"></a><tt class="py-lineno">1134</tt>  <tt class="py-line">        <tt class="py-comment"># Detach task</tt> </tt>
<a name="L1135"></a><tt class="py-lineno">1135</tt>  <tt class="py-line">        <tt class="py-name">fork_daemon</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1136"></a><tt class="py-lineno">1136</tt>  <tt class="py-line"> </tt>
<a name="L1137"></a><tt class="py-lineno">1137</tt>  <tt class="py-line">        <tt class="py-comment"># Write pid</tt> </tt>
<a name="L1138"></a><tt class="py-lineno">1138</tt>  <tt class="py-line">        <tt class="py-name">fo</tt> <tt class="py-op">=</tt> <tt class="py-name">file</tt><tt class="py-op">(</tt><tt class="py-name">pid_file</tt><tt class="py-op">,</tt> <tt class="py-string">'wb'</tt><tt class="py-op">)</tt> </tt>
<a name="L1139"></a><tt class="py-lineno">1139</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1140"></a><tt class="py-lineno">1140</tt>  <tt class="py-line">            <tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">getpid</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
<a name="L1141"></a><tt class="py-lineno">1141</tt>  <tt class="py-line">        <tt class="py-keyword">finally</tt><tt class="py-op">:</tt> </tt>
<a name="L1142"></a><tt class="py-lineno">1142</tt>  <tt class="py-line">            <tt class="py-name">fo</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1143"></a><tt class="py-lineno">1143</tt>  <tt class="py-line"> </tt>
<a name="L1144"></a><tt class="py-lineno">1144</tt>  <tt class="py-line">        <tt class="py-name">atexit</tt><tt class="py-op">.</tt><tt class="py-name">register</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-op">:</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">unlink</tt><tt class="py-op">(</tt><tt class="py-name">pid_file</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1145"></a><tt class="py-lineno">1145</tt>  <tt class="py-line"> </tt>
<a name="L1146"></a><tt class="py-lineno">1146</tt>  <tt class="py-line"> </tt>
<a name="Notifier._sleep"></a><div id="Notifier._sleep-def"><a name="L1147"></a><tt class="py-lineno">1147</tt> <a class="py-toggle" href="#" id="Notifier._sleep-toggle" onclick="return toggle('Notifier._sleep');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#_sleep">_sleep</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">ref_time</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Notifier._sleep-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier._sleep-expanded"><a name="L1148"></a><tt class="py-lineno">1148</tt>  <tt class="py-line">        <tt class="py-comment"># Only consider sleeping if read_freq is &gt; 0</tt> </tt>
<a name="L1149"></a><tt class="py-lineno">1149</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">_read_freq</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1150"></a><tt class="py-lineno">1150</tt>  <tt class="py-line">            <tt class="py-name">cur_time</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>
<a name="L1151"></a><tt class="py-lineno">1151</tt>  <tt class="py-line">            <tt class="py-name">sleep_amount</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_read_freq</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">cur_time</tt> <tt class="py-op">-</tt> <tt class="py-name">ref_time</tt><tt class="py-op">)</tt> </tt>
<a name="L1152"></a><tt class="py-lineno">1152</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">sleep_amount</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1153"></a><tt class="py-lineno">1153</tt>  <tt class="py-line">                <tt id="link-207" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-207', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'Now sleeping %d seconds'</tt><tt class="py-op">,</tt> <tt class="py-name">sleep_amount</tt><tt class="py-op">)</tt> </tt>
<a name="L1154"></a><tt class="py-lineno">1154</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">sleep_amount</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1155"></a><tt class="py-lineno">1155</tt>  <tt class="py-line"> </tt>
<a name="L1156"></a><tt class="py-lineno">1156</tt>  <tt class="py-line"> </tt>
<a name="Notifier.loop"></a><div id="Notifier.loop-def"><a name="L1157"></a><tt class="py-lineno">1157</tt> <a class="py-toggle" href="#" id="Notifier.loop-toggle" onclick="return toggle('Notifier.loop');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#loop">loop</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">callback</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">daemonize</tt><tt class="py-op">=</tt><tt class="py-name">False</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>
</div><div id="Notifier.loop-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.loop-expanded"><a name="L1158"></a><tt class="py-lineno">1158</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1159"></a><tt class="py-lineno">1159</tt>  <tt class="py-line"><tt class="py-docstring">        Events are read only once time every min(read_freq, timeout)</tt> </tt>
<a name="L1160"></a><tt class="py-lineno">1160</tt>  <tt class="py-line"><tt class="py-docstring">        seconds at best and only if the size to read is &gt;= treshold.</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">        @param callback: Functor called after each event processing. Expects</tt> </tt>
<a name="L1163"></a><tt class="py-lineno">1163</tt>  <tt class="py-line"><tt class="py-docstring">                         to receive notifier object (self) as first parameter.</tt> </tt>
<a name="L1164"></a><tt class="py-lineno">1164</tt>  <tt class="py-line"><tt class="py-docstring">        @type callback: callable</tt> </tt>
<a name="L1165"></a><tt class="py-lineno">1165</tt>  <tt class="py-line"><tt class="py-docstring">        @param daemonize: This thread is daemonized if set to True.</tt> </tt>
<a name="L1166"></a><tt class="py-lineno">1166</tt>  <tt class="py-line"><tt class="py-docstring">        @type daemonize: boolean</tt> </tt>
<a name="L1167"></a><tt class="py-lineno">1167</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1168"></a><tt class="py-lineno">1168</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">daemonize</tt><tt class="py-op">:</tt> </tt>
<a name="L1169"></a><tt class="py-lineno">1169</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-208" class="py-name" targets="Method pyinotify.Notifier.__daemonize()=pyinotify.Notifier-class.html#__daemonize"><a title="pyinotify.Notifier.__daemonize" class="py-name" href="#" onclick="return doclink('link-208', '__daemonize', 'link-208');">__daemonize</a></tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L1170"></a><tt class="py-lineno">1170</tt>  <tt class="py-line"> </tt>
<a name="L1171"></a><tt class="py-lineno">1171</tt>  <tt class="py-line">        <tt class="py-comment"># Read and process events forever</tt> </tt>
<a name="L1172"></a><tt class="py-lineno">1172</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L1173"></a><tt class="py-lineno">1173</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1174"></a><tt class="py-lineno">1174</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-209" class="py-name" targets="Method pyinotify.Notifier.process_events()=pyinotify.Notifier-class.html#process_events"><a title="pyinotify.Notifier.process_events" class="py-name" href="#" onclick="return doclink('link-209', 'process_events', 'link-209');">process_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1175"></a><tt class="py-lineno">1175</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">callback</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="L1176"></a><tt class="py-lineno">1176</tt>  <tt class="py-line">                    <tt class="py-name">callback</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L1177"></a><tt class="py-lineno">1177</tt>  <tt class="py-line">                <tt class="py-name">ref_time</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>
<a name="L1178"></a><tt class="py-lineno">1178</tt>  <tt class="py-line">                <tt class="py-comment"># check_events is blocking</tt> </tt>
<a name="L1179"></a><tt class="py-lineno">1179</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-210" class="py-name" targets="Method pyinotify.Notifier.check_events()=pyinotify.Notifier-class.html#check_events"><a title="pyinotify.Notifier.check_events" class="py-name" href="#" onclick="return doclink('link-210', 'check_events', 'link-210');">check_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1180"></a><tt class="py-lineno">1180</tt>  <tt class="py-line">                    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-211" class="py-name" targets="Method pyinotify.Notifier._sleep()=pyinotify.Notifier-class.html#_sleep"><a title="pyinotify.Notifier._sleep" class="py-name" href="#" onclick="return doclink('link-211', '_sleep', 'link-211');">_sleep</a></tt><tt class="py-op">(</tt><tt class="py-name">ref_time</tt><tt class="py-op">)</tt> </tt>
<a name="L1181"></a><tt class="py-lineno">1181</tt>  <tt class="py-line">                    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-212" class="py-name" targets="Method pyinotify.Notifier.read_events()=pyinotify.Notifier-class.html#read_events"><a title="pyinotify.Notifier.read_events" class="py-name" href="#" onclick="return doclink('link-212', 'read_events', 'link-212');">read_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1182"></a><tt class="py-lineno">1182</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">KeyboardInterrupt</tt><tt class="py-op">:</tt> </tt>
<a name="L1183"></a><tt class="py-lineno">1183</tt>  <tt class="py-line">                <tt class="py-comment"># Unless sigint is caught (Control-C)</tt> </tt>
<a name="L1184"></a><tt class="py-lineno">1184</tt>  <tt class="py-line">                <tt id="link-213" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-213', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'Pyinotify stops monitoring.'</tt><tt class="py-op">)</tt> </tt>
<a name="L1185"></a><tt class="py-lineno">1185</tt>  <tt class="py-line">                <tt class="py-comment"># Stop monitoring</tt> </tt>
<a name="L1186"></a><tt class="py-lineno">1186</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-214" class="py-name" targets="Method pyinotify.Notifier.stop()=pyinotify.Notifier-class.html#stop,Method pyinotify.ThreadedNotifier.stop()=pyinotify.ThreadedNotifier-class.html#stop"><a title="pyinotify.Notifier.stop
pyinotify.ThreadedNotifier.stop" class="py-name" href="#" onclick="return doclink('link-214', 'stop', 'link-214');">stop</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1187"></a><tt class="py-lineno">1187</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
</div><a name="L1188"></a><tt class="py-lineno">1188</tt>  <tt class="py-line"> </tt>
<a name="Notifier.stop"></a><div id="Notifier.stop-def"><a name="L1189"></a><tt class="py-lineno">1189</tt> <a class="py-toggle" href="#" id="Notifier.stop-toggle" onclick="return toggle('Notifier.stop');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Notifier-class.html#stop">stop</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="Notifier.stop-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Notifier.stop-expanded"><a name="L1190"></a><tt class="py-lineno">1190</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1191"></a><tt class="py-lineno">1191</tt>  <tt class="py-line"><tt class="py-docstring">        Close the inotify's instance (close its file descriptor).</tt> </tt>
<a name="L1192"></a><tt class="py-lineno">1192</tt>  <tt class="py-line"><tt class="py-docstring">        It destroys all existing watches, pending events,...</tt> </tt>
<a name="L1193"></a><tt class="py-lineno">1193</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1194"></a><tt class="py-lineno">1194</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt><tt class="py-op">.</tt><tt class="py-name">unregister</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">)</tt> </tt>
<a name="L1195"></a><tt class="py-lineno">1195</tt>  <tt class="py-line">        <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L1196"></a><tt class="py-lineno">1196</tt>  <tt class="py-line"> </tt>
<a name="ThreadedNotifier"></a><div id="ThreadedNotifier-def"><a name="L1197"></a><tt class="py-lineno">1197</tt>  <tt class="py-line"> </tt>
<a name="L1198"></a><tt class="py-lineno">1198</tt> <a class="py-toggle" href="#" id="ThreadedNotifier-toggle" onclick="return toggle('ThreadedNotifier');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.ThreadedNotifier-class.html">ThreadedNotifier</a><tt class="py-op">(</tt><tt class="py-base-class">threading</tt><tt class="py-op">.</tt><tt class="py-base-class">Thread</tt><tt class="py-op">,</tt> <tt class="py-base-class">Notifier</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ThreadedNotifier-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ThreadedNotifier-expanded"><a name="L1199"></a><tt class="py-lineno">1199</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1200"></a><tt class="py-lineno">1200</tt>  <tt class="py-line"><tt class="py-docstring">    This notifier inherits from threading.Thread for instantiating a separate</tt> </tt>
<a name="L1201"></a><tt class="py-lineno">1201</tt>  <tt class="py-line"><tt class="py-docstring">    thread, and also inherits from Notifier, because it is a threaded notifier.</tt> </tt>
<a name="L1202"></a><tt class="py-lineno">1202</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1203"></a><tt class="py-lineno">1203</tt>  <tt class="py-line"><tt class="py-docstring">    Note that everything possible with this class is also possible through</tt> </tt>
<a name="L1204"></a><tt class="py-lineno">1204</tt>  <tt class="py-line"><tt class="py-docstring">    Notifier. Moreover Notifier is _better_ under many aspects: not threaded,</tt> </tt>
<a name="L1205"></a><tt class="py-lineno">1205</tt>  <tt class="py-line"><tt class="py-docstring">    can be easily daemonized.</tt> </tt>
<a name="L1206"></a><tt class="py-lineno">1206</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="ThreadedNotifier.__init__"></a><div id="ThreadedNotifier.__init__-def"><a name="L1207"></a><tt class="py-lineno">1207</tt> <a class="py-toggle" href="#" id="ThreadedNotifier.__init__-toggle" onclick="return toggle('ThreadedNotifier.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ThreadedNotifier-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">watch_manager</tt><tt class="py-op">,</tt> <tt class="py-param">default_proc_fun</tt><tt class="py-op">=</tt><tt id="link-215" class="py-name"><a title="pyinotify.ProcessEvent" class="py-name" href="#" onclick="return doclink('link-215', 'ProcessEvent', 'link-197');">ProcessEvent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1208"></a><tt class="py-lineno">1208</tt>  <tt class="py-line">                 <tt class="py-param">read_freq</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">treshold</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</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="ThreadedNotifier.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ThreadedNotifier.__init__-expanded"><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">        Initialization, initialize base classes. read_freq, treshold and</tt> </tt>
<a name="L1211"></a><tt class="py-lineno">1211</tt>  <tt class="py-line"><tt class="py-docstring">        timeout parameters are used when looping.</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">        @param watch_manager: Watch Manager.</tt> </tt>
<a name="L1214"></a><tt class="py-lineno">1214</tt>  <tt class="py-line"><tt class="py-docstring">        @type watch_manager: WatchManager instance</tt> </tt>
<a name="L1215"></a><tt class="py-lineno">1215</tt>  <tt class="py-line"><tt class="py-docstring">        @param default_proc_fun: Default processing method.</tt> </tt>
<a name="L1216"></a><tt class="py-lineno">1216</tt>  <tt class="py-line"><tt class="py-docstring">        @type default_proc_fun: instance of ProcessEvent</tt> </tt>
<a name="L1217"></a><tt class="py-lineno">1217</tt>  <tt class="py-line"><tt class="py-docstring">        @param read_freq: if read_freq == 0, events are read asap,</tt> </tt>
<a name="L1218"></a><tt class="py-lineno">1218</tt>  <tt class="py-line"><tt class="py-docstring">                          if read_freq is &gt; 0, this thread sleeps</tt> </tt>
<a name="L1219"></a><tt class="py-lineno">1219</tt>  <tt class="py-line"><tt class="py-docstring">                          max(0, read_freq - timeout) seconds.</tt> </tt>
<a name="L1220"></a><tt class="py-lineno">1220</tt>  <tt class="py-line"><tt class="py-docstring">        @type read_freq: int</tt> </tt>
<a name="L1221"></a><tt class="py-lineno">1221</tt>  <tt class="py-line"><tt class="py-docstring">        @param treshold: File descriptor will be read only if its size to</tt> </tt>
<a name="L1222"></a><tt class="py-lineno">1222</tt>  <tt class="py-line"><tt class="py-docstring">                         read is &gt;= treshold. If != 0, you likely want to</tt> </tt>
<a name="L1223"></a><tt class="py-lineno">1223</tt>  <tt class="py-line"><tt class="py-docstring">                         use it in combination with read_freq because</tt> </tt>
<a name="L1224"></a><tt class="py-lineno">1224</tt>  <tt class="py-line"><tt class="py-docstring">                         without that you keep looping without really reading</tt> </tt>
<a name="L1225"></a><tt class="py-lineno">1225</tt>  <tt class="py-line"><tt class="py-docstring">                         anything and that until the amount to read</tt> </tt>
<a name="L1226"></a><tt class="py-lineno">1226</tt>  <tt class="py-line"><tt class="py-docstring">                         is &gt;= treshold. At least with read_freq you may sleep.</tt> </tt>
<a name="L1227"></a><tt class="py-lineno">1227</tt>  <tt class="py-line"><tt class="py-docstring">        @type treshold: int</tt> </tt>
<a name="L1228"></a><tt class="py-lineno">1228</tt>  <tt class="py-line"><tt class="py-docstring">        @param timeout:</tt> </tt>
<a name="L1229"></a><tt class="py-lineno">1229</tt>  <tt class="py-line"><tt class="py-docstring">           see http://docs.python.org/lib/poll-objects.html#poll-objects</tt> </tt>
<a name="L1230"></a><tt class="py-lineno">1230</tt>  <tt class="py-line"><tt class="py-docstring">           Read the corresponding comment in the source code before changing</tt> </tt>
<a name="L1231"></a><tt class="py-lineno">1231</tt>  <tt class="py-line"><tt class="py-docstring">           it.</tt> </tt>
<a name="L1232"></a><tt class="py-lineno">1232</tt>  <tt class="py-line"><tt class="py-docstring">        @type timeout: int</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-comment"># Init threading base class</tt> </tt>
<a name="L1235"></a><tt class="py-lineno">1235</tt>  <tt class="py-line">        <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">Thread</tt><tt class="py-op">.</tt><tt id="link-216" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-216', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L1236"></a><tt class="py-lineno">1236</tt>  <tt class="py-line">        <tt class="py-comment"># Stop condition</tt> </tt>
<a name="L1237"></a><tt class="py-lineno">1237</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stop_event</tt> <tt class="py-op">=</tt> <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt id="link-217" class="py-name"><a title="pyinotify.Event" class="py-name" href="#" onclick="return doclink('link-217', 'Event', 'link-158');">Event</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1238"></a><tt class="py-lineno">1238</tt>  <tt class="py-line">        <tt class="py-comment"># Init Notifier base class</tt> </tt>
<a name="L1239"></a><tt class="py-lineno">1239</tt>  <tt class="py-line">        <tt id="link-218" class="py-name" targets="Class pyinotify.Notifier=pyinotify.Notifier-class.html"><a title="pyinotify.Notifier" class="py-name" href="#" onclick="return doclink('link-218', 'Notifier', 'link-218');">Notifier</a></tt><tt class="py-op">.</tt><tt id="link-219" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-219', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">watch_manager</tt><tt class="py-op">,</tt> <tt class="py-name">default_proc_fun</tt><tt class="py-op">,</tt> <tt class="py-name">read_freq</tt><tt class="py-op">,</tt> </tt>
<a name="L1240"></a><tt class="py-lineno">1240</tt>  <tt class="py-line">                          <tt class="py-name">treshold</tt><tt class="py-op">,</tt> <tt class="py-name">timeout</tt><tt class="py-op">)</tt> </tt>
<a name="L1241"></a><tt class="py-lineno">1241</tt>  <tt class="py-line">        <tt class="py-comment"># Create a new pipe used for thread termination</tt> </tt>
<a name="L1242"></a><tt class="py-lineno">1242</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">pipe</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-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt><tt class="py-op">.</tt><tt class="py-name">register</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</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">select</tt><tt class="py-op">.</tt><tt class="py-name">POLLIN</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1244"></a><tt class="py-lineno">1244</tt>  <tt class="py-line"> </tt>
<a name="ThreadedNotifier.stop"></a><div id="ThreadedNotifier.stop-def"><a name="L1245"></a><tt class="py-lineno">1245</tt> <a class="py-toggle" href="#" id="ThreadedNotifier.stop-toggle" onclick="return toggle('ThreadedNotifier.stop');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ThreadedNotifier-class.html#stop">stop</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="ThreadedNotifier.stop-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ThreadedNotifier.stop-expanded"><a name="L1246"></a><tt class="py-lineno">1246</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1247"></a><tt class="py-lineno">1247</tt>  <tt class="py-line"><tt class="py-docstring">        Stop the notifier's loop. Stop notification. Join the thread.</tt> </tt>
<a name="L1248"></a><tt class="py-lineno">1248</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1249"></a><tt class="py-lineno">1249</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stop_event</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">(</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">os</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</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-string">'stop'</tt><tt class="py-op">)</tt> </tt>
<a name="L1251"></a><tt class="py-lineno">1251</tt>  <tt class="py-line">        <tt class="py-name">threading</tt><tt class="py-op">.</tt><tt class="py-name">Thread</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L1252"></a><tt class="py-lineno">1252</tt>  <tt class="py-line">        <tt id="link-220" class="py-name"><a title="pyinotify.Notifier" class="py-name" href="#" onclick="return doclink('link-220', 'Notifier', 'link-218');">Notifier</a></tt><tt class="py-op">.</tt><tt id="link-221" class="py-name"><a title="pyinotify.Notifier.stop
pyinotify.ThreadedNotifier.stop" class="py-name" href="#" onclick="return doclink('link-221', 'stop', 'link-214');">stop</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L1253"></a><tt class="py-lineno">1253</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pollobj</tt><tt class="py-op">.</tt><tt class="py-name">unregister</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1254"></a><tt class="py-lineno">1254</tt>  <tt class="py-line">        <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1255"></a><tt class="py-lineno">1255</tt>  <tt class="py-line">        <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_pipe</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1256"></a><tt class="py-lineno">1256</tt>  <tt class="py-line"> </tt>
<a name="ThreadedNotifier.loop"></a><div id="ThreadedNotifier.loop-def"><a name="L1257"></a><tt class="py-lineno">1257</tt> <a class="py-toggle" href="#" id="ThreadedNotifier.loop-toggle" onclick="return toggle('ThreadedNotifier.loop');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ThreadedNotifier-class.html#loop">loop</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="ThreadedNotifier.loop-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ThreadedNotifier.loop-expanded"><a name="L1258"></a><tt class="py-lineno">1258</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1259"></a><tt class="py-lineno">1259</tt>  <tt class="py-line"><tt class="py-docstring">        Thread's main loop. Don't meant to be called by user directly.</tt> </tt>
<a name="L1260"></a><tt class="py-lineno">1260</tt>  <tt class="py-line"><tt class="py-docstring">        Call start() instead.</tt> </tt>
<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">        Events are read only once time every min(read_freq, timeout)</tt> </tt>
<a name="L1263"></a><tt class="py-lineno">1263</tt>  <tt class="py-line"><tt class="py-docstring">        seconds at best and only if the size of events to read is &gt;= treshold.</tt> </tt>
<a name="L1264"></a><tt class="py-lineno">1264</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1265"></a><tt class="py-lineno">1265</tt>  <tt class="py-line">        <tt class="py-comment"># When the loop must be terminated .stop() is called, 'stop'</tt> </tt>
<a name="L1266"></a><tt class="py-lineno">1266</tt>  <tt class="py-line">        <tt class="py-comment"># is written to pipe fd so poll() returns and .check_events()</tt> </tt>
<a name="L1267"></a><tt class="py-lineno">1267</tt>  <tt class="py-line">        <tt class="py-comment"># returns False which make evaluate the While's stop condition</tt> </tt>
<a name="L1268"></a><tt class="py-lineno">1268</tt>  <tt class="py-line">        <tt class="py-comment"># ._stop_event.isSet() wich put an end to the thread's execution.</tt> </tt>
<a name="L1269"></a><tt class="py-lineno">1269</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_stop_event</tt><tt class="py-op">.</tt><tt class="py-name">isSet</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1270"></a><tt class="py-lineno">1270</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-222" class="py-name"><a title="pyinotify.Notifier.process_events" class="py-name" href="#" onclick="return doclink('link-222', 'process_events', 'link-209');">process_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1271"></a><tt class="py-lineno">1271</tt>  <tt class="py-line">            <tt class="py-name">ref_time</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>
<a name="L1272"></a><tt class="py-lineno">1272</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-223" class="py-name"><a title="pyinotify.Notifier.check_events" class="py-name" href="#" onclick="return doclink('link-223', 'check_events', 'link-210');">check_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1273"></a><tt class="py-lineno">1273</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-224" class="py-name"><a title="pyinotify.Notifier._sleep" class="py-name" href="#" onclick="return doclink('link-224', '_sleep', 'link-211');">_sleep</a></tt><tt class="py-op">(</tt><tt class="py-name">ref_time</tt><tt class="py-op">)</tt> </tt>
<a name="L1274"></a><tt class="py-lineno">1274</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-225" class="py-name"><a title="pyinotify.Notifier.read_events" class="py-name" href="#" onclick="return doclink('link-225', 'read_events', 'link-212');">read_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1275"></a><tt class="py-lineno">1275</tt>  <tt class="py-line"> </tt>
<a name="ThreadedNotifier.run"></a><div id="ThreadedNotifier.run-def"><a name="L1276"></a><tt class="py-lineno">1276</tt> <a class="py-toggle" href="#" id="ThreadedNotifier.run-toggle" onclick="return toggle('ThreadedNotifier.run');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ThreadedNotifier-class.html#run">run</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="ThreadedNotifier.run-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ThreadedNotifier.run-expanded"><a name="L1277"></a><tt class="py-lineno">1277</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1278"></a><tt class="py-lineno">1278</tt>  <tt class="py-line"><tt class="py-docstring">        Start the thread's loop: read and process events until the method</tt> </tt>
<a name="L1279"></a><tt class="py-lineno">1279</tt>  <tt class="py-line"><tt class="py-docstring">        stop() is called.</tt> </tt>
<a name="L1280"></a><tt class="py-lineno">1280</tt>  <tt class="py-line"><tt class="py-docstring">        Never call this method directly, instead call the start() method</tt> </tt>
<a name="L1281"></a><tt class="py-lineno">1281</tt>  <tt class="py-line"><tt class="py-docstring">        inherited from threading.Thread, which then will call run().</tt> </tt>
<a name="L1282"></a><tt class="py-lineno">1282</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1283"></a><tt class="py-lineno">1283</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-226" class="py-name" targets="Method pyinotify.Notifier.loop()=pyinotify.Notifier-class.html#loop,Method pyinotify.ThreadedNotifier.loop()=pyinotify.ThreadedNotifier-class.html#loop"><a title="pyinotify.Notifier.loop
pyinotify.ThreadedNotifier.loop" class="py-name" href="#" onclick="return doclink('link-226', 'loop', 'link-226');">loop</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L1284"></a><tt class="py-lineno">1284</tt>  <tt class="py-line"> </tt>
<a name="AsyncNotifier"></a><div id="AsyncNotifier-def"><a name="L1285"></a><tt class="py-lineno">1285</tt>  <tt class="py-line"> </tt>
<a name="L1286"></a><tt class="py-lineno">1286</tt> <a class="py-toggle" href="#" id="AsyncNotifier-toggle" onclick="return toggle('AsyncNotifier');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.AsyncNotifier-class.html">AsyncNotifier</a><tt class="py-op">(</tt><tt class="py-base-class">asyncore</tt><tt class="py-op">.</tt><tt class="py-base-class">file_dispatcher</tt><tt class="py-op">,</tt> <tt class="py-base-class">Notifier</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="AsyncNotifier-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="AsyncNotifier-expanded"><a name="L1287"></a><tt class="py-lineno">1287</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1288"></a><tt class="py-lineno">1288</tt>  <tt class="py-line"><tt class="py-docstring">    This notifier inherits from asyncore.file_dispatcher in order to be able to</tt> </tt>
<a name="L1289"></a><tt class="py-lineno">1289</tt>  <tt class="py-line"><tt class="py-docstring">    use pyinotify along with the asyncore framework.</tt> </tt>
<a name="L1290"></a><tt class="py-lineno">1290</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1291"></a><tt class="py-lineno">1291</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="AsyncNotifier.__init__"></a><div id="AsyncNotifier.__init__-def"><a name="L1292"></a><tt class="py-lineno">1292</tt> <a class="py-toggle" href="#" id="AsyncNotifier.__init__-toggle" onclick="return toggle('AsyncNotifier.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.AsyncNotifier-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">watch_manager</tt><tt class="py-op">,</tt> <tt class="py-param">default_proc_fun</tt><tt class="py-op">=</tt><tt id="link-227" class="py-name"><a title="pyinotify.ProcessEvent" class="py-name" href="#" onclick="return doclink('link-227', 'ProcessEvent', 'link-197');">ProcessEvent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1293"></a><tt class="py-lineno">1293</tt>  <tt class="py-line">                 <tt class="py-param">read_freq</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">treshold</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">map</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="AsyncNotifier.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="AsyncNotifier.__init__-expanded"><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">        Initializes the async notifier. The only additional parameter is 'map'</tt> </tt>
<a name="L1296"></a><tt class="py-lineno">1296</tt>  <tt class="py-line"><tt class="py-docstring">        which is the optional asyncore private map.</tt> </tt>
<a name="L1297"></a><tt class="py-lineno">1297</tt>  <tt class="py-line"><tt class="py-docstring"></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 id="link-228" class="py-name"><a title="pyinotify.Notifier" class="py-name" href="#" onclick="return doclink('link-228', 'Notifier', 'link-218');">Notifier</a></tt><tt class="py-op">.</tt><tt id="link-229" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-229', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">watch_manager</tt><tt class="py-op">,</tt> <tt class="py-name">default_proc_fun</tt><tt class="py-op">,</tt> <tt class="py-name">read_freq</tt><tt class="py-op">,</tt> </tt>
<a name="L1300"></a><tt class="py-lineno">1300</tt>  <tt class="py-line">                          <tt class="py-name">treshold</tt><tt class="py-op">,</tt> <tt class="py-name">timeout</tt><tt class="py-op">)</tt> </tt>
<a name="L1301"></a><tt class="py-lineno">1301</tt>  <tt class="py-line">        <tt class="py-name">asyncore</tt><tt class="py-op">.</tt><tt class="py-name">file_dispatcher</tt><tt class="py-op">.</tt><tt id="link-230" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-230', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">map</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1302"></a><tt class="py-lineno">1302</tt>  <tt class="py-line"> </tt>
<a name="AsyncNotifier.handle_read"></a><div id="AsyncNotifier.handle_read-def"><a name="L1303"></a><tt class="py-lineno">1303</tt> <a class="py-toggle" href="#" id="AsyncNotifier.handle_read-toggle" onclick="return toggle('AsyncNotifier.handle_read');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.AsyncNotifier-class.html#handle_read">handle_read</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="AsyncNotifier.handle_read-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="AsyncNotifier.handle_read-expanded"><a name="L1304"></a><tt class="py-lineno">1304</tt>  <tt class="py-line">        <tt class="py-docstring">"""When asyncore tells us we can read from the fd, we proceed processing</tt> </tt>
<a name="L1305"></a><tt class="py-lineno">1305</tt>  <tt class="py-line"><tt class="py-docstring">        events. This method can be overridden for handling a notification</tt> </tt>
<a name="L1306"></a><tt class="py-lineno">1306</tt>  <tt class="py-line"><tt class="py-docstring">        differently.</tt> </tt>
<a name="L1307"></a><tt class="py-lineno">1307</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1308"></a><tt class="py-lineno">1308</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1309"></a><tt class="py-lineno">1309</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-231" class="py-name"><a title="pyinotify.Notifier.read_events" class="py-name" href="#" onclick="return doclink('link-231', 'read_events', 'link-212');">read_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1310"></a><tt class="py-lineno">1310</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-232" class="py-name"><a title="pyinotify.Notifier.process_events" class="py-name" href="#" onclick="return doclink('link-232', 'process_events', 'link-209');">process_events</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L1311"></a><tt class="py-lineno">1311</tt>  <tt class="py-line"> </tt>
<a name="Watch"></a><div id="Watch-def"><a name="L1312"></a><tt class="py-lineno">1312</tt>  <tt class="py-line"> </tt>
<a name="L1313"></a><tt class="py-lineno">1313</tt> <a class="py-toggle" href="#" id="Watch-toggle" onclick="return toggle('Watch');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.Watch-class.html">Watch</a><tt class="py-op">:</tt> </tt>
</div><div id="Watch-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Watch-expanded"><a name="L1314"></a><tt class="py-lineno">1314</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1315"></a><tt class="py-lineno">1315</tt>  <tt class="py-line"><tt class="py-docstring">    Represent a watch, i.e. a file or directory being watched.</tt> </tt>
<a name="L1316"></a><tt class="py-lineno">1316</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1317"></a><tt class="py-lineno">1317</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="Watch.__init__"></a><div id="Watch.__init__-def"><a name="L1318"></a><tt class="py-lineno">1318</tt> <a class="py-toggle" href="#" id="Watch.__init__-toggle" onclick="return toggle('Watch.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Watch-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-param">keys</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Watch.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Watch.__init__-expanded"><a name="L1319"></a><tt class="py-lineno">1319</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1320"></a><tt class="py-lineno">1320</tt>  <tt class="py-line"><tt class="py-docstring">        Initializations.</tt> </tt>
<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">        @param wd: Watch descriptor.</tt> </tt>
<a name="L1323"></a><tt class="py-lineno">1323</tt>  <tt class="py-line"><tt class="py-docstring">        @type wd: int</tt> </tt>
<a name="L1324"></a><tt class="py-lineno">1324</tt>  <tt class="py-line"><tt class="py-docstring">        @param path: Path of the file or directory being watched.</tt> </tt>
<a name="L1325"></a><tt class="py-lineno">1325</tt>  <tt class="py-line"><tt class="py-docstring">        @type path: str</tt> </tt>
<a name="L1326"></a><tt class="py-lineno">1326</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: Mask.</tt> </tt>
<a name="L1327"></a><tt class="py-lineno">1327</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L1328"></a><tt class="py-lineno">1328</tt>  <tt class="py-line"><tt class="py-docstring">        @param proc_fun: Processing callable object.</tt> </tt>
<a name="L1329"></a><tt class="py-lineno">1329</tt>  <tt class="py-line"><tt class="py-docstring">        @type proc_fun:</tt> </tt>
<a name="L1330"></a><tt class="py-lineno">1330</tt>  <tt class="py-line"><tt class="py-docstring">        @param auto_add: Automatically add watches on new directories.</tt> </tt>
<a name="L1331"></a><tt class="py-lineno">1331</tt>  <tt class="py-line"><tt class="py-docstring">        @type auto_add: bool</tt> </tt>
<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-keyword">for</tt> <tt class="py-name">k</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keys</tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1334"></a><tt class="py-lineno">1334</tt>  <tt class="py-line">            <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">k</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L1335"></a><tt class="py-lineno">1335</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dir</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">isdir</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1336"></a><tt class="py-lineno">1336</tt>  <tt class="py-line"> </tt>
<a name="Watch.__repr__"></a><div id="Watch.__repr__-def"><a name="L1337"></a><tt class="py-lineno">1337</tt> <a class="py-toggle" href="#" id="Watch.__repr__-toggle" onclick="return toggle('Watch.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Watch-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="Watch.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Watch.__repr__-expanded"><a name="L1338"></a><tt class="py-lineno">1338</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1339"></a><tt class="py-lineno">1339</tt>  <tt class="py-line"><tt class="py-docstring">        @return: String representation.</tt> </tt>
<a name="L1340"></a><tt class="py-lineno">1340</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: str</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-name">s</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-op">[</tt><tt class="py-string">'%s%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-233" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-233', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-234" class="py-name"><a title="pyinotify.Color.FieldName" class="py-name" href="#" onclick="return doclink('link-234', 'FieldName', 'link-101');">FieldName</a></tt><tt class="py-op">(</tt><tt class="py-name">attr</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1343"></a><tt class="py-lineno">1343</tt>  <tt class="py-line">                                  <tt id="link-235" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-235', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-236" class="py-name"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-236', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1344"></a><tt class="py-lineno">1344</tt>  <tt class="py-line">                                  <tt id="link-237" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-237', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-238" class="py-name"><a title="pyinotify.Color.FieldValue" class="py-name" href="#" onclick="return doclink('link-238', 'FieldValue', 'link-105');">FieldValue</a></tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">attr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> \ </tt>
<a name="L1345"></a><tt class="py-lineno">1345</tt>  <tt class="py-line">                      <tt class="py-keyword">for</tt> <tt class="py-name">attr</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">attr</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">'_'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1346"></a><tt class="py-lineno">1346</tt>  <tt class="py-line"> </tt>
<a name="L1347"></a><tt class="py-lineno">1347</tt>  <tt class="py-line">        <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">'%s%s %s %s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-239" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-239', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-240" class="py-name"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-240', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'&lt;'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1348"></a><tt class="py-lineno">1348</tt>  <tt class="py-line">                            <tt id="link-241" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-241', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-242" class="py-name"><a title="pyinotify.Color.ClassName" class="py-name" href="#" onclick="return doclink('link-242', 'ClassName', 'link-110');">ClassName</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1349"></a><tt class="py-lineno">1349</tt>  <tt class="py-line">                            <tt class="py-name">s</tt><tt class="py-op">,</tt> </tt>
<a name="L1350"></a><tt class="py-lineno">1350</tt>  <tt class="py-line">                            <tt id="link-243" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-243', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-244" class="py-name"><a title="pyinotify.Color.Punctuation" class="py-name" href="#" onclick="return doclink('link-244', 'Punctuation', 'link-103');">Punctuation</a></tt><tt class="py-op">(</tt><tt class="py-string">'&gt;'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1351"></a><tt class="py-lineno">1351</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
</div></div><a name="L1352"></a><tt class="py-lineno">1352</tt>  <tt class="py-line"> </tt>
<a name="ExcludeFilter"></a><div id="ExcludeFilter-def"><a name="L1353"></a><tt class="py-lineno">1353</tt>  <tt class="py-line"> </tt>
<a name="L1354"></a><tt class="py-lineno">1354</tt> <a class="py-toggle" href="#" id="ExcludeFilter-toggle" onclick="return toggle('ExcludeFilter');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.ExcludeFilter-class.html">ExcludeFilter</a><tt class="py-op">:</tt> </tt>
</div><div id="ExcludeFilter-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="ExcludeFilter-expanded"><a name="L1355"></a><tt class="py-lineno">1355</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1356"></a><tt class="py-lineno">1356</tt>  <tt class="py-line"><tt class="py-docstring">    ExcludeFilter is an exclusion filter.</tt> </tt>
<a name="L1357"></a><tt class="py-lineno">1357</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L1358"></a><tt class="py-lineno">1358</tt>  <tt class="py-line"> </tt>
<a name="ExcludeFilter.__init__"></a><div id="ExcludeFilter.__init__-def"><a name="L1359"></a><tt class="py-lineno">1359</tt> <a class="py-toggle" href="#" id="ExcludeFilter.__init__-toggle" onclick="return toggle('ExcludeFilter.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ExcludeFilter-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">arg_lst</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ExcludeFilter.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ExcludeFilter.__init__-expanded"><a name="L1360"></a><tt class="py-lineno">1360</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1361"></a><tt class="py-lineno">1361</tt>  <tt class="py-line"><tt class="py-docstring">        @param arg_lst: is either a list or dict of patterns:</tt> </tt>
<a name="L1362"></a><tt class="py-lineno">1362</tt>  <tt class="py-line"><tt class="py-docstring">                        [pattern1, ..., patternn]</tt> </tt>
<a name="L1363"></a><tt class="py-lineno">1363</tt>  <tt class="py-line"><tt class="py-docstring">                        {'filename1': (list1, listn), ...} where list1 is</tt> </tt>
<a name="L1364"></a><tt class="py-lineno">1364</tt>  <tt class="py-line"><tt class="py-docstring">                        a list of patterns</tt> </tt>
<a name="L1365"></a><tt class="py-lineno">1365</tt>  <tt class="py-line"><tt class="py-docstring">        @type arg_lst: list or dict</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-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">arg_lst</tt><tt class="py-op">,</tt> <tt class="py-name">dict</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1368"></a><tt class="py-lineno">1368</tt>  <tt class="py-line">            <tt class="py-name">lst</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-245" class="py-name" targets="Method pyinotify.ExcludeFilter._load_patterns()=pyinotify.ExcludeFilter-class.html#_load_patterns"><a title="pyinotify.ExcludeFilter._load_patterns" class="py-name" href="#" onclick="return doclink('link-245', '_load_patterns', 'link-245');">_load_patterns</a></tt><tt class="py-op">(</tt><tt class="py-name">arg_lst</tt><tt class="py-op">)</tt> </tt>
<a name="L1369"></a><tt class="py-lineno">1369</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">arg_lst</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1370"></a><tt class="py-lineno">1370</tt>  <tt class="py-line">            <tt class="py-name">lst</tt> <tt class="py-op">=</tt> <tt class="py-name">arg_lst</tt> </tt>
<a name="L1371"></a><tt class="py-lineno">1371</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1372"></a><tt class="py-lineno">1372</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt> </tt>
<a name="L1373"></a><tt class="py-lineno">1373</tt>  <tt class="py-line"> </tt>
<a name="L1374"></a><tt class="py-lineno">1374</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_lregex</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1375"></a><tt class="py-lineno">1375</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">regex</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lst</tt><tt class="py-op">:</tt> </tt>
<a name="L1376"></a><tt class="py-lineno">1376</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_lregex</tt><tt class="py-op">.</tt><tt class="py-name">append</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">regex</tt><tt class="py-op">,</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">UNICODE</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1377"></a><tt class="py-lineno">1377</tt>  <tt class="py-line"> </tt>
<a name="ExcludeFilter._load_patterns"></a><div id="ExcludeFilter._load_patterns-def"><a name="L1378"></a><tt class="py-lineno">1378</tt> <a class="py-toggle" href="#" id="ExcludeFilter._load_patterns-toggle" onclick="return toggle('ExcludeFilter._load_patterns');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ExcludeFilter-class.html#_load_patterns">_load_patterns</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dct</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ExcludeFilter._load_patterns-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ExcludeFilter._load_patterns-expanded"><a name="L1379"></a><tt class="py-lineno">1379</tt>  <tt class="py-line">        <tt class="py-name">lst</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1380"></a><tt class="py-lineno">1380</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">varnames</tt> <tt class="py-keyword">in</tt> <tt class="py-name">dct</tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1381"></a><tt class="py-lineno">1381</tt>  <tt class="py-line">            <tt class="py-name">loc</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L1382"></a><tt class="py-lineno">1382</tt>  <tt class="py-line">            <tt class="py-name">execfile</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-op">}</tt><tt class="py-op">,</tt> <tt class="py-name">loc</tt><tt class="py-op">)</tt> </tt>
<a name="L1383"></a><tt class="py-lineno">1383</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">varname</tt> <tt class="py-keyword">in</tt> <tt class="py-name">varnames</tt><tt class="py-op">:</tt> </tt>
<a name="L1384"></a><tt class="py-lineno">1384</tt>  <tt class="py-line">                <tt class="py-name">lst</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-name">loc</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">varname</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1385"></a><tt class="py-lineno">1385</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">lst</tt> </tt>
</div><a name="L1386"></a><tt class="py-lineno">1386</tt>  <tt class="py-line"> </tt>
<a name="ExcludeFilter._match"></a><div id="ExcludeFilter._match-def"><a name="L1387"></a><tt class="py-lineno">1387</tt> <a class="py-toggle" href="#" id="ExcludeFilter._match-toggle" onclick="return toggle('ExcludeFilter._match');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ExcludeFilter-class.html#_match">_match</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">regex</tt><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="ExcludeFilter._match-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ExcludeFilter._match-expanded"><a name="L1388"></a><tt class="py-lineno">1388</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">regex</tt><tt class="py-op">.</tt><tt class="py-name">match</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L1389"></a><tt class="py-lineno">1389</tt>  <tt class="py-line"> </tt>
<a name="ExcludeFilter.__call__"></a><div id="ExcludeFilter.__call__-def"><a name="L1390"></a><tt class="py-lineno">1390</tt> <a class="py-toggle" href="#" id="ExcludeFilter.__call__-toggle" onclick="return toggle('ExcludeFilter.__call__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.ExcludeFilter-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><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="ExcludeFilter.__call__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="ExcludeFilter.__call__-expanded"><a name="L1391"></a><tt class="py-lineno">1391</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1392"></a><tt class="py-lineno">1392</tt>  <tt class="py-line"><tt class="py-docstring">        @param path: path to match against regexps.</tt> </tt>
<a name="L1393"></a><tt class="py-lineno">1393</tt>  <tt class="py-line"><tt class="py-docstring">        @type path: str</tt> </tt>
<a name="L1394"></a><tt class="py-lineno">1394</tt>  <tt class="py-line"><tt class="py-docstring">        @return: return True is path has been matched and should</tt> </tt>
<a name="L1395"></a><tt class="py-lineno">1395</tt>  <tt class="py-line"><tt class="py-docstring">                 be excluded, False otherwise.</tt> </tt>
<a name="L1396"></a><tt class="py-lineno">1396</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: bool</tt> </tt>
<a name="L1397"></a><tt class="py-lineno">1397</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1398"></a><tt class="py-lineno">1398</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">regex</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_lregex</tt><tt class="py-op">:</tt> </tt>
<a name="L1399"></a><tt class="py-lineno">1399</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-246" class="py-name" targets="Method pyinotify.ExcludeFilter._match()=pyinotify.ExcludeFilter-class.html#_match"><a title="pyinotify.ExcludeFilter._match" class="py-name" href="#" onclick="return doclink('link-246', '_match', 'link-246');">_match</a></tt><tt class="py-op">(</tt><tt class="py-name">regex</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="L1400"></a><tt class="py-lineno">1400</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L1401"></a><tt class="py-lineno">1401</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div></div><a name="L1402"></a><tt class="py-lineno">1402</tt>  <tt class="py-line"> </tt>
<a name="WatchManagerError"></a><div id="WatchManagerError-def"><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="WatchManagerError-toggle" onclick="return toggle('WatchManagerError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.WatchManagerError-class.html">WatchManagerError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManagerError-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="WatchManagerError-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">    WatchManager Exception. Raised on error encountered on watches</tt> </tt>
<a name="L1407"></a><tt class="py-lineno">1407</tt>  <tt class="py-line"><tt class="py-docstring">    operations.</tt> </tt>
<a name="L1408"></a><tt class="py-lineno">1408</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1409"></a><tt class="py-lineno">1409</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="WatchManagerError.__init__"></a><div id="WatchManagerError.__init__-def"><a name="L1410"></a><tt class="py-lineno">1410</tt> <a class="py-toggle" href="#" id="WatchManagerError.__init__-toggle" onclick="return toggle('WatchManagerError.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManagerError-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">msg</tt><tt class="py-op">,</tt> <tt class="py-param">wmd</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManagerError.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManagerError.__init__-expanded"><a name="L1411"></a><tt class="py-lineno">1411</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1412"></a><tt class="py-lineno">1412</tt>  <tt class="py-line"><tt class="py-docstring">        @param msg: Exception string's description.</tt> </tt>
<a name="L1413"></a><tt class="py-lineno">1413</tt>  <tt class="py-line"><tt class="py-docstring">        @type msg: string</tt> </tt>
<a name="L1414"></a><tt class="py-lineno">1414</tt>  <tt class="py-line"><tt class="py-docstring">        @param wmd: This dictionary contains the wd assigned to paths of the</tt> </tt>
<a name="L1415"></a><tt class="py-lineno">1415</tt>  <tt class="py-line"><tt class="py-docstring">                    same call for which watches were successfully added.</tt> </tt>
<a name="L1416"></a><tt class="py-lineno">1416</tt>  <tt class="py-line"><tt class="py-docstring">        @type wmd: dict</tt> </tt>
<a name="L1417"></a><tt class="py-lineno">1417</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1418"></a><tt class="py-lineno">1418</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">wmd</tt> <tt class="py-op">=</tt> <tt class="py-name">wmd</tt> </tt>
<a name="L1419"></a><tt class="py-lineno">1419</tt>  <tt class="py-line">        <tt class="py-name">Exception</tt><tt class="py-op">.</tt><tt id="link-247" class="py-name"><a title="pyinotify.AsyncNotifier.__init__
pyinotify.Event.__init__
pyinotify.ExcludeFilter.__init__
pyinotify.Notifier.__init__
pyinotify.NotifierError.__init__
pyinotify.ProcessEvent.__init__
pyinotify.ProcessEventError.__init__
pyinotify.SysCtlINotify.__init__
pyinotify.ThreadedNotifier.__init__
pyinotify.UnicodeLogRecord.__init__
pyinotify.UnsupportedLibcVersionError.__init__
pyinotify.UnsupportedPythonVersionError.__init__
pyinotify.Watch.__init__
pyinotify.WatchManager.__init__
pyinotify.WatchManagerError.__init__
pyinotify._Event.__init__
pyinotify._RawEvent.__init__
pyinotify._SysProcessEvent.__init__" class="py-name" href="#" onclick="return doclink('link-247', '__init__', 'link-1');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L1420"></a><tt class="py-lineno">1420</tt>  <tt class="py-line"> </tt>
<a name="WatchManager"></a><div id="WatchManager-def"><a name="L1421"></a><tt class="py-lineno">1421</tt>  <tt class="py-line"> </tt>
<a name="L1422"></a><tt class="py-lineno">1422</tt> <a class="py-toggle" href="#" id="WatchManager-toggle" onclick="return toggle('WatchManager');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html">WatchManager</a><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="WatchManager-expanded"><a name="L1423"></a><tt class="py-lineno">1423</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1424"></a><tt class="py-lineno">1424</tt>  <tt class="py-line"><tt class="py-docstring">    Provide operations for watching files and directories. Integrated</tt> </tt>
<a name="L1425"></a><tt class="py-lineno">1425</tt>  <tt class="py-line"><tt class="py-docstring">    dictionary is used to reference watched items. When used inside</tt> </tt>
<a name="L1426"></a><tt class="py-lineno">1426</tt>  <tt class="py-line"><tt class="py-docstring">    threaded code, instanciate as many WatchManager instances as</tt> </tt>
<a name="L1427"></a><tt class="py-lineno">1427</tt>  <tt class="py-line"><tt class="py-docstring">    there are ThreadedNotifier instances.</tt> </tt>
<a name="L1428"></a><tt class="py-lineno">1428</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1429"></a><tt class="py-lineno">1429</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="WatchManager.__init__"></a><div id="WatchManager.__init__-def"><a name="L1430"></a><tt class="py-lineno">1430</tt> <a class="py-toggle" href="#" id="WatchManager.__init__-toggle" onclick="return toggle('WatchManager.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-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">exclude_filter</tt><tt class="py-op">=</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">path</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="WatchManager.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__init__-expanded"><a name="L1431"></a><tt class="py-lineno">1431</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1432"></a><tt class="py-lineno">1432</tt>  <tt class="py-line"><tt class="py-docstring">        Initialization: init inotify, init watch manager dictionary.</tt> </tt>
<a name="L1433"></a><tt class="py-lineno">1433</tt>  <tt class="py-line"><tt class="py-docstring">        Raise OSError if initialization fails.</tt> </tt>
<a name="L1434"></a><tt class="py-lineno">1434</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1435"></a><tt class="py-lineno">1435</tt>  <tt class="py-line"><tt class="py-docstring">        @param exclude_filter: boolean function, returns True if current</tt> </tt>
<a name="L1436"></a><tt class="py-lineno">1436</tt>  <tt class="py-line"><tt class="py-docstring">                               path must be excluded from being watched.</tt> </tt>
<a name="L1437"></a><tt class="py-lineno">1437</tt>  <tt class="py-line"><tt class="py-docstring">                               Convenient for providing a common exclusion</tt> </tt>
<a name="L1438"></a><tt class="py-lineno">1438</tt>  <tt class="py-line"><tt class="py-docstring">                               filter for every call to add_watch.</tt> </tt>
<a name="L1439"></a><tt class="py-lineno">1439</tt>  <tt class="py-line"><tt class="py-docstring">        @type exclude_filter: bool</tt> </tt>
<a name="L1440"></a><tt class="py-lineno">1440</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1441"></a><tt class="py-lineno">1441</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_exclude_filter</tt> <tt class="py-op">=</tt> <tt class="py-name">exclude_filter</tt> </tt>
<a name="L1442"></a><tt class="py-lineno">1442</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># watch dict key: watch descriptor, value: watch</tt> </tt>
<a name="L1443"></a><tt class="py-lineno">1443</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt> <tt class="py-op">=</tt> <tt id="link-248" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-248', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">inotify_init</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-comment"># inotify's init, file descriptor</tt> </tt>
<a name="L1444"></a><tt class="py-lineno">1444</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">_fd</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1445"></a><tt class="py-lineno">1445</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">OSError</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1446"></a><tt class="py-lineno">1446</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.__add_watch"></a><div id="WatchManager.__add_watch-def"><a name="L1447"></a><tt class="py-lineno">1447</tt> <a class="py-toggle" href="#" id="WatchManager.__add_watch-toggle" onclick="return toggle('WatchManager.__add_watch');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#__add_watch">__add_watch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">mask</tt><tt class="py-op">,</tt> <tt class="py-param">proc_fun</tt><tt class="py-op">,</tt> <tt class="py-param">auto_add</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.__add_watch-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__add_watch-expanded"><a name="L1448"></a><tt class="py-lineno">1448</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1449"></a><tt class="py-lineno">1449</tt>  <tt class="py-line"><tt class="py-docstring">        Add a watch on path, build a Watch object and insert it in the</tt> </tt>
<a name="L1450"></a><tt class="py-lineno">1450</tt>  <tt class="py-line"><tt class="py-docstring">        watch manager dictionary. Return the wd value.</tt> </tt>
<a name="L1451"></a><tt class="py-lineno">1451</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1452"></a><tt class="py-lineno">1452</tt>  <tt class="py-line">        <tt class="py-comment"># Unicode strings are converted to byte strings, it seems to be</tt> </tt>
<a name="L1453"></a><tt class="py-lineno">1453</tt>  <tt class="py-line">        <tt class="py-comment"># required because LIBC.inotify_add_watch does not work well when</tt> </tt>
<a name="L1454"></a><tt class="py-lineno">1454</tt>  <tt class="py-line">        <tt class="py-comment"># it receives an ctypes.create_unicode_buffer instance as argument.</tt> </tt>
<a name="L1455"></a><tt class="py-lineno">1455</tt>  <tt class="py-line">        <tt class="py-comment"># Therefore even wd are indexed with bytes string and not with</tt> </tt>
<a name="L1456"></a><tt class="py-lineno">1456</tt>  <tt class="py-line">        <tt class="py-comment"># unicode paths.</tt> </tt>
<a name="L1457"></a><tt class="py-lineno">1457</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 class="py-name">unicode</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1458"></a><tt class="py-lineno">1458</tt>  <tt class="py-line">            <tt class="py-name">byte_path</tt> <tt class="py-op">=</tt> <tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">encode</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-op">)</tt> </tt>
<a name="L1459"></a><tt class="py-lineno">1459</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1460"></a><tt class="py-lineno">1460</tt>  <tt class="py-line">            <tt class="py-name">byte_path</tt> <tt class="py-op">=</tt> <tt class="py-name">path</tt> </tt>
<a name="L1461"></a><tt class="py-lineno">1461</tt>  <tt class="py-line"> </tt>
<a name="L1462"></a><tt class="py-lineno">1462</tt>  <tt class="py-line">        <tt class="py-name">wd_</tt> <tt class="py-op">=</tt> <tt id="link-249" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-249', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">inotify_add_watch</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> </tt>
<a name="L1463"></a><tt class="py-lineno">1463</tt>  <tt class="py-line">                                     <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">create_string_buffer</tt><tt class="py-op">(</tt><tt class="py-name">byte_path</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1464"></a><tt class="py-lineno">1464</tt>  <tt class="py-line">                                     <tt class="py-name">mask</tt><tt class="py-op">)</tt> </tt>
<a name="L1465"></a><tt class="py-lineno">1465</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">wd_</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1466"></a><tt class="py-lineno">1466</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">wd_</tt> </tt>
<a name="L1467"></a><tt class="py-lineno">1467</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt id="link-250" class="py-name" targets="Class pyinotify.Watch=pyinotify.Watch-class.html"><a title="pyinotify.Watch" class="py-name" href="#" onclick="return doclink('link-250', 'Watch', 'link-250');">Watch</a></tt><tt class="py-op">(</tt><tt class="py-name">wd</tt><tt class="py-op">=</tt><tt class="py-name">wd_</tt><tt class="py-op">,</tt> <tt class="py-name">path</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">normpath</tt><tt class="py-op">(</tt><tt class="py-name">byte_path</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">mask</tt><tt class="py-op">=</tt><tt class="py-name">mask</tt><tt class="py-op">,</tt> </tt>
<a name="L1468"></a><tt class="py-lineno">1468</tt>  <tt class="py-line">                       <tt id="link-251" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-251', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">=</tt><tt id="link-252" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-252', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">,</tt> <tt class="py-name">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">auto_add</tt><tt class="py-op">)</tt> </tt>
<a name="L1469"></a><tt class="py-lineno">1469</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">[</tt><tt class="py-name">wd_</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">watch_</tt> </tt>
<a name="L1470"></a><tt class="py-lineno">1470</tt>  <tt class="py-line">        <tt id="link-253" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-253', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'New %s'</tt><tt class="py-op">,</tt> <tt class="py-name">watch_</tt><tt class="py-op">)</tt> </tt>
<a name="L1471"></a><tt class="py-lineno">1471</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">wd_</tt> </tt>
</div><a name="L1472"></a><tt class="py-lineno">1472</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.__glob"></a><div id="WatchManager.__glob-def"><a name="L1473"></a><tt class="py-lineno">1473</tt> <a class="py-toggle" href="#" id="WatchManager.__glob-toggle" onclick="return toggle('WatchManager.__glob');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#__glob">__glob</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">do_glob</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.__glob-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__glob-expanded"><a name="L1474"></a><tt class="py-lineno">1474</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">do_glob</tt><tt class="py-op">:</tt> </tt>
<a name="L1475"></a><tt class="py-lineno">1475</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt id="link-254" class="py-name"><a title="pyinotify.iglob" class="py-name" href="#" onclick="return doclink('link-254', 'iglob', 'link-45');">iglob</a></tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1476"></a><tt class="py-lineno">1476</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1477"></a><tt class="py-lineno">1477</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">path</tt><tt class="py-op">]</tt> </tt>
</div><a name="L1478"></a><tt class="py-lineno">1478</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.add_watch"></a><div id="WatchManager.add_watch-def"><a name="L1479"></a><tt class="py-lineno">1479</tt> <a class="py-toggle" href="#" id="WatchManager.add_watch-toggle" onclick="return toggle('WatchManager.add_watch');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#add_watch">add_watch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">mask</tt><tt class="py-op">,</tt> <tt class="py-param">proc_fun</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">rec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> </tt>
<a name="L1480"></a><tt class="py-lineno">1480</tt>  <tt class="py-line">                  <tt class="py-param">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">do_glob</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">quiet</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> </tt>
<a name="L1481"></a><tt class="py-lineno">1481</tt>  <tt class="py-line">                  <tt class="py-param">exclude_filter</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="WatchManager.add_watch-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.add_watch-expanded"><a name="L1482"></a><tt class="py-lineno">1482</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1483"></a><tt class="py-lineno">1483</tt>  <tt class="py-line"><tt class="py-docstring">        Add watch(s) on given |path|(s) with the specified |mask| and</tt> </tt>
<a name="L1484"></a><tt class="py-lineno">1484</tt>  <tt class="py-line"><tt class="py-docstring">        optionnally with a processing |proc_fun| function and a recursive</tt> </tt>
<a name="L1485"></a><tt class="py-lineno">1485</tt>  <tt class="py-line"><tt class="py-docstring">        flag |rec|.</tt> </tt>
<a name="L1486"></a><tt class="py-lineno">1486</tt>  <tt class="py-line"><tt class="py-docstring">        Ideally |path| components should not be unicode objects. Note</tt> </tt>
<a name="L1487"></a><tt class="py-lineno">1487</tt>  <tt class="py-line"><tt class="py-docstring">        that unicode paths are accepted but are converted to byte strings</tt> </tt>
<a name="L1488"></a><tt class="py-lineno">1488</tt>  <tt class="py-line"><tt class="py-docstring">        before a watch is put on the path. The encoding used for converting</tt> </tt>
<a name="L1489"></a><tt class="py-lineno">1489</tt>  <tt class="py-line"><tt class="py-docstring">        the unicode object is given by sys.getfilesystemencoding().</tt> </tt>
<a name="L1490"></a><tt class="py-lineno">1490</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1491"></a><tt class="py-lineno">1491</tt>  <tt class="py-line"><tt class="py-docstring">        @param path: Path to watch, the path can either be a file or a</tt> </tt>
<a name="L1492"></a><tt class="py-lineno">1492</tt>  <tt class="py-line"><tt class="py-docstring">                     directory. Also accepts a sequence (list) of paths.</tt> </tt>
<a name="L1493"></a><tt class="py-lineno">1493</tt>  <tt class="py-line"><tt class="py-docstring">        @type path: string or list of strings</tt> </tt>
<a name="L1494"></a><tt class="py-lineno">1494</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: Bitmask of events.</tt> </tt>
<a name="L1495"></a><tt class="py-lineno">1495</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L1496"></a><tt class="py-lineno">1496</tt>  <tt class="py-line"><tt class="py-docstring">        @param proc_fun: Processing object.</tt> </tt>
<a name="L1497"></a><tt class="py-lineno">1497</tt>  <tt class="py-line"><tt class="py-docstring">        @type proc_fun: function or ProcessEvent instance or instance of</tt> </tt>
<a name="L1498"></a><tt class="py-lineno">1498</tt>  <tt class="py-line"><tt class="py-docstring">                        one of its subclasses or callable object.</tt> </tt>
<a name="L1499"></a><tt class="py-lineno">1499</tt>  <tt class="py-line"><tt class="py-docstring">        @param rec: Recursively add watches from path on all its</tt> </tt>
<a name="L1500"></a><tt class="py-lineno">1500</tt>  <tt class="py-line"><tt class="py-docstring">                    subdirectories, set to False by default (doesn't</tt> </tt>
<a name="L1501"></a><tt class="py-lineno">1501</tt>  <tt class="py-line"><tt class="py-docstring">                    follows symlinks).</tt> </tt>
<a name="L1502"></a><tt class="py-lineno">1502</tt>  <tt class="py-line"><tt class="py-docstring">        @type rec: bool</tt> </tt>
<a name="L1503"></a><tt class="py-lineno">1503</tt>  <tt class="py-line"><tt class="py-docstring">        @param auto_add: Automatically add watches on newly created</tt> </tt>
<a name="L1504"></a><tt class="py-lineno">1504</tt>  <tt class="py-line"><tt class="py-docstring">                         directories in the watch's path.</tt> </tt>
<a name="L1505"></a><tt class="py-lineno">1505</tt>  <tt class="py-line"><tt class="py-docstring">        @type auto_add: bool</tt> </tt>
<a name="L1506"></a><tt class="py-lineno">1506</tt>  <tt class="py-line"><tt class="py-docstring">        @param do_glob: Do globbing on pathname.</tt> </tt>
<a name="L1507"></a><tt class="py-lineno">1507</tt>  <tt class="py-line"><tt class="py-docstring">        @type do_glob: bool</tt> </tt>
<a name="L1508"></a><tt class="py-lineno">1508</tt>  <tt class="py-line"><tt class="py-docstring">        @param quiet: if False raises a WatchManagerError exception on</tt> </tt>
<a name="L1509"></a><tt class="py-lineno">1509</tt>  <tt class="py-line"><tt class="py-docstring">                      error. See example not_quiet.py</tt> </tt>
<a name="L1510"></a><tt class="py-lineno">1510</tt>  <tt class="py-line"><tt class="py-docstring">        @type quiet: bool</tt> </tt>
<a name="L1511"></a><tt class="py-lineno">1511</tt>  <tt class="py-line"><tt class="py-docstring">        @param exclude_filter: boolean function, returns True if current</tt> </tt>
<a name="L1512"></a><tt class="py-lineno">1512</tt>  <tt class="py-line"><tt class="py-docstring">                               path must be excluded from being watched.</tt> </tt>
<a name="L1513"></a><tt class="py-lineno">1513</tt>  <tt class="py-line"><tt class="py-docstring">                               Has precedence on exclude_filter defined</tt> </tt>
<a name="L1514"></a><tt class="py-lineno">1514</tt>  <tt class="py-line"><tt class="py-docstring">                               into __init__.</tt> </tt>
<a name="L1515"></a><tt class="py-lineno">1515</tt>  <tt class="py-line"><tt class="py-docstring">        @type exclude_filter: bool</tt> </tt>
<a name="L1516"></a><tt class="py-lineno">1516</tt>  <tt class="py-line"><tt class="py-docstring">        @return: dict of paths associated to watch descriptors. A wd value</tt> </tt>
<a name="L1517"></a><tt class="py-lineno">1517</tt>  <tt class="py-line"><tt class="py-docstring">                 is positive if the watch has been sucessfully added,</tt> </tt>
<a name="L1518"></a><tt class="py-lineno">1518</tt>  <tt class="py-line"><tt class="py-docstring">                 otherwise the value is negative. If the path is invalid</tt> </tt>
<a name="L1519"></a><tt class="py-lineno">1519</tt>  <tt class="py-line"><tt class="py-docstring">                 it will be not included into this dict.</tt> </tt>
<a name="L1520"></a><tt class="py-lineno">1520</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: dict of {str: int}</tt> </tt>
<a name="L1521"></a><tt class="py-lineno">1521</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1522"></a><tt class="py-lineno">1522</tt>  <tt class="py-line">        <tt class="py-name">ret_</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> <tt class="py-comment"># return {path: wd, ...}</tt> </tt>
<a name="L1523"></a><tt class="py-lineno">1523</tt>  <tt class="py-line"> </tt>
<a name="L1524"></a><tt class="py-lineno">1524</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">exclude_filter</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1525"></a><tt class="py-lineno">1525</tt>  <tt class="py-line">            <tt class="py-name">exclude_filter</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_exclude_filter</tt> </tt>
<a name="L1526"></a><tt class="py-lineno">1526</tt>  <tt class="py-line"> </tt>
<a name="L1527"></a><tt class="py-lineno">1527</tt>  <tt class="py-line">        <tt class="py-comment"># normalize args as list elements</tt> </tt>
<a name="L1528"></a><tt class="py-lineno">1528</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">npath</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-255" class="py-name" targets="Method pyinotify.WatchManager.__format_param()=pyinotify.WatchManager-class.html#__format_param"><a title="pyinotify.WatchManager.__format_param" class="py-name" href="#" onclick="return doclink('link-255', '__format_param', 'link-255');">__format_param</a></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="L1529"></a><tt class="py-lineno">1529</tt>  <tt class="py-line">            <tt class="py-comment"># unix pathname pattern expansion</tt> </tt>
<a name="L1530"></a><tt class="py-lineno">1530</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">apath</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-256" class="py-name" targets="Method pyinotify.WatchManager.__glob()=pyinotify.WatchManager-class.html#__glob"><a title="pyinotify.WatchManager.__glob" class="py-name" href="#" onclick="return doclink('link-256', '__glob', 'link-256');">__glob</a></tt><tt class="py-op">(</tt><tt class="py-name">npath</tt><tt class="py-op">,</tt> <tt class="py-name">do_glob</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1531"></a><tt class="py-lineno">1531</tt>  <tt class="py-line">                <tt class="py-comment"># recursively list subdirs according to rec param</tt> </tt>
<a name="L1532"></a><tt class="py-lineno">1532</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">rpath</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-257" class="py-name" targets="Method pyinotify.WatchManager.__walk_rec()=pyinotify.WatchManager-class.html#__walk_rec"><a title="pyinotify.WatchManager.__walk_rec" class="py-name" href="#" onclick="return doclink('link-257', '__walk_rec', 'link-257');">__walk_rec</a></tt><tt class="py-op">(</tt><tt class="py-name">apath</tt><tt class="py-op">,</tt> <tt class="py-name">rec</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1533"></a><tt class="py-lineno">1533</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">exclude_filter</tt><tt class="py-op">(</tt><tt class="py-name">rpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1534"></a><tt class="py-lineno">1534</tt>  <tt class="py-line">                        <tt class="py-name">wd</tt> <tt class="py-op">=</tt> <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">rpath</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-258" class="py-name" targets="Method pyinotify.WatchManager.__add_watch()=pyinotify.WatchManager-class.html#__add_watch"><a title="pyinotify.WatchManager.__add_watch" class="py-name" href="#" onclick="return doclink('link-258', '__add_watch', 'link-258');">__add_watch</a></tt><tt class="py-op">(</tt><tt class="py-name">rpath</tt><tt class="py-op">,</tt> <tt class="py-name">mask</tt><tt class="py-op">,</tt> </tt>
<a name="L1535"></a><tt class="py-lineno">1535</tt>  <tt class="py-line">                                                            <tt id="link-259" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-259', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1536"></a><tt class="py-lineno">1536</tt>  <tt class="py-line">                                                            <tt class="py-name">auto_add</tt><tt class="py-op">)</tt> </tt>
<a name="L1537"></a><tt class="py-lineno">1537</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">wd</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1538"></a><tt class="py-lineno">1538</tt>  <tt class="py-line">                            <tt class="py-name">err</tt> <tt class="py-op">=</tt> <tt class="py-string">'add_watch: cannot watch %s (WD=%d)'</tt> </tt>
<a name="L1539"></a><tt class="py-lineno">1539</tt>  <tt class="py-line">                            <tt class="py-name">err</tt> <tt class="py-op">=</tt> <tt class="py-name">err</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">rpath</tt><tt class="py-op">,</tt> <tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L1540"></a><tt class="py-lineno">1540</tt>  <tt class="py-line">                            <tt class="py-keyword">if</tt> <tt class="py-name">quiet</tt><tt class="py-op">:</tt> </tt>
<a name="L1541"></a><tt class="py-lineno">1541</tt>  <tt class="py-line">                                <tt id="link-260" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-260', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
<a name="L1542"></a><tt class="py-lineno">1542</tt>  <tt class="py-line">                            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1543"></a><tt class="py-lineno">1543</tt>  <tt class="py-line">                                <tt class="py-keyword">raise</tt> <tt id="link-261" class="py-name" targets="Class pyinotify.WatchManagerError=pyinotify.WatchManagerError-class.html"><a title="pyinotify.WatchManagerError" class="py-name" href="#" onclick="return doclink('link-261', 'WatchManagerError', 'link-261');">WatchManagerError</a></tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">,</tt> <tt class="py-name">ret_</tt><tt class="py-op">)</tt> </tt>
<a name="L1544"></a><tt class="py-lineno">1544</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1545"></a><tt class="py-lineno">1545</tt>  <tt class="py-line">                        <tt class="py-comment"># Let's say -2 means 'explicitely excluded</tt> </tt>
<a name="L1546"></a><tt class="py-lineno">1546</tt>  <tt class="py-line">                        <tt class="py-comment"># from watching'.</tt> </tt>
<a name="L1547"></a><tt class="py-lineno">1547</tt>  <tt class="py-line">                        <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">rpath</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-number">2</tt> </tt>
<a name="L1548"></a><tt class="py-lineno">1548</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret_</tt> </tt>
</div><a name="L1549"></a><tt class="py-lineno">1549</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.__get_sub_rec"></a><div id="WatchManager.__get_sub_rec-def"><a name="L1550"></a><tt class="py-lineno">1550</tt> <a class="py-toggle" href="#" id="WatchManager.__get_sub_rec-toggle" onclick="return toggle('WatchManager.__get_sub_rec');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#__get_sub_rec">__get_sub_rec</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.__get_sub_rec-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__get_sub_rec-expanded"><a name="L1551"></a><tt class="py-lineno">1551</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1552"></a><tt class="py-lineno">1552</tt>  <tt class="py-line"><tt class="py-docstring">        Get every wd from self._wmd if its path is under the path of</tt> </tt>
<a name="L1553"></a><tt class="py-lineno">1553</tt>  <tt class="py-line"><tt class="py-docstring">        one (at least) of those in lpath. Doesn't follow symlinks.</tt> </tt>
<a name="L1554"></a><tt class="py-lineno">1554</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1555"></a><tt class="py-lineno">1555</tt>  <tt class="py-line"><tt class="py-docstring">        @param lpath: list of watch descriptor</tt> </tt>
<a name="L1556"></a><tt class="py-lineno">1556</tt>  <tt class="py-line"><tt class="py-docstring">        @type lpath: list of int</tt> </tt>
<a name="L1557"></a><tt class="py-lineno">1557</tt>  <tt class="py-line"><tt class="py-docstring">        @return: list of watch descriptor</tt> </tt>
<a name="L1558"></a><tt class="py-lineno">1558</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: list of int</tt> </tt>
<a name="L1559"></a><tt class="py-lineno">1559</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1560"></a><tt class="py-lineno">1560</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">d</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lpath</tt><tt class="py-op">:</tt> </tt>
<a name="L1561"></a><tt class="py-lineno">1561</tt>  <tt class="py-line">            <tt class="py-name">root</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-262" class="py-name" targets="Method pyinotify.WatchManager.get_path()=pyinotify.WatchManager-class.html#get_path"><a title="pyinotify.WatchManager.get_path" class="py-name" href="#" onclick="return doclink('link-262', 'get_path', 'link-262');">get_path</a></tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">)</tt> </tt>
<a name="L1562"></a><tt class="py-lineno">1562</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">root</tt><tt class="py-op">:</tt> </tt>
<a name="L1563"></a><tt class="py-lineno">1563</tt>  <tt class="py-line">                <tt class="py-comment"># always keep root</tt> </tt>
<a name="L1564"></a><tt class="py-lineno">1564</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">d</tt> </tt>
<a name="L1565"></a><tt class="py-lineno">1565</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1566"></a><tt class="py-lineno">1566</tt>  <tt class="py-line">                <tt class="py-comment"># if invalid</tt> </tt>
<a name="L1567"></a><tt class="py-lineno">1567</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L1568"></a><tt class="py-lineno">1568</tt>  <tt class="py-line"> </tt>
<a name="L1569"></a><tt class="py-lineno">1569</tt>  <tt class="py-line">            <tt class="py-comment"># nothing else to expect</tt> </tt>
<a name="L1570"></a><tt class="py-lineno">1570</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">isdir</tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1571"></a><tt class="py-lineno">1571</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L1572"></a><tt class="py-lineno">1572</tt>  <tt class="py-line"> </tt>
<a name="L1573"></a><tt class="py-lineno">1573</tt>  <tt class="py-line">            <tt class="py-comment"># normalization</tt> </tt>
<a name="L1574"></a><tt class="py-lineno">1574</tt>  <tt class="py-line">            <tt class="py-name">root</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">normpath</tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt> </tt>
<a name="L1575"></a><tt class="py-lineno">1575</tt>  <tt class="py-line">            <tt class="py-comment"># recursion</tt> </tt>
<a name="L1576"></a><tt class="py-lineno">1576</tt>  <tt class="py-line">            <tt class="py-name">lend</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt> </tt>
<a name="L1577"></a><tt class="py-lineno">1577</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">iwd</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</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="L1578"></a><tt class="py-lineno">1578</tt>  <tt class="py-line">                <tt class="py-name">cur</tt> <tt class="py-op">=</tt> <tt class="py-name">iwd</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">path</tt> </tt>
<a name="L1579"></a><tt class="py-lineno">1579</tt>  <tt class="py-line">                <tt class="py-name">pref</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">commonprefix</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">root</tt><tt class="py-op">,</tt> <tt class="py-name">cur</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1580"></a><tt class="py-lineno">1580</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">root</tt> <tt class="py-op">==</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt> <tt class="py-keyword">or</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">pref</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">lend</tt> <tt class="py-keyword">and</tt> \ </tt>
<a name="L1581"></a><tt class="py-lineno">1581</tt>  <tt class="py-line">                                      <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">cur</tt><tt class="py-op">)</tt> <tt class="py-op">&gt;</tt> <tt class="py-name">lend</tt> <tt class="py-keyword">and</tt> \ </tt>
<a name="L1582"></a><tt class="py-lineno">1582</tt>  <tt class="py-line">                                      <tt class="py-name">cur</tt><tt class="py-op">[</tt><tt class="py-name">lend</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt><tt class="py-op">)</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">yield</tt> <tt class="py-name">iwd</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">wd</tt> </tt>
</div><a name="L1584"></a><tt class="py-lineno">1584</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.update_watch"></a><div id="WatchManager.update_watch-def"><a name="L1585"></a><tt class="py-lineno">1585</tt> <a class="py-toggle" href="#" id="WatchManager.update_watch-toggle" onclick="return toggle('WatchManager.update_watch');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#update_watch">update_watch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">wd</tt><tt class="py-op">,</tt> <tt class="py-param">mask</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">proc_fun</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">rec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> </tt>
<a name="L1586"></a><tt class="py-lineno">1586</tt>  <tt class="py-line">                     <tt class="py-param">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">quiet</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="WatchManager.update_watch-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.update_watch-expanded"><a name="L1587"></a><tt class="py-lineno">1587</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1588"></a><tt class="py-lineno">1588</tt>  <tt class="py-line"><tt class="py-docstring">        Update existing watch(s). The |mask|, the processing object</tt> </tt>
<a name="L1589"></a><tt class="py-lineno">1589</tt>  <tt class="py-line"><tt class="py-docstring">        |proc_fun|, the recursive param |rec| and the |auto_add| and</tt> </tt>
<a name="L1590"></a><tt class="py-lineno">1590</tt>  <tt class="py-line"><tt class="py-docstring">        |quiet| flags can be updated.</tt> </tt>
<a name="L1591"></a><tt class="py-lineno">1591</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1592"></a><tt class="py-lineno">1592</tt>  <tt class="py-line"><tt class="py-docstring">        @param wd: Watch Descriptor to update. Also accepts a list of</tt> </tt>
<a name="L1593"></a><tt class="py-lineno">1593</tt>  <tt class="py-line"><tt class="py-docstring">                     watch descriptors.</tt> </tt>
<a name="L1594"></a><tt class="py-lineno">1594</tt>  <tt class="py-line"><tt class="py-docstring">        @type wd: int or list of int</tt> </tt>
<a name="L1595"></a><tt class="py-lineno">1595</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: Optional new bitmask of events.</tt> </tt>
<a name="L1596"></a><tt class="py-lineno">1596</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L1597"></a><tt class="py-lineno">1597</tt>  <tt class="py-line"><tt class="py-docstring">        @param proc_fun: Optional new processing function.</tt> </tt>
<a name="L1598"></a><tt class="py-lineno">1598</tt>  <tt class="py-line"><tt class="py-docstring">        @type proc_fun: function or ProcessEvent instance or instance of</tt> </tt>
<a name="L1599"></a><tt class="py-lineno">1599</tt>  <tt class="py-line"><tt class="py-docstring">                        one of its subclasses or callable object.</tt> </tt>
<a name="L1600"></a><tt class="py-lineno">1600</tt>  <tt class="py-line"><tt class="py-docstring">        @param rec: Recursively update watches on every already watched</tt> </tt>
<a name="L1601"></a><tt class="py-lineno">1601</tt>  <tt class="py-line"><tt class="py-docstring">                    subdirectories and subfiles.</tt> </tt>
<a name="L1602"></a><tt class="py-lineno">1602</tt>  <tt class="py-line"><tt class="py-docstring">        @type rec: bool</tt> </tt>
<a name="L1603"></a><tt class="py-lineno">1603</tt>  <tt class="py-line"><tt class="py-docstring">        @param auto_add: Automatically add watches on newly created</tt> </tt>
<a name="L1604"></a><tt class="py-lineno">1604</tt>  <tt class="py-line"><tt class="py-docstring">                         directories in the watch's path.</tt> </tt>
<a name="L1605"></a><tt class="py-lineno">1605</tt>  <tt class="py-line"><tt class="py-docstring">        @type auto_add: bool</tt> </tt>
<a name="L1606"></a><tt class="py-lineno">1606</tt>  <tt class="py-line"><tt class="py-docstring">        @param quiet: if False raises a WatchManagerError exception on</tt> </tt>
<a name="L1607"></a><tt class="py-lineno">1607</tt>  <tt class="py-line"><tt class="py-docstring">                      error. See example not_quiet.py</tt> </tt>
<a name="L1608"></a><tt class="py-lineno">1608</tt>  <tt class="py-line"><tt class="py-docstring">        @type quiet: bool</tt> </tt>
<a name="L1609"></a><tt class="py-lineno">1609</tt>  <tt class="py-line"><tt class="py-docstring">        @return: dict of watch descriptors associated to booleans values.</tt> </tt>
<a name="L1610"></a><tt class="py-lineno">1610</tt>  <tt class="py-line"><tt class="py-docstring">                 True if the corresponding wd has been successfully</tt> </tt>
<a name="L1611"></a><tt class="py-lineno">1611</tt>  <tt class="py-line"><tt class="py-docstring">                 updated, False otherwise.</tt> </tt>
<a name="L1612"></a><tt class="py-lineno">1612</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: dict of int: bool</tt> </tt>
<a name="L1613"></a><tt class="py-lineno">1613</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1614"></a><tt class="py-lineno">1614</tt>  <tt class="py-line">        <tt class="py-name">lwd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-263" class="py-name"><a title="pyinotify.WatchManager.__format_param" class="py-name" href="#" onclick="return doclink('link-263', '__format_param', 'link-255');">__format_param</a></tt><tt class="py-op">(</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L1615"></a><tt class="py-lineno">1615</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt><tt class="py-op">:</tt> </tt>
<a name="L1616"></a><tt class="py-lineno">1616</tt>  <tt class="py-line">            <tt class="py-name">lwd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-264" class="py-name" targets="Method pyinotify.WatchManager.__get_sub_rec()=pyinotify.WatchManager-class.html#__get_sub_rec"><a title="pyinotify.WatchManager.__get_sub_rec" class="py-name" href="#" onclick="return doclink('link-264', '__get_sub_rec', 'link-264');">__get_sub_rec</a></tt><tt class="py-op">(</tt><tt class="py-name">lwd</tt><tt class="py-op">)</tt> </tt>
<a name="L1617"></a><tt class="py-lineno">1617</tt>  <tt class="py-line"> </tt>
<a name="L1618"></a><tt class="py-lineno">1618</tt>  <tt class="py-line">        <tt class="py-name">ret_</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># return {wd: bool, ...}</tt> </tt>
<a name="L1619"></a><tt class="py-lineno">1619</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">awd</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lwd</tt><tt class="py-op">:</tt> </tt>
<a name="L1620"></a><tt class="py-lineno">1620</tt>  <tt class="py-line">            <tt class="py-name">apath</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-265" class="py-name"><a title="pyinotify.WatchManager.get_path" class="py-name" href="#" onclick="return doclink('link-265', 'get_path', 'link-262');">get_path</a></tt><tt class="py-op">(</tt><tt class="py-name">awd</tt><tt class="py-op">)</tt> </tt>
<a name="L1621"></a><tt class="py-lineno">1621</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">apath</tt> <tt class="py-keyword">or</tt> <tt class="py-name">awd</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1622"></a><tt class="py-lineno">1622</tt>  <tt class="py-line">                <tt class="py-name">err</tt> <tt class="py-op">=</tt> <tt class="py-string">'update_watch: invalid WD=%d'</tt> <tt class="py-op">%</tt> <tt class="py-name">awd</tt> </tt>
<a name="L1623"></a><tt class="py-lineno">1623</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">quiet</tt><tt class="py-op">:</tt> </tt>
<a name="L1624"></a><tt class="py-lineno">1624</tt>  <tt class="py-line">                    <tt id="link-266" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-266', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
<a name="L1625"></a><tt class="py-lineno">1625</tt>  <tt class="py-line">                    <tt class="py-keyword">continue</tt> </tt>
<a name="L1626"></a><tt class="py-lineno">1626</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-267" class="py-name"><a title="pyinotify.WatchManagerError" class="py-name" href="#" onclick="return doclink('link-267', 'WatchManagerError', 'link-261');">WatchManagerError</a></tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">,</tt> <tt class="py-name">ret_</tt><tt class="py-op">)</tt> </tt>
<a name="L1627"></a><tt class="py-lineno">1627</tt>  <tt class="py-line"> </tt>
<a name="L1628"></a><tt class="py-lineno">1628</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">mask</tt><tt class="py-op">:</tt> </tt>
<a name="L1629"></a><tt class="py-lineno">1629</tt>  <tt class="py-line">                <tt class="py-name">addw</tt> <tt class="py-op">=</tt> <tt id="link-268" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-268', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">inotify_add_watch</tt> </tt>
<a name="L1630"></a><tt class="py-lineno">1630</tt>  <tt class="py-line">                <tt class="py-name">wd_</tt> <tt class="py-op">=</tt> <tt class="py-name">addw</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">create_string_buffer</tt><tt class="py-op">(</tt><tt class="py-name">apath</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">mask</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">if</tt> <tt class="py-name">wd_</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1632"></a><tt class="py-lineno">1632</tt>  <tt class="py-line">                    <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L1633"></a><tt class="py-lineno">1633</tt>  <tt class="py-line">                    <tt class="py-name">err</tt> <tt class="py-op">=</tt> <tt class="py-string">'update_watch: cannot update WD=%d (%s)'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">wd_</tt><tt class="py-op">,</tt> </tt>
<a name="L1634"></a><tt class="py-lineno">1634</tt>  <tt class="py-line">                                                                      <tt class="py-name">apath</tt><tt class="py-op">)</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">quiet</tt><tt class="py-op">:</tt> </tt>
<a name="L1636"></a><tt class="py-lineno">1636</tt>  <tt class="py-line">                        <tt id="link-269" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-269', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
<a name="L1637"></a><tt class="py-lineno">1637</tt>  <tt class="py-line">                        <tt class="py-keyword">continue</tt> </tt>
<a name="L1638"></a><tt class="py-lineno">1638</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> <tt id="link-270" class="py-name"><a title="pyinotify.WatchManagerError" class="py-name" href="#" onclick="return doclink('link-270', 'WatchManagerError', 'link-261');">WatchManagerError</a></tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">,</tt> <tt class="py-name">ret_</tt><tt class="py-op">)</tt> </tt>
<a name="L1639"></a><tt class="py-lineno">1639</tt>  <tt class="py-line"> </tt>
<a name="L1640"></a><tt class="py-lineno">1640</tt>  <tt class="py-line">                <tt class="py-keyword">assert</tt><tt class="py-op">(</tt><tt class="py-name">awd</tt> <tt class="py-op">==</tt> <tt class="py-name">wd_</tt><tt class="py-op">)</tt> </tt>
<a name="L1641"></a><tt class="py-lineno">1641</tt>  <tt class="py-line"> </tt>
<a name="L1642"></a><tt class="py-lineno">1642</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-271" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-271', 'proc_fun', 'link-141');">proc_fun</a></tt> <tt class="py-keyword">or</tt> <tt class="py-name">auto_add</tt><tt class="py-op">:</tt> </tt>
<a name="L1643"></a><tt class="py-lineno">1643</tt>  <tt class="py-line">                <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt> </tt>
<a name="L1644"></a><tt class="py-lineno">1644</tt>  <tt class="py-line"> </tt>
<a name="L1645"></a><tt class="py-lineno">1645</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-272" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-272', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1646"></a><tt class="py-lineno">1646</tt>  <tt class="py-line">                <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt id="link-273" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-273', 'proc_fun', 'link-141');">proc_fun</a></tt> <tt class="py-op">=</tt> <tt id="link-274" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-274', 'proc_fun', 'link-141');">proc_fun</a></tt> </tt>
<a name="L1647"></a><tt class="py-lineno">1647</tt>  <tt class="py-line"> </tt>
<a name="L1648"></a><tt class="py-lineno">1648</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">auto_add</tt><tt class="py-op">:</tt> </tt>
<a name="L1649"></a><tt class="py-lineno">1649</tt>  <tt class="py-line">                <tt class="py-name">watch_</tt><tt class="py-op">.</tt><tt id="link-275" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-275', 'proc_fun', 'link-141');">proc_fun</a></tt> <tt class="py-op">=</tt> <tt class="py-name">auto_add</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>  <tt class="py-line">            <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L1652"></a><tt class="py-lineno">1652</tt>  <tt class="py-line">            <tt id="link-276" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-276', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'Updated watch - %s'</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1653"></a><tt class="py-lineno">1653</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret_</tt> </tt>
</div><a name="L1654"></a><tt class="py-lineno">1654</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.__format_param"></a><div id="WatchManager.__format_param-def"><a name="L1655"></a><tt class="py-lineno">1655</tt> <a class="py-toggle" href="#" id="WatchManager.__format_param-toggle" onclick="return toggle('WatchManager.__format_param');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#__format_param">__format_param</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">param</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.__format_param-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__format_param-expanded"><a name="L1656"></a><tt class="py-lineno">1656</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1657"></a><tt class="py-lineno">1657</tt>  <tt class="py-line"><tt class="py-docstring">        @param param: Parameter.</tt> </tt>
<a name="L1658"></a><tt class="py-lineno">1658</tt>  <tt class="py-line"><tt class="py-docstring">        @type param: string or int</tt> </tt>
<a name="L1659"></a><tt class="py-lineno">1659</tt>  <tt class="py-line"><tt class="py-docstring">        @return: wrap param.</tt> </tt>
<a name="L1660"></a><tt class="py-lineno">1660</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: list of type(param)</tt> </tt>
<a name="L1661"></a><tt class="py-lineno">1661</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1662"></a><tt class="py-lineno">1662</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">param</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1663"></a><tt class="py-lineno">1663</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">p_</tt> <tt class="py-keyword">in</tt> <tt class="py-name">param</tt><tt class="py-op">:</tt> </tt>
<a name="L1664"></a><tt class="py-lineno">1664</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">p_</tt> </tt>
<a name="L1665"></a><tt class="py-lineno">1665</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1666"></a><tt class="py-lineno">1666</tt>  <tt class="py-line">            <tt class="py-keyword">yield</tt> <tt class="py-name">param</tt> </tt>
</div><a name="L1667"></a><tt class="py-lineno">1667</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.get_wd"></a><div id="WatchManager.get_wd-def"><a name="L1668"></a><tt class="py-lineno">1668</tt> <a class="py-toggle" href="#" id="WatchManager.get_wd-toggle" onclick="return toggle('WatchManager.get_wd');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#get_wd">get_wd</a><tt class="py-op">(</tt><tt class="py-param">self</tt><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="WatchManager.get_wd-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.get_wd-expanded"><a name="L1669"></a><tt class="py-lineno">1669</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1670"></a><tt class="py-lineno">1670</tt>  <tt class="py-line"><tt class="py-docstring">        Returns the watch descriptor associated to path. This method</tt> </tt>
<a name="L1671"></a><tt class="py-lineno">1671</tt>  <tt class="py-line"><tt class="py-docstring">        has an prohibitive cost, always prefer to keep the WD.</tt> </tt>
<a name="L1672"></a><tt class="py-lineno">1672</tt>  <tt class="py-line"><tt class="py-docstring">        If path is unknown None is returned.</tt> </tt>
<a name="L1673"></a><tt class="py-lineno">1673</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1674"></a><tt class="py-lineno">1674</tt>  <tt class="py-line"><tt class="py-docstring">        @param path: path.</tt> </tt>
<a name="L1675"></a><tt class="py-lineno">1675</tt>  <tt class="py-line"><tt class="py-docstring">        @type path: str</tt> </tt>
<a name="L1676"></a><tt class="py-lineno">1676</tt>  <tt class="py-line"><tt class="py-docstring">        @return: WD or None.</tt> </tt>
<a name="L1677"></a><tt class="py-lineno">1677</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: int or None</tt> </tt>
<a name="L1678"></a><tt class="py-lineno">1678</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1679"></a><tt class="py-lineno">1679</tt>  <tt class="py-line">        <tt class="py-name">path</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">normpath</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1680"></a><tt class="py-lineno">1680</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">iwd</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">iteritems</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1681"></a><tt class="py-lineno">1681</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">iwd</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">path</tt> <tt class="py-op">==</tt> <tt class="py-name">path</tt><tt class="py-op">:</tt> </tt>
<a name="L1682"></a><tt class="py-lineno">1682</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">iwd</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1683"></a><tt class="py-lineno">1683</tt>  <tt class="py-line">        <tt id="link-277" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-277', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'get_wd: unknown path %s'</tt><tt class="py-op">,</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1684"></a><tt class="py-lineno">1684</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.get_path"></a><div id="WatchManager.get_path-def"><a name="L1685"></a><tt class="py-lineno">1685</tt> <a class="py-toggle" href="#" id="WatchManager.get_path-toggle" onclick="return toggle('WatchManager.get_path');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#get_path">get_path</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">wd</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.get_path-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.get_path-expanded"><a name="L1686"></a><tt class="py-lineno">1686</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1687"></a><tt class="py-lineno">1687</tt>  <tt class="py-line"><tt class="py-docstring">        Returns the path associated to WD, if WD is unknown</tt> </tt>
<a name="L1688"></a><tt class="py-lineno">1688</tt>  <tt class="py-line"><tt class="py-docstring">        None is returned.</tt> </tt>
<a name="L1689"></a><tt class="py-lineno">1689</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1690"></a><tt class="py-lineno">1690</tt>  <tt class="py-line"><tt class="py-docstring">        @param wd: watch descriptor.</tt> </tt>
<a name="L1691"></a><tt class="py-lineno">1691</tt>  <tt class="py-line"><tt class="py-docstring">        @type wd: int</tt> </tt>
<a name="L1692"></a><tt class="py-lineno">1692</tt>  <tt class="py-line"><tt class="py-docstring">        @return: path or None.</tt> </tt>
<a name="L1693"></a><tt class="py-lineno">1693</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: string or None</tt> </tt>
<a name="L1694"></a><tt class="py-lineno">1694</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1695"></a><tt class="py-lineno">1695</tt>  <tt class="py-line">        <tt class="py-name">watch_</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_wmd</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L1696"></a><tt class="py-lineno">1696</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">watch_</tt><tt class="py-op">:</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">watch_</tt><tt class="py-op">.</tt><tt class="py-name">path</tt> </tt>
<a name="L1698"></a><tt class="py-lineno">1698</tt>  <tt class="py-line">        <tt id="link-278" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-278', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'get_path: unknown WD %d'</tt><tt class="py-op">,</tt> <tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1699"></a><tt class="py-lineno">1699</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.__walk_rec"></a><div id="WatchManager.__walk_rec-def"><a name="L1700"></a><tt class="py-lineno">1700</tt> <a class="py-toggle" href="#" id="WatchManager.__walk_rec-toggle" onclick="return toggle('WatchManager.__walk_rec');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#__walk_rec">__walk_rec</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">top</tt><tt class="py-op">,</tt> <tt class="py-param">rec</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.__walk_rec-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.__walk_rec-expanded"><a name="L1701"></a><tt class="py-lineno">1701</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1702"></a><tt class="py-lineno">1702</tt>  <tt class="py-line"><tt class="py-docstring">        Yields each subdirectories of top, doesn't follow symlinks.</tt> </tt>
<a name="L1703"></a><tt class="py-lineno">1703</tt>  <tt class="py-line"><tt class="py-docstring">        If rec is false, only yield top.</tt> </tt>
<a name="L1704"></a><tt class="py-lineno">1704</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1705"></a><tt class="py-lineno">1705</tt>  <tt class="py-line"><tt class="py-docstring">        @param top: root directory.</tt> </tt>
<a name="L1706"></a><tt class="py-lineno">1706</tt>  <tt class="py-line"><tt class="py-docstring">        @type top: string</tt> </tt>
<a name="L1707"></a><tt class="py-lineno">1707</tt>  <tt class="py-line"><tt class="py-docstring">        @param rec: recursive flag.</tt> </tt>
<a name="L1708"></a><tt class="py-lineno">1708</tt>  <tt class="py-line"><tt class="py-docstring">        @type rec: bool</tt> </tt>
<a name="L1709"></a><tt class="py-lineno">1709</tt>  <tt class="py-line"><tt class="py-docstring">        @return: path of one subdirectory.</tt> </tt>
<a name="L1710"></a><tt class="py-lineno">1710</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: string</tt> </tt>
<a name="L1711"></a><tt class="py-lineno">1711</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1712"></a><tt class="py-lineno">1712</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">or</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">top</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</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">isdir</tt><tt class="py-op">(</tt><tt class="py-name">top</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1713"></a><tt class="py-lineno">1713</tt>  <tt class="py-line">            <tt class="py-keyword">yield</tt> <tt class="py-name">top</tt> </tt>
<a name="L1714"></a><tt class="py-lineno">1714</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1715"></a><tt class="py-lineno">1715</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">root</tt><tt class="py-op">,</tt> <tt class="py-name">dirs</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">walk</tt><tt class="py-op">(</tt><tt class="py-name">top</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1716"></a><tt class="py-lineno">1716</tt>  <tt class="py-line">                <tt class="py-keyword">yield</tt> <tt class="py-name">root</tt> </tt>
</div><a name="L1717"></a><tt class="py-lineno">1717</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.rm_watch"></a><div id="WatchManager.rm_watch-def"><a name="L1718"></a><tt class="py-lineno">1718</tt> <a class="py-toggle" href="#" id="WatchManager.rm_watch-toggle" onclick="return toggle('WatchManager.rm_watch');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#rm_watch">rm_watch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">wd</tt><tt class="py-op">,</tt> <tt class="py-param">rec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">quiet</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="WatchManager.rm_watch-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.rm_watch-expanded"><a name="L1719"></a><tt class="py-lineno">1719</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1720"></a><tt class="py-lineno">1720</tt>  <tt class="py-line"><tt class="py-docstring">        Removes watch(s).</tt> </tt>
<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">        @param wd: Watch Descriptor of the file or directory to unwatch.</tt> </tt>
<a name="L1723"></a><tt class="py-lineno">1723</tt>  <tt class="py-line"><tt class="py-docstring">                   Also accepts a list of WDs.</tt> </tt>
<a name="L1724"></a><tt class="py-lineno">1724</tt>  <tt class="py-line"><tt class="py-docstring">        @type wd: int or list of int.</tt> </tt>
<a name="L1725"></a><tt class="py-lineno">1725</tt>  <tt class="py-line"><tt class="py-docstring">        @param rec: Recursively removes watches on every already watched</tt> </tt>
<a name="L1726"></a><tt class="py-lineno">1726</tt>  <tt class="py-line"><tt class="py-docstring">                    subdirectories and subfiles.</tt> </tt>
<a name="L1727"></a><tt class="py-lineno">1727</tt>  <tt class="py-line"><tt class="py-docstring">        @type rec: bool</tt> </tt>
<a name="L1728"></a><tt class="py-lineno">1728</tt>  <tt class="py-line"><tt class="py-docstring">        @param quiet: if False raises a WatchManagerError exception on</tt> </tt>
<a name="L1729"></a><tt class="py-lineno">1729</tt>  <tt class="py-line"><tt class="py-docstring">                      error. See example not_quiet.py</tt> </tt>
<a name="L1730"></a><tt class="py-lineno">1730</tt>  <tt class="py-line"><tt class="py-docstring">        @type quiet: bool</tt> </tt>
<a name="L1731"></a><tt class="py-lineno">1731</tt>  <tt class="py-line"><tt class="py-docstring">        @return: dict of watch descriptors associated to booleans values.</tt> </tt>
<a name="L1732"></a><tt class="py-lineno">1732</tt>  <tt class="py-line"><tt class="py-docstring">                 True if the corresponding wd has been successfully</tt> </tt>
<a name="L1733"></a><tt class="py-lineno">1733</tt>  <tt class="py-line"><tt class="py-docstring">                 removed, False otherwise.</tt> </tt>
<a name="L1734"></a><tt class="py-lineno">1734</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: dict of int: bool</tt> </tt>
<a name="L1735"></a><tt class="py-lineno">1735</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1736"></a><tt class="py-lineno">1736</tt>  <tt class="py-line">        <tt class="py-name">lwd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-279" class="py-name"><a title="pyinotify.WatchManager.__format_param" class="py-name" href="#" onclick="return doclink('link-279', '__format_param', 'link-255');">__format_param</a></tt><tt class="py-op">(</tt><tt class="py-name">wd</tt><tt class="py-op">)</tt> </tt>
<a name="L1737"></a><tt class="py-lineno">1737</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt><tt class="py-op">:</tt> </tt>
<a name="L1738"></a><tt class="py-lineno">1738</tt>  <tt class="py-line">            <tt class="py-name">lwd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-280" class="py-name"><a title="pyinotify.WatchManager.__get_sub_rec" class="py-name" href="#" onclick="return doclink('link-280', '__get_sub_rec', 'link-264');">__get_sub_rec</a></tt><tt class="py-op">(</tt><tt class="py-name">lwd</tt><tt class="py-op">)</tt> </tt>
<a name="L1739"></a><tt class="py-lineno">1739</tt>  <tt class="py-line"> </tt>
<a name="L1740"></a><tt class="py-lineno">1740</tt>  <tt class="py-line">        <tt class="py-name">ret_</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># return {wd: bool, ...}</tt> </tt>
<a name="L1741"></a><tt class="py-lineno">1741</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">awd</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lwd</tt><tt class="py-op">:</tt> </tt>
<a name="L1742"></a><tt class="py-lineno">1742</tt>  <tt class="py-line">            <tt class="py-comment"># remove watch</tt> </tt>
<a name="L1743"></a><tt class="py-lineno">1743</tt>  <tt class="py-line">            <tt class="py-name">wd_</tt> <tt class="py-op">=</tt> <tt id="link-281" class="py-name"><a title="pyinotify.LIBC" class="py-name" href="#" onclick="return doclink('link-281', 'LIBC', 'link-7');">LIBC</a></tt><tt class="py-op">.</tt><tt class="py-name">inotify_rm_watch</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_fd</tt><tt class="py-op">,</tt> <tt class="py-name">awd</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">if</tt> <tt class="py-name">wd_</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L1745"></a><tt class="py-lineno">1745</tt>  <tt class="py-line">                <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L1746"></a><tt class="py-lineno">1746</tt>  <tt class="py-line">                <tt class="py-name">err</tt> <tt class="py-op">=</tt> <tt class="py-string">'rm_watch: cannot remove WD=%d'</tt> <tt class="py-op">%</tt> <tt class="py-name">awd</tt> </tt>
<a name="L1747"></a><tt class="py-lineno">1747</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">quiet</tt><tt class="py-op">:</tt> </tt>
<a name="L1748"></a><tt class="py-lineno">1748</tt>  <tt class="py-line">                    <tt id="link-282" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-282', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">)</tt> </tt>
<a name="L1749"></a><tt class="py-lineno">1749</tt>  <tt class="py-line">                    <tt class="py-keyword">continue</tt> </tt>
<a name="L1750"></a><tt class="py-lineno">1750</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-283" class="py-name"><a title="pyinotify.WatchManagerError" class="py-name" href="#" onclick="return doclink('link-283', 'WatchManagerError', 'link-261');">WatchManagerError</a></tt><tt class="py-op">(</tt><tt class="py-name">err</tt><tt class="py-op">,</tt> <tt class="py-name">ret_</tt><tt class="py-op">)</tt> </tt>
<a name="L1751"></a><tt class="py-lineno">1751</tt>  <tt class="py-line"> </tt>
<a name="L1752"></a><tt class="py-lineno">1752</tt>  <tt class="py-line">            <tt class="py-name">ret_</tt><tt class="py-op">[</tt><tt class="py-name">awd</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L1753"></a><tt class="py-lineno">1753</tt>  <tt class="py-line">            <tt id="link-284" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-284', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'watch WD=%d (%s) removed'</tt><tt class="py-op">,</tt> <tt class="py-name">awd</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-285" class="py-name"><a title="pyinotify.WatchManager.get_path" class="py-name" href="#" onclick="return doclink('link-285', 'get_path', 'link-262');">get_path</a></tt><tt class="py-op">(</tt><tt class="py-name">awd</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1754"></a><tt class="py-lineno">1754</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret_</tt> </tt>
</div><a name="L1755"></a><tt class="py-lineno">1755</tt>  <tt class="py-line"> </tt>
<a name="L1756"></a><tt class="py-lineno">1756</tt>  <tt class="py-line"> </tt>
<a name="WatchManager.watch_transient_file"></a><div id="WatchManager.watch_transient_file-def"><a name="L1757"></a><tt class="py-lineno">1757</tt> <a class="py-toggle" href="#" id="WatchManager.watch_transient_file-toggle" onclick="return toggle('WatchManager.watch_transient_file');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.WatchManager-class.html#watch_transient_file">watch_transient_file</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">mask</tt><tt class="py-op">,</tt> <tt class="py-param">proc_class</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WatchManager.watch_transient_file-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="WatchManager.watch_transient_file-expanded"><a name="L1758"></a><tt class="py-lineno">1758</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1759"></a><tt class="py-lineno">1759</tt>  <tt class="py-line"><tt class="py-docstring">        Watch a transient file, which will be created and deleted frequently</tt> </tt>
<a name="L1760"></a><tt class="py-lineno">1760</tt>  <tt class="py-line"><tt class="py-docstring">        over time (e.g. pid file).</tt> </tt>
<a name="L1761"></a><tt class="py-lineno">1761</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1762"></a><tt class="py-lineno">1762</tt>  <tt class="py-line"><tt class="py-docstring">        @attention: Under the call to this function it will be impossible</tt> </tt>
<a name="L1763"></a><tt class="py-lineno">1763</tt>  <tt class="py-line"><tt class="py-docstring">        to correctly watch the events triggered into the same</tt> </tt>
<a name="L1764"></a><tt class="py-lineno">1764</tt>  <tt class="py-line"><tt class="py-docstring">        base directory than the directory where is located this watched</tt> </tt>
<a name="L1765"></a><tt class="py-lineno">1765</tt>  <tt class="py-line"><tt class="py-docstring">        transient file. For instance it would actually be wrong to make these</tt> </tt>
<a name="L1766"></a><tt class="py-lineno">1766</tt>  <tt class="py-line"><tt class="py-docstring">        two successive calls: wm.watch_transient_file('/var/run/foo.pid', ...)</tt> </tt>
<a name="L1767"></a><tt class="py-lineno">1767</tt>  <tt class="py-line"><tt class="py-docstring">        and wm.add_watch('/var/run/', ...)</tt> </tt>
<a name="L1768"></a><tt class="py-lineno">1768</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1769"></a><tt class="py-lineno">1769</tt>  <tt class="py-line"><tt class="py-docstring">        @param filename: Filename.</tt> </tt>
<a name="L1770"></a><tt class="py-lineno">1770</tt>  <tt class="py-line"><tt class="py-docstring">        @type filename: string</tt> </tt>
<a name="L1771"></a><tt class="py-lineno">1771</tt>  <tt class="py-line"><tt class="py-docstring">        @param mask: Bitmask of events, should contain IN_CREATE and IN_DELETE.</tt> </tt>
<a name="L1772"></a><tt class="py-lineno">1772</tt>  <tt class="py-line"><tt class="py-docstring">        @type mask: int</tt> </tt>
<a name="L1773"></a><tt class="py-lineno">1773</tt>  <tt class="py-line"><tt class="py-docstring">        @param proc_class: ProcessEvent (or of one of its subclass), beware of</tt> </tt>
<a name="L1774"></a><tt class="py-lineno">1774</tt>  <tt class="py-line"><tt class="py-docstring">                           accepting a ProcessEvent's instance as argument into</tt> </tt>
<a name="L1775"></a><tt class="py-lineno">1775</tt>  <tt class="py-line"><tt class="py-docstring">                           __init__, see transient_file.py example for more</tt> </tt>
<a name="L1776"></a><tt class="py-lineno">1776</tt>  <tt class="py-line"><tt class="py-docstring">                           details.</tt> </tt>
<a name="L1777"></a><tt class="py-lineno">1777</tt>  <tt class="py-line"><tt class="py-docstring">        @type proc_class: ProcessEvent's instance or of one of its subclasses.</tt> </tt>
<a name="L1778"></a><tt class="py-lineno">1778</tt>  <tt class="py-line"><tt class="py-docstring">        @return: See add_watch().</tt> </tt>
<a name="L1779"></a><tt class="py-lineno">1779</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: See add_watch().</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-name">dirname</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">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1782"></a><tt class="py-lineno">1782</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">dirname</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt><tt class="py-op">:</tt> </tt>
<a name="L1783"></a><tt class="py-lineno">1783</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># Maintains coherence with add_watch()</tt> </tt>
<a name="L1784"></a><tt class="py-lineno">1784</tt>  <tt class="py-line">        <tt class="py-name">basename</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">basename</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1785"></a><tt class="py-lineno">1785</tt>  <tt class="py-line">        <tt class="py-comment"># Assuming we are watching at least for IN_CREATE and IN_DELETE</tt> </tt>
<a name="L1786"></a><tt class="py-lineno">1786</tt>  <tt class="py-line">        <tt class="py-name">mask</tt> <tt class="py-op">|=</tt> <tt id="link-286" class="py-name"><a title="pyinotify.IN_CREATE" class="py-name" href="#" onclick="return doclink('link-286', 'IN_CREATE', 'link-148');">IN_CREATE</a></tt> <tt class="py-op">|</tt> <tt id="link-287" class="py-name" targets="Variable pyinotify.IN_DELETE=pyinotify-module.html#IN_DELETE"><a title="pyinotify.IN_DELETE" class="py-name" href="#" onclick="return doclink('link-287', 'IN_DELETE', 'link-287');">IN_DELETE</a></tt> </tt>
<a name="L1787"></a><tt class="py-lineno">1787</tt>  <tt class="py-line"> </tt>
<a name="L1788"></a><tt class="py-lineno">1788</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">cmp_name</tt><tt class="py-op">(</tt><tt class="py-param">event</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1789"></a><tt class="py-lineno">1789</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">basename</tt> <tt class="py-op">==</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt id="link-288" class="py-name"><a title="pyinotify.name" class="py-name" href="#" onclick="return doclink('link-288', 'name', 'link-17');">name</a></tt> </tt>
</div><a name="L1790"></a><tt class="py-lineno">1790</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-289" class="py-name"><a title="pyinotify.WatchManager.add_watch" class="py-name" href="#" onclick="return doclink('link-289', 'add_watch', 'link-139');">add_watch</a></tt><tt class="py-op">(</tt><tt class="py-name">dirname</tt><tt class="py-op">,</tt> <tt class="py-name">mask</tt><tt class="py-op">,</tt> </tt>
<a name="L1791"></a><tt class="py-lineno">1791</tt>  <tt class="py-line">                              <tt id="link-290" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-290', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">=</tt><tt class="py-name">proc_class</tt><tt class="py-op">(</tt><tt id="link-291" class="py-name" targets="Class pyinotify.ChainIfTrue=pyinotify.ChainIfTrue-class.html"><a title="pyinotify.ChainIfTrue" class="py-name" href="#" onclick="return doclink('link-291', 'ChainIfTrue', 'link-291');">ChainIfTrue</a></tt><tt class="py-op">(</tt><tt class="py-name">func</tt><tt class="py-op">=</tt><tt class="py-name">cmp_name</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1792"></a><tt class="py-lineno">1792</tt>  <tt class="py-line">                              <tt class="py-name">rec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> </tt>
<a name="L1793"></a><tt class="py-lineno">1793</tt>  <tt class="py-line">                              <tt class="py-name">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">do_glob</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L1794"></a><tt class="py-lineno">1794</tt>  <tt class="py-line"> </tt>
<a name="Color"></a><div id="Color-def"><a name="L1795"></a><tt class="py-lineno">1795</tt>  <tt class="py-line"> </tt>
<a name="L1796"></a><tt class="py-lineno">1796</tt> <a class="py-toggle" href="#" id="Color-toggle" onclick="return toggle('Color');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyinotify.Color-class.html">Color</a><tt class="py-op">:</tt> </tt>
</div><div id="Color-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Color-expanded"><a name="L1797"></a><tt class="py-lineno">1797</tt>  <tt class="py-line">    <tt id="link-292" class="py-name" targets="Variable pyinotify.Color.normal=pyinotify.Color-class.html#normal"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-292', 'normal', 'link-292');">normal</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[0m"</tt> </tt>
<a name="L1798"></a><tt class="py-lineno">1798</tt>  <tt class="py-line">    <tt id="link-293" class="py-name" targets="Variable pyinotify.Color.black=pyinotify.Color-class.html#black"><a title="pyinotify.Color.black" class="py-name" href="#" onclick="return doclink('link-293', 'black', 'link-293');">black</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[30m"</tt> </tt>
<a name="L1799"></a><tt class="py-lineno">1799</tt>  <tt class="py-line">    <tt id="link-294" class="py-name" targets="Variable pyinotify.Color.red=pyinotify.Color-class.html#red"><a title="pyinotify.Color.red" class="py-name" href="#" onclick="return doclink('link-294', 'red', 'link-294');">red</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[31m"</tt> </tt>
<a name="L1800"></a><tt class="py-lineno">1800</tt>  <tt class="py-line">    <tt id="link-295" class="py-name" targets="Variable pyinotify.Color.green=pyinotify.Color-class.html#green"><a title="pyinotify.Color.green" class="py-name" href="#" onclick="return doclink('link-295', 'green', 'link-295');">green</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[32m"</tt> </tt>
<a name="L1801"></a><tt class="py-lineno">1801</tt>  <tt class="py-line">    <tt id="link-296" class="py-name" targets="Variable pyinotify.Color.yellow=pyinotify.Color-class.html#yellow"><a title="pyinotify.Color.yellow" class="py-name" href="#" onclick="return doclink('link-296', 'yellow', 'link-296');">yellow</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[33m"</tt> </tt>
<a name="L1802"></a><tt class="py-lineno">1802</tt>  <tt class="py-line">    <tt id="link-297" class="py-name" targets="Variable pyinotify.Color.blue=pyinotify.Color-class.html#blue"><a title="pyinotify.Color.blue" class="py-name" href="#" onclick="return doclink('link-297', 'blue', 'link-297');">blue</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[34m"</tt> </tt>
<a name="L1803"></a><tt class="py-lineno">1803</tt>  <tt class="py-line">    <tt id="link-298" class="py-name" targets="Variable pyinotify.Color.purple=pyinotify.Color-class.html#purple"><a title="pyinotify.Color.purple" class="py-name" href="#" onclick="return doclink('link-298', 'purple', 'link-298');">purple</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[35m"</tt> </tt>
<a name="L1804"></a><tt class="py-lineno">1804</tt>  <tt class="py-line">    <tt id="link-299" class="py-name" targets="Variable pyinotify.Color.cyan=pyinotify.Color-class.html#cyan"><a title="pyinotify.Color.cyan" class="py-name" href="#" onclick="return doclink('link-299', 'cyan', 'link-299');">cyan</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[36m"</tt> </tt>
<a name="L1805"></a><tt class="py-lineno">1805</tt>  <tt class="py-line">    <tt id="link-300" class="py-name" targets="Variable pyinotify.Color.bold=pyinotify.Color-class.html#bold"><a title="pyinotify.Color.bold" class="py-name" href="#" onclick="return doclink('link-300', 'bold', 'link-300');">bold</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[1m"</tt> </tt>
<a name="L1806"></a><tt class="py-lineno">1806</tt>  <tt class="py-line">    <tt id="link-301" class="py-name" targets="Variable pyinotify.Color.uline=pyinotify.Color-class.html#uline"><a title="pyinotify.Color.uline" class="py-name" href="#" onclick="return doclink('link-301', 'uline', 'link-301');">uline</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[4m"</tt> </tt>
<a name="L1807"></a><tt class="py-lineno">1807</tt>  <tt class="py-line">    <tt id="link-302" class="py-name" targets="Variable pyinotify.Color.blink=pyinotify.Color-class.html#blink"><a title="pyinotify.Color.blink" class="py-name" href="#" onclick="return doclink('link-302', 'blink', 'link-302');">blink</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[5m"</tt> </tt>
<a name="L1808"></a><tt class="py-lineno">1808</tt>  <tt class="py-line">    <tt id="link-303" class="py-name" targets="Variable pyinotify.Color.invert=pyinotify.Color-class.html#invert"><a title="pyinotify.Color.invert" class="py-name" href="#" onclick="return doclink('link-303', 'invert', 'link-303');">invert</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"\033[7m"</tt> </tt>
<a name="L1809"></a><tt class="py-lineno">1809</tt>  <tt class="py-line"> </tt>
<a name="L1810"></a><tt class="py-lineno">1810</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Color.Punctuation"></a><div id="Color.Punctuation-def"><a name="L1811"></a><tt class="py-lineno">1811</tt> <a class="py-toggle" href="#" id="Color.Punctuation-toggle" onclick="return toggle('Color.Punctuation');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Color-class.html#Punctuation">Punctuation</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Color.Punctuation-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Color.Punctuation-expanded"><a name="L1812"></a><tt class="py-lineno">1812</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-304" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-304', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-305" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-305', 'normal', 'link-292');">normal</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt id="link-306" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-306', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-307" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-307', 'normal', 'link-292');">normal</a></tt> </tt>
</div><a name="L1813"></a><tt class="py-lineno">1813</tt>  <tt class="py-line"> </tt>
<a name="L1814"></a><tt class="py-lineno">1814</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Color.FieldValue"></a><div id="Color.FieldValue-def"><a name="L1815"></a><tt class="py-lineno">1815</tt> <a class="py-toggle" href="#" id="Color.FieldValue-toggle" onclick="return toggle('Color.FieldValue');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Color-class.html#FieldValue">FieldValue</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Color.FieldValue-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Color.FieldValue-expanded"><a name="L1816"></a><tt class="py-lineno">1816</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">s</tt><tt class="py-op">,</tt> <tt class="py-name">basestring</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1817"></a><tt class="py-lineno">1817</tt>  <tt class="py-line">            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
<a name="L1818"></a><tt class="py-lineno">1818</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-308" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-308', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-309" class="py-name"><a title="pyinotify.Color.purple" class="py-name" href="#" onclick="return doclink('link-309', 'purple', 'link-298');">purple</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt id="link-310" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-310', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-311" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-311', 'normal', 'link-292');">normal</a></tt> </tt>
</div><a name="L1819"></a><tt class="py-lineno">1819</tt>  <tt class="py-line"> </tt>
<a name="L1820"></a><tt class="py-lineno">1820</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Color.FieldName"></a><div id="Color.FieldName-def"><a name="L1821"></a><tt class="py-lineno">1821</tt> <a class="py-toggle" href="#" id="Color.FieldName-toggle" onclick="return toggle('Color.FieldName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Color-class.html#FieldName">FieldName</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Color.FieldName-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Color.FieldName-expanded"><a name="L1822"></a><tt class="py-lineno">1822</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-312" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-312', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-313" class="py-name"><a title="pyinotify.Color.blue" class="py-name" href="#" onclick="return doclink('link-313', 'blue', 'link-297');">blue</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt id="link-314" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-314', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-315" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-315', 'normal', 'link-292');">normal</a></tt> </tt>
</div><a name="L1823"></a><tt class="py-lineno">1823</tt>  <tt class="py-line"> </tt>
<a name="L1824"></a><tt class="py-lineno">1824</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Color.ClassName"></a><div id="Color.ClassName-def"><a name="L1825"></a><tt class="py-lineno">1825</tt> <a class="py-toggle" href="#" id="Color.ClassName-toggle" onclick="return toggle('Color.ClassName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Color-class.html#ClassName">ClassName</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Color.ClassName-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Color.ClassName-expanded"><a name="L1826"></a><tt class="py-lineno">1826</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-316" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-316', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-317" class="py-name"><a title="pyinotify.Color.red" class="py-name" href="#" onclick="return doclink('link-317', 'red', 'link-294');">red</a></tt> <tt class="py-op">+</tt> <tt id="link-318" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-318', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-319" class="py-name"><a title="pyinotify.Color.bold" class="py-name" href="#" onclick="return doclink('link-319', 'bold', 'link-300');">bold</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt id="link-320" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-320', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-321" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-321', 'normal', 'link-292');">normal</a></tt> </tt>
</div><a name="L1827"></a><tt class="py-lineno">1827</tt>  <tt class="py-line"> </tt>
<a name="L1828"></a><tt class="py-lineno">1828</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Color.Simple"></a><div id="Color.Simple-def"><a name="L1829"></a><tt class="py-lineno">1829</tt> <a class="py-toggle" href="#" id="Color.Simple-toggle" onclick="return toggle('Color.Simple');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify.Color-class.html#Simple">Simple</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">,</tt> <tt class="py-param">color</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Color.Simple-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Color.Simple-expanded"><a name="L1830"></a><tt class="py-lineno">1830</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">s</tt><tt class="py-op">,</tt> <tt class="py-name">basestring</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1831"></a><tt class="py-lineno">1831</tt>  <tt class="py-line">            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
<a name="L1832"></a><tt class="py-lineno">1832</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L1833"></a><tt class="py-lineno">1833</tt>  <tt class="py-line">            <tt class="py-name">color_attr</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt id="link-322" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-322', 'Color', 'link-100');">Color</a></tt><tt class="py-op">,</tt> <tt class="py-name">color</tt><tt class="py-op">)</tt> </tt>
<a name="L1834"></a><tt class="py-lineno">1834</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">AttributeError</tt><tt class="py-op">:</tt> </tt>
<a name="L1835"></a><tt class="py-lineno">1835</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">s</tt> </tt>
<a name="L1836"></a><tt class="py-lineno">1836</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">color_attr</tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> <tt class="py-op">+</tt> <tt id="link-323" class="py-name"><a title="pyinotify.Color" class="py-name" href="#" onclick="return doclink('link-323', 'Color', 'link-100');">Color</a></tt><tt class="py-op">.</tt><tt id="link-324" class="py-name"><a title="pyinotify.Color.normal" class="py-name" href="#" onclick="return doclink('link-324', 'normal', 'link-292');">normal</a></tt> </tt>
</div></div><a name="L1837"></a><tt class="py-lineno">1837</tt>  <tt class="py-line"> </tt>
<a name="compatibility_mode"></a><div id="compatibility_mode-def"><a name="L1838"></a><tt class="py-lineno">1838</tt>  <tt class="py-line"> </tt>
<a name="L1839"></a><tt class="py-lineno">1839</tt> <a class="py-toggle" href="#" id="compatibility_mode-toggle" onclick="return toggle('compatibility_mode');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#compatibility_mode">compatibility_mode</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="compatibility_mode-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="compatibility_mode-expanded"><a name="L1840"></a><tt class="py-lineno">1840</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L1841"></a><tt class="py-lineno">1841</tt>  <tt class="py-line"><tt class="py-docstring">    Use this function to turn on the compatibility mode. The compatibility</tt> </tt>
<a name="L1842"></a><tt class="py-lineno">1842</tt>  <tt class="py-line"><tt class="py-docstring">    mode is used to improve compatibility with Pyinotify 0.7.1 programs.</tt> </tt>
<a name="L1843"></a><tt class="py-lineno">1843</tt>  <tt class="py-line"><tt class="py-docstring">    The compatibility mode provides variables 'is_dir', 'event_name',</tt> </tt>
<a name="L1844"></a><tt class="py-lineno">1844</tt>  <tt class="py-line"><tt class="py-docstring">    'EventsCodes.IN_*' and 'EventsCodes.ALL_EVENTS' as with Pyinotify 0.7.1.</tt> </tt>
<a name="L1845"></a><tt class="py-lineno">1845</tt>  <tt class="py-line"><tt class="py-docstring">    Do not call this function if your program is developped for</tt> </tt>
<a name="L1846"></a><tt class="py-lineno">1846</tt>  <tt class="py-line"><tt class="py-docstring">    Pyinotify &gt;= 0.8.x.</tt> </tt>
<a name="L1847"></a><tt class="py-lineno">1847</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L1848"></a><tt class="py-lineno">1848</tt>  <tt class="py-line">    <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-325" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-325', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">,</tt> <tt class="py-string">'ALL_EVENTS'</tt><tt class="py-op">,</tt> <tt id="link-326" class="py-name"><a title="pyinotify.ALL_EVENTS" class="py-name" href="#" onclick="return doclink('link-326', 'ALL_EVENTS', 'link-86');">ALL_EVENTS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L1849"></a><tt class="py-lineno">1849</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">evname</tt> <tt class="py-keyword">in</tt> <tt class="py-name">globals</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1850"></a><tt class="py-lineno">1850</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">evname</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">'IN_'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1851"></a><tt class="py-lineno">1851</tt>  <tt class="py-line">            <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt id="link-327" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-327', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">,</tt> <tt class="py-name">evname</tt><tt class="py-op">,</tt> <tt class="py-name">globals</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">evname</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1852"></a><tt class="py-lineno">1852</tt>  <tt class="py-line">    <tt class="py-keyword">global</tt> <tt id="link-328" class="py-name"><a title="pyinotify.COMPATIBILITY_MODE" class="py-name" href="#" onclick="return doclink('link-328', 'COMPATIBILITY_MODE', 'link-6');">COMPATIBILITY_MODE</a></tt> </tt>
<a name="L1853"></a><tt class="py-lineno">1853</tt>  <tt class="py-line">    <tt id="link-329" class="py-name"><a title="pyinotify.COMPATIBILITY_MODE" class="py-name" href="#" onclick="return doclink('link-329', 'COMPATIBILITY_MODE', 'link-6');">COMPATIBILITY_MODE</a></tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
</div><a name="L1854"></a><tt class="py-lineno">1854</tt>  <tt class="py-line"> </tt>
<a name="command_line"></a><div id="command_line-def"><a name="L1855"></a><tt class="py-lineno">1855</tt>  <tt class="py-line"> </tt>
<a name="L1856"></a><tt class="py-lineno">1856</tt> <a class="py-toggle" href="#" id="command_line-toggle" onclick="return toggle('command_line');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyinotify-module.html#command_line">command_line</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="command_line-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="command_line-expanded"><a name="L1857"></a><tt class="py-lineno">1857</tt>  <tt class="py-line">    <tt class="py-comment">#</tt> </tt>
<a name="L1858"></a><tt class="py-lineno">1858</tt>  <tt class="py-line">    <tt class="py-comment"># - By default the watched path is '/tmp' for all events.</tt> </tt>
<a name="L1859"></a><tt class="py-lineno">1859</tt>  <tt class="py-line">    <tt class="py-comment"># - The monitoring execution blocks and serve forever, type c^c</tt> </tt>
<a name="L1860"></a><tt class="py-lineno">1860</tt>  <tt class="py-line">    <tt class="py-comment">#   to stop it.</tt> </tt>
<a name="L1861"></a><tt class="py-lineno">1861</tt>  <tt class="py-line">    <tt class="py-comment">#</tt> </tt>
<a name="L1862"></a><tt class="py-lineno">1862</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">optparse</tt> <tt class="py-keyword">import</tt> <tt class="py-name">OptionParser</tt> </tt>
<a name="L1863"></a><tt class="py-lineno">1863</tt>  <tt class="py-line"> </tt>
<a name="L1864"></a><tt class="py-lineno">1864</tt>  <tt class="py-line">    <tt class="py-name">usage</tt> <tt class="py-op">=</tt> <tt class="py-string">"usage: %prog [options] [path1] [path2] [pathn]"</tt> </tt>
<a name="L1865"></a><tt class="py-lineno">1865</tt>  <tt class="py-line"> </tt>
<a name="L1866"></a><tt class="py-lineno">1866</tt>  <tt class="py-line">    <tt class="py-name">parser</tt> <tt class="py-op">=</tt> <tt class="py-name">OptionParser</tt><tt class="py-op">(</tt><tt class="py-name">usage</tt><tt class="py-op">=</tt><tt class="py-name">usage</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">parser</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">"-v"</tt><tt class="py-op">,</tt> <tt class="py-string">"--verbose"</tt><tt class="py-op">,</tt> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store_true"</tt><tt class="py-op">,</tt> </tt>
<a name="L1868"></a><tt class="py-lineno">1868</tt>  <tt class="py-line">                      <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"verbose"</tt><tt class="py-op">,</tt> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Verbose mode"</tt><tt class="py-op">)</tt> </tt>
<a name="L1869"></a><tt class="py-lineno">1869</tt>  <tt class="py-line">    <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">"-r"</tt><tt class="py-op">,</tt> <tt class="py-string">"--recursive"</tt><tt class="py-op">,</tt> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store_true"</tt><tt class="py-op">,</tt> </tt>
<a name="L1870"></a><tt class="py-lineno">1870</tt>  <tt class="py-line">                      <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"recursive"</tt><tt class="py-op">,</tt> </tt>
<a name="L1871"></a><tt class="py-lineno">1871</tt>  <tt class="py-line">                      <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Add watches recursively on paths"</tt><tt class="py-op">)</tt> </tt>
<a name="L1872"></a><tt class="py-lineno">1872</tt>  <tt class="py-line">    <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">"-a"</tt><tt class="py-op">,</tt> <tt class="py-string">"--auto_add"</tt><tt class="py-op">,</tt> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store_true"</tt><tt class="py-op">,</tt> </tt>
<a name="L1873"></a><tt class="py-lineno">1873</tt>  <tt class="py-line">                      <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"auto_add"</tt><tt class="py-op">,</tt> </tt>
<a name="L1874"></a><tt class="py-lineno">1874</tt>  <tt class="py-line">                      <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Automatically add watches on new directories"</tt><tt class="py-op">)</tt> </tt>
<a name="L1875"></a><tt class="py-lineno">1875</tt>  <tt class="py-line">    <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">"-e"</tt><tt class="py-op">,</tt> <tt class="py-string">"--events-list"</tt><tt class="py-op">,</tt> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"EVENT[,...]"</tt><tt class="py-op">,</tt> </tt>
<a name="L1876"></a><tt class="py-lineno">1876</tt>  <tt class="py-line">                      <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"events_list"</tt><tt class="py-op">,</tt> </tt>
<a name="L1877"></a><tt class="py-lineno">1877</tt>  <tt class="py-line">                      <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-string">"A comma-separated list of events to watch for - "</tt> </tt>
<a name="L1878"></a><tt class="py-lineno">1878</tt>  <tt class="py-line">                           <tt class="py-string">"see the documentation for valid options (defaults"</tt> </tt>
<a name="L1879"></a><tt class="py-lineno">1879</tt>  <tt class="py-line">                           <tt class="py-string">" to everything)"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1880"></a><tt class="py-lineno">1880</tt>  <tt class="py-line">    <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">"-s"</tt><tt class="py-op">,</tt> <tt class="py-string">"--stats"</tt><tt class="py-op">,</tt> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store_true"</tt><tt class="py-op">,</tt> </tt>
<a name="L1881"></a><tt class="py-lineno">1881</tt>  <tt class="py-line">                      <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"stats"</tt><tt class="py-op">,</tt> </tt>
<a name="L1882"></a><tt class="py-lineno">1882</tt>  <tt class="py-line">                      <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Display statistics"</tt><tt class="py-op">)</tt> </tt>
<a name="L1883"></a><tt class="py-lineno">1883</tt>  <tt class="py-line"> </tt>
<a name="L1884"></a><tt class="py-lineno">1884</tt>  <tt class="py-line">    <tt class="py-op">(</tt><tt class="py-name">options</tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> <tt class="py-op">=</tt> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">parse_args</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1885"></a><tt class="py-lineno">1885</tt>  <tt class="py-line"> </tt>
<a name="L1886"></a><tt class="py-lineno">1886</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">verbose</tt><tt class="py-op">:</tt> </tt>
<a name="L1887"></a><tt class="py-lineno">1887</tt>  <tt class="py-line">        <tt id="link-330" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-330', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">setLevel</tt><tt class="py-op">(</tt><tt class="py-number">10</tt><tt class="py-op">)</tt> </tt>
<a name="L1888"></a><tt class="py-lineno">1888</tt>  <tt class="py-line"> </tt>
<a name="L1889"></a><tt class="py-lineno">1889</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">args</tt><tt class="py-op">)</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">1</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">path</tt> <tt class="py-op">=</tt> <tt class="py-string">'/tmp'</tt>  <tt class="py-comment"># default watched path</tt> </tt>
<a name="L1891"></a><tt class="py-lineno">1891</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1892"></a><tt class="py-lineno">1892</tt>  <tt class="py-line">        <tt class="py-name">path</tt> <tt class="py-op">=</tt> <tt class="py-name">args</tt> </tt>
<a name="L1893"></a><tt class="py-lineno">1893</tt>  <tt class="py-line"> </tt>
<a name="L1894"></a><tt class="py-lineno">1894</tt>  <tt class="py-line">    <tt class="py-comment"># watch manager instance</tt> </tt>
<a name="L1895"></a><tt class="py-lineno">1895</tt>  <tt class="py-line">    <tt class="py-name">wm</tt> <tt class="py-op">=</tt> <tt id="link-331" class="py-name" targets="Class pyinotify.WatchManager=pyinotify.WatchManager-class.html"><a title="pyinotify.WatchManager" class="py-name" href="#" onclick="return doclink('link-331', 'WatchManager', 'link-331');">WatchManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1896"></a><tt class="py-lineno">1896</tt>  <tt class="py-line">    <tt class="py-comment"># notifier instance and init</tt> </tt>
<a name="L1897"></a><tt class="py-lineno">1897</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">stats</tt><tt class="py-op">:</tt> </tt>
<a name="L1898"></a><tt class="py-lineno">1898</tt>  <tt class="py-line">        <tt class="py-name">notifier</tt> <tt class="py-op">=</tt> <tt id="link-332" class="py-name"><a title="pyinotify.Notifier" class="py-name" href="#" onclick="return doclink('link-332', 'Notifier', 'link-218');">Notifier</a></tt><tt class="py-op">(</tt><tt class="py-name">wm</tt><tt class="py-op">,</tt> <tt class="py-name">default_proc_fun</tt><tt class="py-op">=</tt><tt id="link-333" class="py-name" targets="Class pyinotify.Stats=pyinotify.Stats-class.html"><a title="pyinotify.Stats" class="py-name" href="#" onclick="return doclink('link-333', 'Stats', 'link-333');">Stats</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">read_freq</tt><tt class="py-op">=</tt><tt class="py-number">5</tt><tt class="py-op">)</tt> </tt>
<a name="L1899"></a><tt class="py-lineno">1899</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1900"></a><tt class="py-lineno">1900</tt>  <tt class="py-line">        <tt class="py-name">notifier</tt> <tt class="py-op">=</tt> <tt id="link-334" class="py-name"><a title="pyinotify.Notifier" class="py-name" href="#" onclick="return doclink('link-334', 'Notifier', 'link-218');">Notifier</a></tt><tt class="py-op">(</tt><tt class="py-name">wm</tt><tt class="py-op">)</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>  <tt class="py-line">    <tt class="py-comment"># What mask to apply</tt> </tt>
<a name="L1903"></a><tt class="py-lineno">1903</tt>  <tt class="py-line">    <tt class="py-name">mask</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L1904"></a><tt class="py-lineno">1904</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">events_list</tt><tt class="py-op">:</tt> </tt>
<a name="L1905"></a><tt class="py-lineno">1905</tt>  <tt class="py-line">        <tt class="py-name">events_list</tt> <tt class="py-op">=</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">events_list</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">','</tt><tt class="py-op">)</tt> </tt>
<a name="L1906"></a><tt class="py-lineno">1906</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">ev</tt> <tt class="py-keyword">in</tt> <tt class="py-name">events_list</tt><tt class="py-op">:</tt> </tt>
<a name="L1907"></a><tt class="py-lineno">1907</tt>  <tt class="py-line">            <tt class="py-name">evcode</tt> <tt class="py-op">=</tt> <tt id="link-335" class="py-name"><a title="pyinotify.EventsCodes" class="py-name" href="#" onclick="return doclink('link-335', 'EventsCodes', 'link-59');">EventsCodes</a></tt><tt class="py-op">.</tt><tt id="link-336" class="py-name"><a title="pyinotify.EventsCodes.ALL_FLAGS" class="py-name" href="#" onclick="return doclink('link-336', 'ALL_FLAGS', 'link-64');">ALL_FLAGS</a></tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">ev</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1908"></a><tt class="py-lineno">1908</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">evcode</tt><tt class="py-op">:</tt> </tt>
<a name="L1909"></a><tt class="py-lineno">1909</tt>  <tt class="py-line">                <tt class="py-name">mask</tt> <tt class="py-op">|=</tt> <tt class="py-name">evcode</tt> </tt>
<a name="L1910"></a><tt class="py-lineno">1910</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1911"></a><tt class="py-lineno">1911</tt>  <tt class="py-line">                <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">(</tt><tt class="py-string">"The event '%s' specified with option -e"</tt> </tt>
<a name="L1912"></a><tt class="py-lineno">1912</tt>  <tt class="py-line">                             <tt class="py-string">" is not valid"</tt> <tt class="py-op">%</tt> <tt class="py-name">ev</tt><tt class="py-op">)</tt> </tt>
<a name="L1913"></a><tt class="py-lineno">1913</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1914"></a><tt class="py-lineno">1914</tt>  <tt class="py-line">        <tt class="py-name">mask</tt> <tt class="py-op">=</tt> <tt id="link-337" class="py-name"><a title="pyinotify.ALL_EVENTS" class="py-name" href="#" onclick="return doclink('link-337', 'ALL_EVENTS', 'link-86');">ALL_EVENTS</a></tt> </tt>
<a name="L1915"></a><tt class="py-lineno">1915</tt>  <tt class="py-line"> </tt>
<a name="L1916"></a><tt class="py-lineno">1916</tt>  <tt class="py-line">    <tt class="py-comment"># stats</tt> </tt>
<a name="L1917"></a><tt class="py-lineno">1917</tt>  <tt class="py-line">    <tt class="py-name">cb_fun</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L1918"></a><tt class="py-lineno">1918</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">stats</tt><tt class="py-op">:</tt> </tt>
<a name="L1919"></a><tt class="py-lineno">1919</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">cb</tt><tt class="py-op">(</tt><tt class="py-param">s</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">print</tt><tt class="py-op">(</tt><tt class="py-string">'%s\n%s\n'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">repr</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">.</tt><tt id="link-338" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-338', 'proc_fun', 'link-141');">proc_fun</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="L1921"></a><tt class="py-lineno">1921</tt>  <tt class="py-line">                                <tt class="py-name">s</tt><tt class="py-op">.</tt><tt id="link-339" class="py-name"><a title="pyinotify.Notifier.proc_fun" class="py-name" href="#" onclick="return doclink('link-339', 'proc_fun', 'link-141');">proc_fun</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1922"></a><tt class="py-lineno">1922</tt>  <tt class="py-line">        <tt class="py-name">cb_fun</tt> <tt class="py-op">=</tt> <tt class="py-name">cb</tt> </tt>
<a name="L1923"></a><tt class="py-lineno">1923</tt>  <tt class="py-line"> </tt>
<a name="L1924"></a><tt class="py-lineno">1924</tt>  <tt class="py-line">    <tt id="link-340" class="py-name"><a title="pyinotify.log" class="py-name" href="#" onclick="return doclink('link-340', 'log', 'link-21');">log</a></tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">'Start monitoring %s, (press c^c to halt pyinotify)'</tt> <tt class="py-op">%</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
<a name="L1925"></a><tt class="py-lineno">1925</tt>  <tt class="py-line"> </tt>
<a name="L1926"></a><tt class="py-lineno">1926</tt>  <tt class="py-line">    <tt class="py-name">wm</tt><tt class="py-op">.</tt><tt id="link-341" class="py-name"><a title="pyinotify.WatchManager.add_watch" class="py-name" href="#" onclick="return doclink('link-341', 'add_watch', 'link-139');">add_watch</a></tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">mask</tt><tt class="py-op">,</tt> <tt class="py-name">rec</tt><tt class="py-op">=</tt><tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">recursive</tt><tt class="py-op">,</tt> <tt class="py-name">auto_add</tt><tt class="py-op">=</tt><tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">auto_add</tt><tt class="py-op">)</tt> </tt>
<a name="L1927"></a><tt class="py-lineno">1927</tt>  <tt class="py-line">    <tt class="py-comment"># Loop forever (until sigint signal get caught)</tt> </tt>
<a name="L1928"></a><tt class="py-lineno">1928</tt>  <tt class="py-line">    <tt class="py-name">notifier</tt><tt class="py-op">.</tt><tt id="link-342" class="py-name"><a title="pyinotify.Notifier.loop
pyinotify.ThreadedNotifier.loop" class="py-name" href="#" onclick="return doclink('link-342', 'loop', 'link-226');">loop</a></tt><tt class="py-op">(</tt><tt class="py-name">callback</tt><tt class="py-op">=</tt><tt class="py-name">cb_fun</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1929"></a><tt class="py-lineno">1929</tt>  <tt class="py-line"> </tt>
<a name="L1930"></a><tt class="py-lineno">1930</tt>  <tt class="py-line"> </tt>
<a name="L1931"></a><tt class="py-lineno">1931</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L1932"></a><tt class="py-lineno">1932</tt>  <tt class="py-line">    <tt id="link-343" class="py-name" targets="Function pyinotify.command_line()=pyinotify-module.html#command_line"><a title="pyinotify.command_line" class="py-name" href="#" onclick="return doclink('link-343', 'command_line', 'link-343');">command_line</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1933"></a><tt class="py-lineno">1933</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 bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Aug  6 15:45:59 2009
    </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>