[Pkg-owncloud-commits] [owncloud-client] 01/01: Fix minor Python syntax errors

David Prévot taffit at moszumanska.debian.org
Sat Aug 30 02:25:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud-client.

commit 6b4e4d9c557d29f92bd6b1e5d3e315725d9d8c5b
Author: David Prévot <taffit at debian.org>
Date:   Fri Aug 29 21:40:24 2014 -0400

    Fix minor Python syntax errors
    
    Git-Dch: Ignore
---
 .../0005-Fix-minor-Python-syntax-errors.patch      | 239 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 240 insertions(+)

diff --git a/debian/patches/0005-Fix-minor-Python-syntax-errors.patch b/debian/patches/0005-Fix-minor-Python-syntax-errors.patch
new file mode 100644
index 0000000..cb6d69d
--- /dev/null
+++ b/debian/patches/0005-Fix-minor-Python-syntax-errors.patch
@@ -0,0 +1,239 @@
+From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
+Date: Fri, 29 Aug 2014 21:32:53 -0400
+Subject: Fix minor Python syntax errors
+
+The installation fails because of these:
+
+	TabError: inconsistent use of tabs and spaces in indentation
+	SyntaxError: Missing parentheses in call to 'print'
+---
+ shell_integration/nautilus/ownCloud.py | 160 ++++++++++++++++-----------------
+ 1 file changed, 80 insertions(+), 80 deletions(-)
+
+diff --git a/shell_integration/nautilus/ownCloud.py b/shell_integration/nautilus/ownCloud.py
+index 158b015..cd582d9 100755
+--- a/shell_integration/nautilus/ownCloud.py
++++ b/shell_integration/nautilus/ownCloud.py
+@@ -21,10 +21,10 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+           GObject.timeout_add(5000, self.connectToOwnCloud)
+ 
+     def port(self):
+-	return 34001 # Fixme, read from config file.
++        return 34001 # Fixme, read from config file.
+ 
+     def connectToOwnCloud(self):
+-	try:
++        try:
+           self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ 
+           self.sock.connect(("localhost", self.port()))
+@@ -32,25 +32,25 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+           self.connected = True
+           self.watch_id = GObject.io_add_watch(self.sock, GObject.IO_IN, self.handle_notify)
+         except:
+-          print "Connect could not be established, try again later!"
++          print( "Connect could not be established, try again later!" )
+           self.sock.close()
+-	return not self.connected
+-	
++        return not self.connected
++        
+     def sendCommand(self, cmd):
+         if self.connected:
+           try:
+             self.sock.send(cmd)
+           except:
+-            print "Sending failed."
++            print( "Sending failed." )
+             GObject.source_remove( self.watch_id )
+             self.connected = False
+             GObject.timeout_add(5000, self.connectToOwnCloud)
+ 
+     def find_item_for_file( self, path ):
+-	if path in self.nautilusVFSFile_table:
+-	    return self.nautilusVFSFile_table[path]
+-	else:
+-	    return None
++        if path in self.nautilusVFSFile_table:
++            return self.nautilusVFSFile_table[path]
++        else:
++            return None
+ 
+     def askForOverlay(self, file):
+         if os.path.isdir(file):
+@@ -60,38 +60,38 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+             fileStatus = self.sendCommand("RETRIEVE_FILE_STATUS:"+file+"\n");
+ 
+     def invalidate_items_underneath( self, path ):
+-	update_items = []
+-	for p in self.nautilusVFSFile_table:
+-	    if p == path or p.startswith( path ):
+-		item = self.nautilusVFSFile_table[p]
+-		update_items.append(item)
++        update_items = []
++        for p in self.nautilusVFSFile_table:
++            if p == path or p.startswith( path ):
++                item = self.nautilusVFSFile_table[p]
++                update_items.append(item)
+ 
+-	for item in update_items:
+-	    item.invalidate_extension_info()
+-	    # self.update_file_info(item)
++        for item in update_items:
++            item.invalidate_extension_info()
++            # self.update_file_info(item)
+ 
+     # Handles a single line of server respoonse and sets the emblem
+     def handle_server_response(self, l):
+         Emblems = { 'OK'        : 'oC_ok',
+-		    'SYNC'      : 'oC_sync',
+-		    'NEW'       : 'oC_sync',
+-		    'IGNORE'    : 'oC_warn',
+-		    'ERROR'     : 'oC_error',
+-		    'OK+SWM'    : 'oC_ok_shared',
+-		    'SYNC+SWM'  : 'oC_sync_shared',
+-		    'NEW+SWM'   : 'oC_sync_shared',
+-		    'IGNORE+SWM': 'oC_warn_shared',
+-		    'ERROR+SWM' : 'oC_error_shared',
+-		    'NOP'       : 'oC_error'
+-		  }
+-
+-        print "Server response: "+l
++                    'SYNC'      : 'oC_sync',
++                    'NEW'       : 'oC_sync',
++                    'IGNORE'    : 'oC_warn',
++                    'ERROR'     : 'oC_error',
++                    'OK+SWM'    : 'oC_ok_shared',
++                    'SYNC+SWM'  : 'oC_sync_shared',
++                    'NEW+SWM'   : 'oC_sync_shared',
++                    'IGNORE+SWM': 'oC_warn_shared',
++                    'ERROR+SWM' : 'oC_error_shared',
++                    'NOP'       : 'oC_error'
++                  }
++
++        print( "Server response: "+l )
+         parts = l.split(':')
+         if len(parts) > 0:
+-	    action = parts[0]
++            action = parts[0]
+ 
+-	    # file = parts[1]
+-	    # print "Action for " + file + ": "+parts[0]
++            # file = parts[1]
++            # print "Action for " + file + ": "+parts[0]
+             if action == 'STATUS':
+                 emblem = Emblems[parts[1]]
+                 if emblem:
+@@ -99,24 +99,24 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+                     if item:
+                         item.add_emblem(emblem)
+ 
+-	    elif action == 'UPDATE_VIEW':
+-		# Search all items underneath this path and invalidate them
+-		if parts[1] in self.registered_paths:
+-		    self.invalidate_items_underneath( parts[1] )
+-
+-	    elif action == 'REGISTER_PATH':
+-		self.registered_paths[parts[1]] = 1
+-		self.invalidate_items_underneath( parts[1] )
+-	    elif action == 'UNREGISTER_PATH':
+-		del self.registered_paths[parts[1]]
+-		self.invalidate_items_underneath( parts[1] )
+-
+-		# check if there are non pathes any more, if so, its usual
+-		# that mirall went away. Try reconnect.
+-		if not self.registered_paths:
+-		    self.sock.close()
+-		    self.connected = False
+-		    GObject.source_remove( self.watch_id )
++            elif action == 'UPDATE_VIEW':
++                # Search all items underneath this path and invalidate them
++                if parts[1] in self.registered_paths:
++                    self.invalidate_items_underneath( parts[1] )
++
++            elif action == 'REGISTER_PATH':
++                self.registered_paths[parts[1]] = 1
++                self.invalidate_items_underneath( parts[1] )
++            elif action == 'UNREGISTER_PATH':
++                del self.registered_paths[parts[1]]
++                self.invalidate_items_underneath( parts[1] )
++
++                # check if there are non pathes any more, if so, its usual
++                # that mirall went away. Try reconnect.
++                if not self.registered_paths:
++                    self.sock.close()
++                    self.connected = False
++                    GObject.source_remove( self.watch_id )
+                     GObject.timeout_add(5000, self.connectToOwnCloud)
+ 
+             else:
+@@ -126,26 +126,26 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+     # notify is the raw answer from the socket
+     def handle_notify(self, source, condition):
+ 
+-	data = source.recv(1024)
+-	# prepend the remaining data from last call
+-	if len(self.remainder) > 0:
+-	    data = self.remainder+data
+-	    self.remainder = ''
+-
+-	if len(data) > 0:
+-	    # remember the remainder for next round
+-	    lastNL = data.rfind('\n');
+-	    if lastNL > -1 and lastNL < len(data):
+-		self.remainder = data[lastNL+1:]
+-		data = data[:lastNL]
+-
+-	    for l in data.split('\n'):
+-	        self.handle_server_response( l )
++        data = source.recv(1024)
++        # prepend the remaining data from last call
++        if len(self.remainder) > 0:
++            data = self.remainder+data
++            self.remainder = ''
++
++        if len(data) > 0:
++            # remember the remainder for next round
++            lastNL = data.rfind('\n');
++            if lastNL > -1 and lastNL < len(data):
++                self.remainder = data[lastNL+1:]
++                data = data[:lastNL]
++
++            for l in data.split('\n'):
++                self.handle_server_response( l )
+         else:
+             return False
+ 
+-	return True # run again
+-	    
++        return True # run again
++            
+     def get_local_path(self, path):
+         return path.replace("file://", "")
+ 
+@@ -155,14 +155,14 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
+ 
+         filename = urllib.unquote(item.get_uri()[7:])
+         if item.is_directory():
+-	    filename += '/'
+-
+-	for reg_path in self.registered_paths:
+-	    if filename.startswith(reg_path):
+-		self.nautilusVFSFile_table[filename] = item
+-	
+-		# item.add_string_attribute('share_state', "share state")
+-		self.askForOverlay(filename)
+-		break
+-	    else:
+-		print "Not in scope:"+filename
++            filename += '/'
++
++        for reg_path in self.registered_paths:
++            if filename.startswith(reg_path):
++                self.nautilusVFSFile_table[filename] = item
++        
++                # item.add_string_attribute('share_state', "share state")
++                self.askForOverlay(filename)
++                break
++            else:
++                print( "Not in scope:"+filename )
diff --git a/debian/patches/series b/debian/patches/series
index 01d0e06..4dcdcf2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-debian_version.patch
 0003-skip_tests_freebsd.patch
 0004-shell_integration_copyright.patch
+0005-Fix-minor-Python-syntax-errors.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list