コード例 #1
0
ファイル: windows.py プロジェクト: CSRedRat/magicicada-client
 def _process_events(self, events):
     """Process the events from the queue."""
     # we transform the events to be the same as the one in pyinotify
     # and then use the proc_fun
     for action, file_name in events:
         syncdaemon_path = get_syncdaemon_valid_path(
             os.path.join(self.path, file_name))
         self.process_events(
             action, file_name, str(uuid4()), syncdaemon_path)
コード例 #2
0
 def test_normpath_with_longprefix(self):
     """Ensure that the normpath is correct when it uses the long prefix."""
     paths = [os.path.join('A', 'B?'),
              os.path.join('A', 'B?') + os.path.sep,
              os.path.join('A:C', '.', 'B?'),
              os.path.join('A', 'foo', '..', 'B?')]
     for current_path in paths:
         valid_path = get_windows_valid_path(current_path)
         normalized_path = os.path.normpath(valid_path)
         self.assertEqual(get_syncdaemon_valid_path(normalized_path),
                          normpath(current_path))
         self.assertFalse(LONG_PATH_PREFIX in current_path)