소스 검색

Fix compatibility with newer python3-nautilus

Signed-off-by: Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
Nathan Pratta Teodosio 3 년 전
부모
커밋
2ba08206af
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      shell_integration/nautilus/syncstate.py

+ 5 - 1
shell_integration/nautilus/syncstate.py

@@ -200,9 +200,13 @@ class MenuExtension_ownCloud(GObject.GObject, Nautilus.MenuProvider):
                 break
         return (topLevelFolder, internalFile)
 
-    def get_file_items(self, window, files):
+    # The get_file_items method of Nautilus.MenuProvider no longer takes
+    # the window argument. To keep supporting older versions of Nautilus,
+    # we can use variadic arguments.
+    def get_file_items(self, *args):
         # Show the menu extension to share a file or folder
 
+        files = args[-1]
         # Get usable file paths from the uris
         all_internal_files = True
         for i, file_uri in enumerate(files):