~vcs-imports/specto/0.2

« back to all changes in this revision

Viewing changes to spectlib/watch_port.py

  • Committer: nekohayo
  • Date: 2007-03-13 19:02:35 UTC
  • Revision ID: vcs-imports@canonical.com-20070313190235-f0c58a8ec47484fb
Fix the indentation (hopefully?) in watch_port. Do not forget, folks, that we need 
to use four (4) spaces, NOT tabs, otherwise the code will explode. Maybe this will 
fix issue #32? Need someone to test if possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
            gtk.main_iteration()  
67
67
                
68
68
    def update(self, lock):
69
 
        """ See if a file was modified or created. """
 
69
        """ See if a socket was opened or closed. """
70
70
        self.error = False
71
71
        self.specto.mark_watch_busy(True, self.id)
72
72
        self.specto.logger.log(_("Updating watch: \"%s\"") % self.name, "info", self.__class__)
94
94
        y=os.popen( 'netstat -nt','r').read().splitlines()
95
95
        del y[0]
96
96
        del y[0]
97
 
        for k in y:
98
 
            k = k.split(' ')
99
 
            while True:
100
 
                try:
101
 
                    k.remove('')
102
 
                except:
103
 
                    break
104
 
            if int(k[3].split(':')[1]) == int(self.port):
105
 
                conn = True
 
97
        for k in y:
 
98
            k = k.split(' ')
 
99
            while True:
 
100
                try:
 
101
                    k.remove('')
 
102
                except:
 
103
                    break
 
104
                if int(k[3].split(':')[1]) == int(self.port):
 
105
                    conn = True
106
106
 
107
 
        if conn:
 
107
        if conn:
108
108
            return True
109
109
        else:
110
110
            return False