Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 308340 Details for
Bug 445869
gnomevfs file monitoring not working
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
monitor.py
monitor.py (text/plain), 1.29 KB, created by
Tim Waugh
on 2008-06-04 13:22:07 UTC
(
hide
)
Description:
monitor.py
Filename:
MIME Type:
Creator:
Tim Waugh
Created:
2008-06-04 13:22:07 UTC
Size:
1.29 KB
patch
obsolete
>#!/usr/bin/python >import gobject >import gnomevfs >import threading >import os >import tempfile > >class DirWatcher: > def __init__ (self, loop): > self.loop = loop > self.handle = None > > def start_monitoring (self, folder): > uri = gnomevfs.make_uri_canonical (folder + '/') > t = threading.Thread (target=self.start_monitoring_thread, > args=(uri,)) > t.setDaemon (True) > t.start () > > def start_monitoring_thread (self, uri): > self.handle = gnomevfs.monitor_add (uri, gnomevfs.MONITOR_DIRECTORY, > self.monitor_callback) > > def stop_monitoring (self): > gnomevfs.monitor_cancel (self.handle) > self.handle = None > > def monitor_callback (self, monitor_uri, uri, event): > print "Got monitor callback" > self.stop_monitoring () > loop.quit () > >dir = tempfile.mkdtemp () >file = os.path.join (dir, "file") >loop = gobject.MainLoop () >gobject.timeout_add (5000, loop.quit) >gobject.timeout_add (500, os.open, file, os.O_CREAT) >watch = DirWatcher (loop) >watch.start_monitoring (dir) >loop.run () >try: > os.unlink (file) >except OSError: > pass >os.rmdir (dir) > >if watch.handle == None: > print "GnomeVFS monitoring is working" >else: > print "GnomeVFS monitoring is NOT working"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 445869
: 308340