File system monitor imports are messy

Bug #1026212 reported by Manuel de la Peña
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Status tracked in Trunk
Stable-4-0
Fix Released
Undecided
Unassigned
Trunk
Fix Released
Medium
Manuel de la Peña

Bug Description

From comments regarding the code:

I looked at the assignment to get_filemonitor_class, and poked around
a bit - some of this isn't new in this diff, but might be
nice to fix here, instead of adding code that does the same thing:
(Feel free to disagree if you think it's not productive)

# why is get_filemonitor_class being added to the namespace in platform/filesystem_notifications/__init__.py?
it looks like it's never accessed as
filesystem_notifications.get_filemonitor_class, but always as
filesystem_notifications.monitor.get_filemonitor_class, (eg in
platform/__init__.py).

So, that assignment is unnecessary, and

# importing filesystemMonitor - there are a lot of ways to import
  it. I think we could remove the assignments in platform/__init__.py,
  and filesystem_notifications/__init__.py, since it's possible to
  just get it from platform.filesystem_notifications.monitor
  everywhere - we already do this in a few places.

- syncdaemon/event_queue.py imports it from
  platform.filesystem_notifications, while test_eventqueue imports it
  from platform. (seems like those should be the same)

- test_windows and test_darwin import it from
  u.platform.filesystem_notifications.monitor.common, while test_linux
  gets it from platform.filesystem_notifications.

# related to the above: _GeneralINotifyProcessor seems like it's only
  used in test_filesystem_notifications. maybe we should change that and
  remove the assignment in filesystem_notifications/__init__.py:36

Tags: u1-darwin

Related branches

Changed in ubuntuone-client:
status: Triaged → In Progress
Changed in ubuntuone-client:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.