File: unicode.py

package info (click to toggle)
pyinotify 0.9.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: python: 2,498; ansic: 153; makefile: 14; sh: 6
file content (22 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-
import os
import sys
import pyinotify


# create path
#path = u'/tmp/test\u0444'
path = '/tmp/testั„'
path = unicode(path, sys.getfilesystemencoding())

if not os.path.isdir(path):
    os.mkdir(path)

pyinotify.log.setLevel(10)
wm = pyinotify.WatchManager()
notifier = pyinotify.Notifier(wm)

wdd = wm.add_watch(path, pyinotify.IN_OPEN)
wm.update_watch(wdd[path], pyinotify.ALL_EVENTS)

notifier.loop()