def fix_imports(script):
    """
    Replace "from PyQt5 import" by "from pyqode.qt import".

    :param script: script path
    """
    with open(script, 'r') as f_script:
        lines = f_script.read().splitlines()
    new_lines = []
    for l in lines:
        if l.startswith('import '):
            l = 'from . ' + l
        if 'from PyQt5 import' in l:
            l = l.replace('from PyQt5 import', 'from pyqode.qt import')
        new_lines.append(l)
    with open(script, 'w') as f_script:
        f_script.write('\n'.join(new_lines))
