#!/usr/bin/python2
# [Pluma Tool]
# Name=Switch onto a file .c and .h
# Name[ar]=حوّل إلى ملفات .c و .h
# Name[ast]=Cambiar a un ficheru .c y .h
# Name[ca]=Passa a un fitxer .c i .h
# Name[cmn]=切換到檔案 .c 與 .h
# Name[cs]=Přepnout na soubor .c a .h
# Name[da]=Skift over på en fil .c og .h
# Name[de]=Zu einer .c und .h Datei wechseln
# Name[el]=Αλλαγή σε ένα αρχείο .c και .h
# Name[en_AU]=Switch onto a file .c and .h
# Name[en_GB]=Switch onto a file .c and .h
# Name[es]=Cambiar a un archivo .c y .h
# Name[eu]=Aldatu .c edo .h fitxategi batera
# Name[fr]=Basculer vers un fichier .c et .h
# Name[gl]=Cambiar entre os ficheiros .c e .h
# Name[hu]=Kapcsoljon rá egy .c és egy .h fájlt
# Name[id]=Berpindah ke berkas .c dan .h
# Name[it]=Passa tra file .c e .h
# Name[ja]=.cファイルと.hファイルを切り替える
# Name[ko]=.c 파일과 .h 파일로 전환
# Name[lt]=Perjungti į failą .c ir .h
# Name[ms]=Tukar ke fail .c dan .h
# Name[nl]=Wisselen naar een .c- en .h-bestand
# Name[pl]=Przełącz na plik .c i .h
# Name[pt]=Passar para um ficheiro .c e .h
# Name[pt_BR]=Alterna entre um arquivo .c e .h
# Name[ro]=Schimba intr-un fisier de tip .c sau .h
# Name[ru]=Переключить на файлы .c и .h
# Name[sk]=Prepnúť na súbor .c a .h
# Name[sl]=Preklopi na datoteko .c in .h
# Name[sr]=Пребацује се на датотеку „.c“ и „.h“
# Name[sv]=Växla till en fil .c och .h
# Name[tr]=.c ve .h dosyasına geç
# Name[uk]=Перемкнути на файли .c та .h
# Name[zh_CN]=切换到一个 .c 或 .h 文件
# Name[zh_TW]=在檔案 .c 和 .h 間切換
# Shortcut=<Shift><Alt>s
# Applicability=all
# Output=nothing
# Input=nothing
# Save-files=nothing

# Copyright © 2011 Perberos
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import os

name = os.environ["PLUMA_CURRENT_DOCUMENT_NAME"]

if name.endswith('.c'):
	os.system("pluma %s.h" % ".".join(name.split('.')[:-1]))
if name.endswith('.h'):
	os.system("pluma %s.c" % ".".join(name.split('.')[:-1]))
