diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-17 16:26:43 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-17 16:44:06 +0800 |
commit | 8750c21d6838bd83065f735470fb96de867ed31f (patch) | |
tree | 3ff8457567480e3fc6dbca285c3559b19acec2c4 /tools/libtpcodegen.py | |
parent | f9a38137925ff6f712afe21961614a1efb3b35ea (diff) | |
download | gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.gz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.bz2 gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.lz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.xz gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.tar.zst gsoc2013-empathy-8750c21d6838bd83065f735470fb96de867ed31f.zip |
sync tools/* with tp-glib master
Fix extensions/Makefile.am to build with the new tools.
Diffstat (limited to 'tools/libtpcodegen.py')
-rw-r--r-- | tools/libtpcodegen.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/libtpcodegen.py b/tools/libtpcodegen.py index 837ff2f74..7e9eb9a50 100644 --- a/tools/libtpcodegen.py +++ b/tools/libtpcodegen.py @@ -20,7 +20,7 @@ please make any changes there. # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - +import os from string import ascii_letters, digits @@ -28,6 +28,18 @@ NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" _ASCII_ALNUM = ascii_letters + digits +def file_set_contents(filename, contents): + try: + os.remove(filename) + except OSError: + pass + try: + os.remove(filename + '.tmp') + except OSError: + pass + + open(filename + '.tmp', 'w').write(contents) + os.rename(filename + '.tmp', filename) def cmp_by_name(node1, node2): return cmp(node1.getAttributeNode("name").nodeValue, |