Project

General

Profile

Anomalie #7609

terminal sans capacité à mettre à une colonne fait planter 'instance'

Added by Gilles Grandgérard over 9 years ago. Updated over 9 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Category:
-
Start date:
Due date:
03/21/2014
% Done:

100%

Distribution:
EOLE 2.4

Description

lancer par

python monitor_instance.py

./monitor_instance1.sh

#!/bin/bash
instance --debug 2>&1

./monitor_instance.py

#!/usr/bin/env python

from subprocess import Popen, PIPE, STDOUT 
import pty
import os
import select

def doInstance():
    master, slave = pty.openpty()
    process = Popen( ['./monitor_instance1.sh'], shell=True, bufsize=0, stdout=slave, stderr=STDOUT, close_fds=True)
    while 1:
        ready, _, _ = select.select([master], [], [], .04)
        if ready:
            data = os.read(master, 512)
            if not data:
                break
            data = data.strip().rstrip()
            print("mon:-" + data + '-')
        elif process.poll() is not None: # select timeout
            break # proc exited
    os.close(slave)
    os.close(master)
    process.wait()

if __name__ == '__main__':
    doInstance()

Associated revisions

Revision 6b0eae86 (diff)
Added by Emmanuel GARETTE over 9 years ago

pyeole/ihm.py : ne plus planter si le TERM ne support pas les colonnes (fixes #7609)

History

#1 Updated by Emmanuel GARETTE over 9 years ago

  • Project changed from creole to eole-common
  • Due date set to 03/21/2014
  • Assigned To set to Emmanuel GARETTE
  • Target version changed from 189 to Eole 2.4-RC3

#2 Updated by Emmanuel GARETTE over 9 years ago

  • Status changed from Nouveau to Résolu
  • % Done changed from 0 to 100

#3 Updated by Emmanuel GARETTE over 9 years ago

  • Status changed from Résolu to Fermé

C'est OK avec les deux scripts donnés.

Also available in: Atom PDF