Code Duplication    Length = 10-10 lines in 2 locations

mycluster/sge.py 2 locations

@@ 214-223 (lines=10) @@
211
                for line in f:
212
                    if line[0] != ' ':
213
                        name = line.split(' ')[0]
214
                        if name != 'global':
215
                            new_line = re.sub(' +',' ',line).strip()
216
                            if new_line.split(' ')[3] != '-':
217
                                config['max task']   = int(new_line.split(' ')[4])
218
                                config['max thread'] = int(new_line.split(' ')[5])
219
                                config['max memory'] =     new_line.split(' ')[7]
220
                            else:
221
                                config['max task']   = 0
222
                                config['max thread'] = 0
223
                                config['max memory'] = 0
224
    return config
225
226
def create_submit(queue_id,**kwargs):
@@ 200-209 (lines=10) @@
197
                for line in f:
198
                    if line[0] != ' ':
199
                        name = line.split(' ')[0]
200
                        if name != 'global':
201
                            new_line = re.sub(' +',' ',line).strip()
202
                            if new_line.split(' ')[3] != '-':
203
                                config['max task']   = int(new_line.split(' ')[2])
204
                                config['max thread'] = int(new_line.split(' ')[2])
205
                                config['max memory'] =     new_line.split(' ')[4]
206
                            else:
207
                                config['max task']   = 0
208
                                config['max thread'] = 0
209
                                config['max memory'] = 0
210
            else:
211
                for line in f:
212
                    if line[0] != ' ':