[wingide-users] running script on save?

Marcin Krol mrkafk at gmail.com
Mon Jan 10 08:28:51 MST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

I can't get this to work, here's my editor-extensions.py:

def _connect_to_savepoint(doc):
  def _on_savepoint(filename, encoding):
    ed = wingapi.gApplication.OpenEditor(doc.GetFilename())
    if ed is not None:
      fo = open(r'c:\test.txt', 'wb')
      fo.write(doc.GetFilename())
      fo.close()
  connect_id = doc.Connect('save-point', _on_savepoint)

def _init():
  wingapi.gApplication.Connect('document-open', _connect_to_presave)
  wingapi.gApplication.Connect('save-point', _connect_to_savepoint)
  for doc in wingapi.gApplication.GetOpenDocuments():
    _connect_to_presave(doc)
    _connect_to_savepoint(doc)

Could you please take a look at this?


- --

Regards,
mk

- --
Premature optimization is the root of all fun.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNKyWzAAoJEFMgHzhQQ7hOuEAH/1vFdDCVu9I8mtZkslyncSBX
oSIrJkrfQ5VpYtAAZhcnIaZiY64CtURR1AnNHKyb0Q97InG35fTh2i18r/DGA5mT
ETxShee3MLP+zl1ZqJddjV9OvRcaxBl6PDYBSrt5NtwIRt4XZ7MhOBTwYuxJvRgw
3qBmO/20sGPz6AG8CZPHgwV07hSZ+8FWg146IITzZOgxqpkwbUDfWE/dvTySKdlb
N4R/7KHT7U2nGGm+/np8qBxayBE/SqKTX5ApJr1F4dZFUeuegY7a4cMPWXs0nqB9
g1ZtNXhcXmnvBLyF20v/42ixVZT3IdGPj+QzFGWvCBVoLX2VgPhuzCOy1De/a/w=
=LGRo
-----END PGP SIGNATURE-----


More information about the wingide-users mailing list