hotssh-0.2.6+dfsg1/0000755000175000017500000000000011777064501012503 5ustar javijavihotssh-0.2.6+dfsg1/po/0000755000175000017500000000000011122614266013112 5ustar javijavihotssh-0.2.6+dfsg1/po/en_CA.po0000644000175000017500000000117111035655263014424 0ustar javijavi# English (Canadian) translation. # Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the cheese package. # # Colin Walters # #, fuzzy msgid "" msgstr "" "Project-Id-Version: hotssh VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-04-22 22:37+0100\n" "PO-Revision-Date: 2008-07-11 22:39+0000\n" "Last-Translator: Colin Walters \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: hotssh.desktop.in:1 msgid "Secure Shell" msgstr "Secure Shell, Eh?" hotssh-0.2.6+dfsg1/po/POTFILES.in0000644000175000017500000000035711043465530014674 0ustar javijavi# List of source files containing translatable strings. # Please keep this file sorted alphabetically. [encoding: UTF-8] hotssh.desktop.in hotssh/hotlib/timesince.py hotssh/hotvte/vteterm.py hotssh/hotvte/vtewindow.py hotssh/sshwindow.py hotssh-0.2.6+dfsg1/po/LINGUAS0000644000175000017500000000012311075151141014126 0ustar javijavi# please keep this list sorted alphabetically ar ca es fi fr ja nb pt pt_BR sl sv hotssh-0.2.6+dfsg1/po/POTFILES.skip0000644000175000017500000000014711035653744015240 0ustar javijavi# List of source files that should *not* be translated. # Please keep this file sorted alphabetically. hotssh-0.2.6+dfsg1/po/pt.po0000644000175000017500000001364611075151141014102 0ustar javijavi# Portuguese translation of hotssh # Copyright © 2008 hotssh. # This file is distributed under the same license as the hotssh package. # António Lima , 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-10-01 00:02+0100\n" "PO-Revision-Date: 2008-09-08 14:48-0100\n" "Last-Translator: António Lima \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Portuguese\n" "X-Poedit-Country: PORTUGAL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Ligar a um computador remoto utilizando uma Consola Segura" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Consola Segura" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "ano" msgstr[1] "anos" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mês" msgstr[1] "meses" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "semana" msgstr[1] "semanas" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dia" msgstr[1] "dias" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "hora" msgstr[1] "horas" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minuto" msgstr[1] "minutos" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "no futuro" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "há menos de 1 minuto atrás" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s, %(number2)d %(type2)s atrás" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s atrás" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Copiar" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Copiar o texto seleccionado" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "_Colar" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Colar texto" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Abrir Link" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Separador de Procura" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Ficheiro" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Destacar Separador" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Fechar" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "_Sair" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Editar" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Ver" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Ajuda" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "_Sobre" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Uma interface para o OpenSSH, um cliente de Consola Segura\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Opções" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Exemplo: " #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Nova Ligação de Consola Segura" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "_Ligar" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Servidor: " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Utilizador: " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Histórico" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Ligação" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Tempo" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Local" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Nome" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Endereço" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Ligação fechada" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "A ligar" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Ligado; latência de %.2fs; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "A ligação expirirou" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "A verificar a ligação" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "Ligação à rede alterada" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Ligar ao servidor" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Abrir uma nova ligação de Consola Segura" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Novo separador para ligação" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Abrir um novo separador para o mesmo computador remoto" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Abrir SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Abrir uma ligação SFTP" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "_Religar" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Reiniciar a ligação ao servidor" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "R_eligar Todas" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Reiniciar todas as ligações" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "Restaurar sessão gravada?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Religar a %d servidor" msgstr[1] "Religar a %d servidores" hotssh-0.2.6+dfsg1/po/ar.po0000644000175000017500000001550111045643435014062 0ustar javijavi# Arabic translations for PACKAGE package. # Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Automatically generated, 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-07-31 11:07+0100\n" "PO-Revision-Date: 2008-08-02 10:49+0100\n" "Last-Translator: Djihed Afifi \n" "Language-Team: Arabeyes \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Arabic\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "صدفة آمنة" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "سنة" msgstr[1] "سنة واحدة" msgstr[2] "سنتان" msgstr[3] "سنوات" msgstr[4] "سنة" msgstr[5] "سنة" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "شهر" msgstr[1] "شهر واحد" msgstr[2] "شهران" msgstr[3] "أشهر" msgstr[4] "شهر" msgstr[5] "شهر" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "أسبوع" msgstr[1] "أسبوع" msgstr[2] "أسبوعان" msgstr[3] "أسابيع" msgstr[4] "أسبوع" msgstr[5] "أسبوع" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "يوم" msgstr[1] "يوم واحد" msgstr[2] "يومان" msgstr[3] "أيام" msgstr[4] "يوم" msgstr[5] "يوم" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "ساعة" msgstr[1] "ساعة" msgstr[2] "ساعتان" msgstr[3] "ساعات" msgstr[4] "ساعة" msgstr[5] "ساعة" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "دقيقة" msgstr[1] "دقيقة واحدة" msgstr[2] "دقيقتان" msgstr[3] "دقائق" msgstr[4] "دقيقة" msgstr[5] "دقيقة" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "في المستقبل" #: ../hotssh/hotlib/timesince.py:72 #, fuzzy msgid "less than 1 minute ago" msgstr "_تاريخ التّعديل أقل من" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "" #: ../hotssh/hotlib/timesince.py:86 #, fuzzy, python-format msgid "%(number)d %(type)s ago" msgstr "نوع سيء لرقم VT \n" #: ../hotssh/hotvte/vteterm.py:81 #: ../hotssh/hotvte/vtewindow.py:249 msgid "_Copy" msgstr "ا_نسخ" #: ../hotssh/hotvte/vteterm.py:81 #, fuzzy msgid "Copy selected text" msgstr "نسخ النّص المنتقى للحافظة الوسيطة" #: ../hotssh/hotvte/vteterm.py:82 #: ../hotssh/hotvte/vtewindow.py:250 msgid "_Paste" msgstr "ا_لصق" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "لصق نص" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "افتح وصلة" #: ../hotssh/hotvte/vtewindow.py:35 #, fuzzy msgid "Tab Search" msgstr "محركات بحث" #: ../hotssh/hotvte/vtewindow.py:241 msgid "File" msgstr "ملف" #: ../hotssh/hotvte/vtewindow.py:242 #, fuzzy msgid "_Detach Tab" msgstr "فصل التبويب" #: ../hotssh/hotvte/vtewindow.py:244 msgid "_Close" msgstr "أ_غلق" #: ../hotssh/hotvte/vtewindow.py:246 msgid "_Quit" msgstr "أ_نه" #: ../hotssh/hotvte/vtewindow.py:248 msgid "Edit" msgstr "تحرير" #: ../hotssh/hotvte/vtewindow.py:251 msgid "View" msgstr "عرض" #: ../hotssh/hotvte/vtewindow.py:252 msgid "Help" msgstr "مساعدة" #: ../hotssh/hotvte/vtewindow.py:253 msgid "_About" msgstr "_عن" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" #: ../hotssh/sshwindow.py:332 msgid "Options" msgstr "خيارات" #: ../hotssh/sshwindow.py:343 msgid "Example: " msgstr "مثال:" #: ../hotssh/sshwindow.py:358 #, fuzzy msgid "New Secure Shell Connection" msgstr "مفتاح صدفة آمنة جديد" #: ../hotssh/sshwindow.py:371 msgid "C_onnect" msgstr "إِ_تّصل" #: ../hotssh/sshwindow.py:398 msgid "Host: " msgstr "المضيف:" #: ../hotssh/sshwindow.py:417 msgid "User: " msgstr "المستخدم:" #: ../hotssh/sshwindow.py:441 msgid "History" msgstr "تاريخ" #: ../hotssh/sshwindow.py:453 #: ../hotssh/sshwindow.py:1421 msgid "Connection" msgstr "إتصال" #: ../hotssh/sshwindow.py:456 msgid "Time" msgstr "الوقت" #: ../hotssh/sshwindow.py:462 msgid "Local" msgstr "محلًي" #: ../hotssh/sshwindow.py:470 msgid "Name" msgstr "الاسم" #: ../hotssh/sshwindow.py:473 msgid "Address" msgstr "العنوان" #: ../hotssh/sshwindow.py:1134 #, fuzzy msgid "Connection closed" msgstr "غطاء مغلق" #: ../hotssh/sshwindow.py:1300 msgid "Connecting" msgstr "يجري الاتصال" #: ../hotssh/sshwindow.py:1302 #, fuzzy, python-format msgid "Connected; %.2fs latency; %s" msgstr "تم الاتصال مع %s باستخدام %s" #: ../hotssh/sshwindow.py:1304 msgid "Connection timed out" msgstr "نفاذ الوقت للاتصال" #: ../hotssh/sshwindow.py:1306 msgid "Checking connection" msgstr "التحقق من الاتصال" #: ../hotssh/sshwindow.py:1331 #, fuzzy msgid "Network connection changed" msgstr "خدمة شبكية موجّهة بالاتصال" #: ../hotssh/sshwindow.py:1415 msgid "Connect to server" msgstr "إتّصل بالخادم..." #: ../hotssh/sshwindow.py:1416 #, fuzzy msgid "Open a new Secure Shell connection" msgstr "عبارة سر لمفتاح الصدفة الآمنة الجديد" #: ../hotssh/sshwindow.py:1417 #, fuzzy msgid "New tab for connection" msgstr "بانتظار اتّصال telnet..." #: ../hotssh/sshwindow.py:1418 msgid "Open a new tab for the same remote computer" msgstr "" #: ../hotssh/sshwindow.py:1419 #, fuzzy msgid "Open SFTP" msgstr "%sملفات FTP" #: ../hotssh/sshwindow.py:1420 #, fuzzy msgid "Open a SFTP connection" msgstr "فشل فتح إتصال مع الناقل: %s\n" #: ../hotssh/sshwindow.py:1422 #: ../hotssh/sshwindow.py:1511 msgid "_Reconnect" msgstr "ا_عد الإتصال" #: ../hotssh/sshwindow.py:1422 #, fuzzy msgid "Reset connection to server" msgstr "فشل الاتصال بالخادم %1: %2." #: ../hotssh/sshwindow.py:1423 #, fuzzy msgid "R_econnect All" msgstr "انسخ ال_كل" #: ../hotssh/sshwindow.py:1423 #, fuzzy msgid "Reset all connections" msgstr "تنضيد كل الفلاتر" #: ../hotssh/sshwindow.py:1510 #, fuzzy msgid "Restore saved session?" msgstr "حُفِظت جلستُك." #: ../hotssh/sshwindow.py:1515 #, fuzzy, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "تشفير مضيف إلى مضيف" msgstr[1] "" hotssh-0.2.6+dfsg1/po/ja.po0000644000175000017500000001437111075151141014045 0ustar javijavi# hotssh ja.po. # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the hotssh package. # Takeshi AIHANA , 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh trunk\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-10-05 22:26+0900\n" "PO-Revision-Date: 2008-10-05 22:26+0900\n" "Last-Translator: Takeshi AIHANA \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "SSH を使ってリモートのコンピュータに接続します" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "セキュア・シェル" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "年" msgstr[1] "年" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "ヶ月" msgstr[1] "ヶ月" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "週間" msgstr[1] "週間" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "日" msgstr[1] "日" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "時間" msgstr[1] "時間" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "分" msgstr[1] "分" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "未来" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "1分未満前" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s、%(number2)d %(type2)s 前" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s 前" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "コピー(_C)" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "選択した文字列をクリップボードにコピーします" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "貼り付け(_P)" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "クリップボードから貼り付けます" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "リンクを開く" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "タブの検索" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "ファイル" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "タブを取り外す(_D)" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "閉じる(_C)" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "終了(_Q)" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "編集" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "表示" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "ヘルプ" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "情報(_A)" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "セキュア・シェルのクライアントである OpenSSH の GUI 版です。\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "オプション" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "例: " #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "新しいセキュア・シェルの接続" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "接続する(_O)" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "ホスト名: " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "ユーザ名: " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "接続の履歴" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "接続先" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "時間" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "ローカル" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "名前" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "IP-アドレス" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "接続を閉じました" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "接続中です" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "接続中; %.2f秒遅れ; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "接続がタイムアウトしました" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "接続の確認中" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "ネットワークの接続が変更になりました" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "サーバへ接続" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "新しいセキュア・シェルの接続を開きます" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "新たにタブで開く" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "現在のリモート接続に対して新しいタブを開きます" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "SFTP で開く" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "SFTP の接続を開きます" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "再接続(_R)" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "サーバへの接続をリセットします" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "全て再接続(_E)" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "全ての接続をリセットします" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "保存したセッションをリストアしますか?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] " %d個のホストに再接続します" msgstr[1] " %d個のホストに再接続します" hotssh-0.2.6+dfsg1/po/nb.po0000644000175000017500000001247111075151141014051 0ustar javijavi# Norwegian (bokmål dialect) translation of the gnome-network module # Copyright (C) 1998, 1999 Free Software Foundation, Inc. # Kjartan Maraas , 1998-2008. # Eskild Hustvedt , 2007 # msgid "" msgstr "" "Project-Id-Version: gnome-nettool 2.15.x\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-10-08 20:32+0200\n" "PO-Revision-Date: 2008-10-08 20:35+0200\n" "Last-Translator: Eskild Hustvedt \n" "Language-Team: Norwegian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Komle til en ekstern datamaskin med sikkert skall" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Sikkert skall" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "år" msgstr[1] "år" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "måned" msgstr[1] "måneder" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "uke" msgstr[1] "uker" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dag" msgstr[1] "dager" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "time" msgstr[1] "timer" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minutt" msgstr[1] "minutter" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "i fremtiden" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "mindre enn 1 minutt siden" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Kopier" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Kopier valgt tekst" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "_Lim inn" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Lim inn tekst" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Åpne lenke" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Fil" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Lukk" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "A_vslutt" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Rediger" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Vis" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Hjelp" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "_Om" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Alternativer" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Eksempel:" #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "K_oble til" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Vert: " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Bruker: " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Historikk" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Tilkobling" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Tid" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Lokal" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Navn" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Adresse" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Tilkobling lukket" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Kobler til" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Koble til tjener" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Åpne SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Åpne en SFTP-tilkobling" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "" msgstr[1] "" hotssh-0.2.6+dfsg1/po/fi.po0000644000175000017500000001346511075151141014054 0ustar javijavi# Finnish messages for hotssh. # Copyright (C) 2008 Free Software Foundation Inc. # # Ilkka Tuohela , 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-09-22 08:57+0300\n" "PO-Revision-Date: 2008-09-22 08:00+0300\n" "Last-Translator: Ilkka Tuohela \n" "Language-Team: Finnish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.2\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Ota toiseen tietokoneeseen yhteyttä SSH:lla" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "SSH" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "vuosi" msgstr[1] "vuotta" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "kuukausi" msgstr[1] "kuukautta" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "viikko" msgstr[1] "viikkoa" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "päivä" msgstr[1] "päivää" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "tunti" msgstr[1] "tuntia" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minuutti" msgstr[1] "minuuttia" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "tulevaisuudessa" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "alle minuutti sitten" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s, %(number2)d %(type2)s sitten" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s sitten" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Kopioi" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Kopioi valittu teksti" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "_Liitä" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Liitä tekstiä" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Avaa linkki" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Välilehtien haku" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Tiedosto" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Irrota välilehti" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Sulje" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "_Lopeta" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Muokkaa" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Näytä" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Ohje" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "_Tietoja" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Käyttäliittymä OpenSSH:lle, SSH-asiakasohjelmalle\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Valitsimet" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Esimerkki:" #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Uusi SSH-yhteys" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "_Yhdistä" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Palvelin:" #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Käyttäjä:" #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Historia" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Yhteys" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Aika" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Paikallinen" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Nimi" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Osoite" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Yhteys katkaistu" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Yhdistetään" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Yhdistetty: %.2fs latenssi: %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "Yhteys aikakatkaistiin" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "Tarkistetaan yhteyttä" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "Verkkoyhteys on vaihtunut" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Yhdistä palvelimeen" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Avaa uusi SSH-yhteys" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Uusi välilehti yhteydelle" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Avaa uusi välilehti samalle palvelimelle" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Avaa SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Avaa SFTP-yhteys" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "Yh_distä uudestaan" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Nollaa yhteys palvelimeen" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "Yhdistä _kaikki uudestaan" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Nollaa kaikki yhteydet" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "Palautetaanko tallennettu istunto?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Yhdistä %d palvelimeen uudestaan" msgstr[1] "Yhdistä %d palvelimeen uudestaan" hotssh-0.2.6+dfsg1/po/wscript_build0000644000175000017500000000007111122605535015704 0ustar javijaviobj=bld.new_task_gen('intltool_po') obj.appname='hotssh' hotssh-0.2.6+dfsg1/po/pt_BR.po0000644000175000017500000001404611075151141014460 0ustar javijavi# Brazilian Portuguese translation of hotssh. # Copyright (C) 2008 Colin Walters # This file is distributed under the same license as the hotssh package. # Alexsandro Haag , 2008. # Leonardo Ferreira Fontenelle , 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-08-23 23:38-0300\n" "PO-Revision-Date: 2008-08-23 23:41-0300\n" "Last-Translator: Leonardo Ferreira Fontenelle \n" "Language-Team: Portuguese/Brazil \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" # Descrição do item do menu Aplicativos #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Conecte-se a um computador remoto usando SSH" # Rótulo do item do menu Aplicativos #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "SSH" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "ano" msgstr[1] "anos" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mês" msgstr[1] "meses" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "semana" msgstr[1] "semanas" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dia" msgstr[1] "dias" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "hora" msgstr[1] "horas" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minuto" msgstr[1] "minutos" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "no futuro" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "menos que 1 minuto atrás" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s, %(number2)d %(type2)s atrás" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s atrás" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Copiar" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Copia o texto selecionado" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "C_olar" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Cola o texto" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Abrir link" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Pesquisar aba" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Arquivo" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Desanexar aba" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Fechar" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "Sai_r" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Editar" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Ver" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Ajuda" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "So_bre" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Uma interface para OpenSSH, um cliente de SSH\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Opções" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Exemplo: " #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Nova conexão de SSH" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "C_onectar" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Máquina: " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Usuário: " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Histórico" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Conexão" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Tempo" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Local" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Nome" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Endereço" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Conexão fechada" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Conectando" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Conectado; %.2fs latência; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "Tempo esgotado da conexão" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "Verificando conexão" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "A conexão de rede mudou" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Conectar para o servidor" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Abre uma nova conexão de SSH" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Nova aba para conexão" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Abre uma nova aba para o mesmo computador remoto" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Abrir SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Abre uma conexão SFTP" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "_Reconectar" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Reinicia conexão com servidor" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "R_econectar todas" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Reinicia todas as conexões" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "Restaurar a sessão salva?" #. Translators: %d is the number of hosts we are about to reconnect to. #: ../hotssh/sshwindow.py:1520 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Reconectar a %d máquina" msgstr[1] "Reconectar a %d máquinas" hotssh-0.2.6+dfsg1/po/fr.po0000644000175000017500000001410611075151141014056 0ustar javijavi# French translation of hotssh. # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the hotssh package. # # Robert-André Mauchin , 2008 # msgid "" msgstr "" "Project-Id-Version: libepc HEAD\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-09-27 16:26+0200\n" "PO-Revision-Date: 2008-09-27 16:27+0200\n" "Last-Translator: Robert-André Mauchin \n" "Language-Team: GNOME French Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Se connecter à un ordinateur distant en utilisant un shell sécurisé" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Shell sécurisé" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "année" msgstr[1] "années" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mois" msgstr[1] "mois" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "semaine" msgstr[1] "semaines" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "jour" msgstr[1] "jours" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "heure" msgstr[1] "heures" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minute" msgstr[1] "minutes" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "dans le futur" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "il y a moins d'une minute" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "il y a %(number)d %(type)s, %(number2)d %(type2)s" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "il y a %(number)d %(type)s" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Copier" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Copie le texte sélectionné" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "C_oller" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Colle le texte" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Ouvrir un lien" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Recherche d'onglet" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Fichier" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Détacher l'onglet" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Fermer" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "_Quitter" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Édition" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Affichage" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Aide" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "À _propos" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Une interface pour OpenSSH, un client de shell sécurisé\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Options" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Exemple : " #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Nouvelle connexion de shell sécurisé" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "Se c_onnecter" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Hôte : " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Utilisateur : " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Historique" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Connexion" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Temps" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Local" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Nom" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Adresse" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Connexion fermée" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Connexion en cours" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Connecté ; latence de %.2fs ; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "Le délai de connexion est dépassé" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "Vérification de la connexion" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "La connexion au réseau a été modifiée" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Se connecter au serveur" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Ouvre une nouvelle connexion de shell sécurisé" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Nouvel onglet pour la connexion" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Ouvre un nouvel onglet vers le même ordinateur distant" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Ouvrir un SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Ouvre une connexion SFTP" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "Se _reconnecter" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Réinitialise la connexion vers le serveur" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "Tout r_econnecter" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Réinitialise toutes les connexions" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "Rétablir les sessions enregistrées ?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Se reconnecter à %d hôte" msgstr[1] "Se reconnecter à %d hôtes" hotssh-0.2.6+dfsg1/po/ca.po0000644000175000017500000001401011043465530014031 0ustar javijavi# Catalan translation of hotssh. # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the hotssh package. # Gil Forcada \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Connecta't a un ordinador remot utilitzant un intèrpret d'ordres segur" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Intèrpret d'ordres segur" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "any" msgstr[1] "anys" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mes" msgstr[1] "mesos" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "setmana" msgstr[1] "setmanes" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dia" msgstr[1] "dies" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "hora" msgstr[1] "hores" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minut" msgstr[1] "minuts" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "en el futur" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "fa menys d'un minut" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "fa %(number)d %(type)s, %(number2)d %(type2)s" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "fa %(number)d %(type)s" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:230 msgid "_Copy" msgstr "_Copia" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Copia el text seleccionat" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:231 msgid "_Paste" msgstr "_Enganxa" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Enganxa el text" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Obre l'enllaç" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Pestanya de cerca" #: ../hotssh/hotvte/vtewindow.py:222 msgid "File" msgstr "Fitxer" #: ../hotssh/hotvte/vtewindow.py:223 msgid "_Detach Tab" msgstr "_Separa la pestanya" #: ../hotssh/hotvte/vtewindow.py:225 msgid "_Close" msgstr "_Tanca" #: ../hotssh/hotvte/vtewindow.py:227 msgid "_Quit" msgstr "_Surt" #: ../hotssh/hotvte/vtewindow.py:229 msgid "Edit" msgstr "Edita" #: ../hotssh/hotvte/vtewindow.py:232 msgid "View" msgstr "Visualitza" #: ../hotssh/hotvte/vtewindow.py:233 msgid "Help" msgstr "Ajuda" #: ../hotssh/hotvte/vtewindow.py:234 msgid "_About" msgstr "_Quant a" #: ../hotssh/sshwindow.py:84 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Una interfície per a l'OpenSSH, un client d'intèrpret d'ordres segur\n" "\n" #: ../hotssh/sshwindow.py:261 msgid "Options" msgstr "Opcions" #: ../hotssh/sshwindow.py:272 msgid "Example: " msgstr "Exemple: " #: ../hotssh/sshwindow.py:287 msgid "New Secure Shell Connection" msgstr "Connexió d'intèrpret d'ordres segur nova" #: ../hotssh/sshwindow.py:300 msgid "C_onnect" msgstr "C_onnecta" #: ../hotssh/sshwindow.py:327 msgid "Host: " msgstr "Ordinador: " #: ../hotssh/sshwindow.py:346 msgid "User: " msgstr "Usuari: " #: ../hotssh/sshwindow.py:370 msgid "History" msgstr "Historial" #: ../hotssh/sshwindow.py:379 ../hotssh/sshwindow.py:1126 msgid "Connection" msgstr "Connexió" #: ../hotssh/sshwindow.py:382 msgid "Time" msgstr "Temps" #: ../hotssh/sshwindow.py:388 msgid "Local" msgstr "Local" #: ../hotssh/sshwindow.py:396 msgid "Name" msgstr "Nom" #: ../hotssh/sshwindow.py:399 msgid "Address" msgstr "Adreça" #: ../hotssh/sshwindow.py:852 msgid "Connection closed" msgstr "S'ha tancat la connexió" #: ../hotssh/sshwindow.py:1005 msgid "Connecting" msgstr "S'està connectant" #: ../hotssh/sshwindow.py:1007 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Connectat; latència de %.2fs; %s" #: ../hotssh/sshwindow.py:1009 msgid "Connection timed out" msgstr "La connexió ha expirat" #: ../hotssh/sshwindow.py:1011 msgid "Checking connection" msgstr "S'està comprovant la connexió" #: ../hotssh/sshwindow.py:1036 msgid "Network connection changed" msgstr "La connexió de la xarxa ha canviat" #: ../hotssh/sshwindow.py:1120 msgid "Connect to server" msgstr "Connecta al servidor" #: ../hotssh/sshwindow.py:1121 msgid "Open a new Secure Shell connection" msgstr "Obre una connexió d'intèrpret d'ordres segur nova" #: ../hotssh/sshwindow.py:1122 msgid "New tab for connection" msgstr "Pestanya nova per a la connexió" #: ../hotssh/sshwindow.py:1123 msgid "Open a new tab for the same remote computer" msgstr "Obre una pestanya nova per al mateix ordinador remot" #: ../hotssh/sshwindow.py:1124 msgid "Open SFTP" msgstr "Obre per SFTP" #: ../hotssh/sshwindow.py:1125 msgid "Open a SFTP connection" msgstr "Obre una connexió SFTP" #: ../hotssh/sshwindow.py:1127 ../hotssh/sshwindow.py:1217 msgid "_Reconnect" msgstr "_Torna a connectar" #: ../hotssh/sshwindow.py:1127 msgid "Reset connection to server" msgstr "Reinicia la connexió amb el servidor" #: ../hotssh/sshwindow.py:1128 msgid "R_econnect All" msgstr "T_orna a connectar-les totes" #: ../hotssh/sshwindow.py:1128 msgid "Reset all connections" msgstr "Reinicia totes les connexions" #: ../hotssh/sshwindow.py:1216 msgid "Restore saved session?" msgstr "Voleu restaurar la sessió desada?" #: ../hotssh/sshwindow.py:1221 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Torna a connectar a %d ordinador" msgstr[1] "Torna a connectar a %d ordinadors" hotssh-0.2.6+dfsg1/po/ChangeLog0000644000175000017500000000310411075151141014655 0ustar javijavi2008-10-08 Kjartan Maraas * LINGUAS: Added 'nb'. * nb.po: Added Norwegian bokmål translation. 2008-10-05 Takeshi AIHANA * ja.po: Added Japanese translation. * LINGUAS: Added 'ja' to the list. 2008-09-30 Duarte Loreto * pt.po: Added Portuguese translation by António Lima . * LINGUAS: Added Portuguese (pt) to the list. 2008-09-27 Claude Paroz * LINGUAS: * fr.po: Added French translation, by Robert-André Mauchin. 2008-09-27 Matej Urbančič * sl.po: Added Slovenian translation. * LINGUAS: Added sl. 2008-09-22 Ilkka Tuohela * fi.po: Added Finnish translation. * LINGUAS: Added fi. 2008-08-23 Leonardo Ferreira Fontenelle * pt_BR.po: Fixed the translation of "Reconnect to %d host(s)". 2008-08-20 Leonardo Ferreira Fontenelle * LINGUAS: Added pt_BR. * pt_BR.po: Added Brazilian Portuguese translation by Alexsandro Haag. 2008-08-14 Jorge Gonzalez * es.po: Updated Spanish translation by Ulises Genis * LINGUAS: Added es. 2008-08-2 Djihed Afifi * ar.po: Updated Arabic Translation by Djihed Afifi. 2008-07-31 Djihed Afifi * ar.po: Added Arabic Translation. * LINGUAS: Added ar. 2008-07-27 Gil Forcada * ca.po: Added Catalan translation. 2008-07-25 Daniel Nylander * sv.po: Added Swedish translation. * LINGUAS: Added sv. hotssh-0.2.6+dfsg1/po/sv.po0000644000175000017500000001352711043465530014112 0ustar javijavi# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-07-25 22:31+0200\n" "PO-Revision-Date: 2008-07-25 22:38+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Anslut till en fjärrdator med Secure Shell" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Secure Shell" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "år" msgstr[1] "år" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "månad" msgstr[1] "månader" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "vecka" msgstr[1] "veckor" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dygn" msgstr[1] "dygn" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "timme" msgstr[1] "timmar" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minut" msgstr[1] "minuter" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "i framtiden" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "mindre än en minut sedan" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s, %(number2)d %(type2)s sedan" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s sedan" #: ../hotssh/hotvte/vteterm.py:81 #: ../hotssh/hotvte/vtewindow.py:230 msgid "_Copy" msgstr "_Kopiera" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Kopiera markerad text" #: ../hotssh/hotvte/vteterm.py:82 #: ../hotssh/hotvte/vtewindow.py:231 msgid "_Paste" msgstr "Klistra _in" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Klistra in text" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Öppna länk" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Fliksökning" #: ../hotssh/hotvte/vtewindow.py:222 msgid "File" msgstr "Arkiv" #: ../hotssh/hotvte/vtewindow.py:223 msgid "_Detach Tab" msgstr "_Frigör flik" #: ../hotssh/hotvte/vtewindow.py:225 msgid "_Close" msgstr "S_täng" #: ../hotssh/hotvte/vtewindow.py:227 msgid "_Quit" msgstr "A_vsluta" #: ../hotssh/hotvte/vtewindow.py:229 msgid "Edit" msgstr "Redigera" #: ../hotssh/hotvte/vtewindow.py:232 msgid "View" msgstr "Visa" #: ../hotssh/hotvte/vtewindow.py:233 msgid "Help" msgstr "Hjälp" #: ../hotssh/hotvte/vtewindow.py:234 msgid "_About" msgstr "_Om" #: ../hotssh/sshwindow.py:84 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Ett gränssnitt till OpenSSH, en Secure Shell-klient\n" "\n" #: ../hotssh/sshwindow.py:261 msgid "Options" msgstr "Alternativ" #: ../hotssh/sshwindow.py:272 msgid "Example: " msgstr "Exempel: " #: ../hotssh/sshwindow.py:287 msgid "New Secure Shell Connection" msgstr "Ny Secure Shell-anslutning" #: ../hotssh/sshwindow.py:300 msgid "C_onnect" msgstr "Ans_lut" #: ../hotssh/sshwindow.py:327 msgid "Host: " msgstr "Värd: " #: ../hotssh/sshwindow.py:346 msgid "User: " msgstr "Användare: " #: ../hotssh/sshwindow.py:370 msgid "History" msgstr "Historik" #: ../hotssh/sshwindow.py:379 #: ../hotssh/sshwindow.py:1126 msgid "Connection" msgstr "Anslutning" #: ../hotssh/sshwindow.py:382 msgid "Time" msgstr "Tid" #: ../hotssh/sshwindow.py:388 msgid "Local" msgstr "Lokal" #: ../hotssh/sshwindow.py:396 msgid "Name" msgstr "Namn" #: ../hotssh/sshwindow.py:399 msgid "Address" msgstr "Adress" #: ../hotssh/sshwindow.py:852 msgid "Connection closed" msgstr "Anslutning stängdes" #: ../hotssh/sshwindow.py:1005 msgid "Connecting" msgstr "Ansluter" #: ../hotssh/sshwindow.py:1007 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Ansluten; %.2f s latens; %s" #: ../hotssh/sshwindow.py:1009 msgid "Connection timed out" msgstr "Anslutningens tidsgräns överstegs" #: ../hotssh/sshwindow.py:1011 msgid "Checking connection" msgstr "Kontrollerar anslutning" #: ../hotssh/sshwindow.py:1036 msgid "Network connection changed" msgstr "Nätverksanslutning ändrad" #: ../hotssh/sshwindow.py:1120 msgid "Connect to server" msgstr "Anslut till server" #: ../hotssh/sshwindow.py:1121 msgid "Open a new Secure Shell connection" msgstr "Öppna en ny Secure Shell-anslutning" #: ../hotssh/sshwindow.py:1122 msgid "New tab for connection" msgstr "Ny flik för anslutning" #: ../hotssh/sshwindow.py:1123 msgid "Open a new tab for the same remote computer" msgstr "Öppna en ny flik för samma fjärrdator" #: ../hotssh/sshwindow.py:1124 msgid "Open SFTP" msgstr "Öppna SFTP" #: ../hotssh/sshwindow.py:1125 msgid "Open a SFTP connection" msgstr "Öppna en SFTP-anslutning" #: ../hotssh/sshwindow.py:1127 #: ../hotssh/sshwindow.py:1217 msgid "_Reconnect" msgstr "Anslut i_gen" #: ../hotssh/sshwindow.py:1127 msgid "Reset connection to server" msgstr "Nollställ anslutning till server" #: ../hotssh/sshwindow.py:1128 msgid "R_econnect All" msgstr "Anslut alla ig_en" #: ../hotssh/sshwindow.py:1128 msgid "Reset all connections" msgstr "Nollställ alla anslutningar" #: ../hotssh/sshwindow.py:1216 msgid "Restore saved session?" msgstr "Återuppta sparad session?" #: ../hotssh/sshwindow.py:1221 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Anslut igen till %d värd" msgstr[1] "Anslut igen till %d värdar" hotssh-0.2.6+dfsg1/po/sl.po0000644000175000017500000001454411075151141014073 0ustar javijavi# This file is distributed under the same license as the package. # # Matej Urbančič , 2008. # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-09-26 04:10+0000\n" "PO-Revision-Date: 2008-09-26 08:33+0100\n" "Last-Translator: Matej Urbančič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" "X-Launchpad-Export-Date: 2007-10-05 05:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" "X-Poedit-Country: SLOVENIA\n" "X-Poedit-Language: Slovenian\n" "X-Poedit-SourceCharset: utf-8\n" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Poveži se z oddaljenim računalnikom z varno lupino" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Varna lupina" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "let" msgstr[1] "leto" msgstr[2] "leti" msgstr[3] "leta" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mesecev" msgstr[1] "mesec" msgstr[2] "meseca" msgstr[3] "meseci" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "tednov" msgstr[1] "teden" msgstr[2] "tedna" msgstr[3] "tedni" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "dni" msgstr[1] "dan" msgstr[2] "dneva" msgstr[3] "dni" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "ur" msgstr[1] "ura" msgstr[2] "uri" msgstr[3] "ure" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minut" msgstr[1] "minuta" msgstr[2] "minuti" msgstr[3] "minute" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "v prihodnosti" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "manj kot pred eno minuto" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "%(number)d %(type)s, %(number2)d %(type2)s nazaj" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "%(number)d %(type)s nazaj" #: ../hotssh/hotvte/vteterm.py:81 #: ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Kopiraj" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "_Kopiraj izbrano besedilo" #: ../hotssh/hotvte/vteterm.py:82 #: ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "_Prilepi" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Prilepi besedilo" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Odpri povezavo" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Zavihek _iskanja" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Datoteka" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Odcepi zavihek" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Zapri" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "_Zaključi" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Uredi" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Pogled" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Pomoč" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "_O Programu" #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Vmesnik za OpenSSH varni lupinski odjemalec\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Možnosti" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Primer:" #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Nova varna lupinska povezava" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "Po_veži" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Gostitelj" #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Uporabnik:" #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Zgodovina" #: ../hotssh/sshwindow.py:456 #: ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Povezava" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Čas" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Krajevno" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Ime" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Naslov" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Povezava zaprta" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Povezovanje" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Povezan; %.2fs prikritost; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "Povezava je časovno potekla" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "Preverjanje povezave" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "Omrežna povezava je spremenjena" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Poveži se s strežnikom" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Odpri novo varno lupinsko povezavo" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Nov zavihek za povezavo" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Pdpri nov zavihek za isti oddaljeni računalnik" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Odpri SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Odpri SFTP povezavo" #: ../hotssh/sshwindow.py:1425 #: ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "_Ponovno poveži" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Počisti povezavo s strežnikom" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "Ponovno poveži _vse" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Počisti vse povezave" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "Ali naj se obnovi shranjena seja?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Ponovno poveži %d gostiteljev" msgstr[1] "Ponovno poveži %d gostitelja" msgstr[2] "Ponovno poveži %d gostitelja" msgstr[3] "Ponovno poveži %d gostitelje" hotssh-0.2.6+dfsg1/po/es.po0000644000175000017500000001361111075151141014056 0ustar javijavi# Spanish translation of hotssh. # Copyright (C) 2008 Free Software Foundation, Inc. # This file is distributed under the same license as the hotssh package. # # Ulises Genis , 2008. # # msgid "" msgstr "" "Project-Id-Version: hotssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-08-09 03:56+0000\n" "PO-Revision-Date: 2008-08-09 12:24-0500\n" "Last-Translator: Ulises Genis \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);" #: ../hotssh.desktop.in.h:1 msgid "Connect to a remote computer using Secure Shell" msgstr "Conectar a un equipo remoto usando Shell segura" #: ../hotssh.desktop.in.h:2 msgid "Secure Shell" msgstr "Shell segura" #: ../hotssh/hotlib/timesince.py:48 msgid "year" msgid_plural "years" msgstr[0] "año" msgstr[1] "años" #: ../hotssh/hotlib/timesince.py:49 msgid "month" msgid_plural "months" msgstr[0] "mes" msgstr[1] "meses" #: ../hotssh/hotlib/timesince.py:50 msgid "week" msgid_plural "weeks" msgstr[0] "semana" msgstr[1] "semanas" #: ../hotssh/hotlib/timesince.py:51 msgid "day" msgid_plural "days" msgstr[0] "día" msgstr[1] "días" #: ../hotssh/hotlib/timesince.py:52 msgid "hour" msgid_plural "hours" msgstr[0] "hora" msgstr[1] "horas" #: ../hotssh/hotlib/timesince.py:53 msgid "minute" msgid_plural "minutes" msgstr[0] "minuto" msgstr[1] "minutos" #. d is in the future compared to now, stop processing. #: ../hotssh/hotlib/timesince.py:70 msgid "in the future" msgstr "en el futuro" #: ../hotssh/hotlib/timesince.py:72 msgid "less than 1 minute ago" msgstr "hace menos de un minuto" #: ../hotssh/hotlib/timesince.py:83 #, python-format msgid "%(number)d %(type)s, %(number2)d %(type2)s ago" msgstr "hace %(number)d %(type)s, %(number2)d %(type2)s" #: ../hotssh/hotlib/timesince.py:86 #, python-format msgid "%(number)d %(type)s ago" msgstr "hace %(number)d %(type)s" #: ../hotssh/hotvte/vteterm.py:81 ../hotssh/hotvte/vtewindow.py:250 msgid "_Copy" msgstr "_Copiar" #: ../hotssh/hotvte/vteterm.py:81 msgid "Copy selected text" msgstr "Copiar el texto seleccionado" #: ../hotssh/hotvte/vteterm.py:82 ../hotssh/hotvte/vtewindow.py:251 msgid "_Paste" msgstr "_Pegar" #: ../hotssh/hotvte/vteterm.py:82 msgid "Paste text" msgstr "Pegar texto" #: ../hotssh/hotvte/vteterm.py:173 msgid "Open Link" msgstr "Abrir enlace" #: ../hotssh/hotvte/vtewindow.py:35 msgid "Tab Search" msgstr "Buscar solapa" #: ../hotssh/hotvte/vtewindow.py:242 msgid "File" msgstr "Archivo" #: ../hotssh/hotvte/vtewindow.py:243 msgid "_Detach Tab" msgstr "_Desprender solapa" #: ../hotssh/hotvte/vtewindow.py:245 msgid "_Close" msgstr "_Cerrar" #: ../hotssh/hotvte/vtewindow.py:247 msgid "_Quit" msgstr "_Salir" #: ../hotssh/hotvte/vtewindow.py:249 msgid "Edit" msgstr "Edición" #: ../hotssh/hotvte/vtewindow.py:252 msgid "View" msgstr "Ver" #: ../hotssh/hotvte/vtewindow.py:253 msgid "Help" msgstr "Ayuda" #: ../hotssh/hotvte/vtewindow.py:254 msgid "_About" msgstr "_Acerca de..." #: ../hotssh/sshwindow.py:97 msgid "" "An interface to OpenSSH, a Secure Shell client\n" "\n" msgstr "" "Una interfaz de OpenSSH, un cliente de Shell segura\n" "\n" #: ../hotssh/sshwindow.py:335 msgid "Options" msgstr "Opciones" #: ../hotssh/sshwindow.py:346 msgid "Example: " msgstr "Ejemplo: " #: ../hotssh/sshwindow.py:361 msgid "New Secure Shell Connection" msgstr "Nueva conexión de Shell segura" #: ../hotssh/sshwindow.py:374 msgid "C_onnect" msgstr "C_onectar" #: ../hotssh/sshwindow.py:401 msgid "Host: " msgstr "Equipo: " #: ../hotssh/sshwindow.py:420 msgid "User: " msgstr "Usuario: " #: ../hotssh/sshwindow.py:444 msgid "History" msgstr "Histórico" #: ../hotssh/sshwindow.py:456 ../hotssh/sshwindow.py:1424 msgid "Connection" msgstr "Conexión" #: ../hotssh/sshwindow.py:459 msgid "Time" msgstr "Hora" #: ../hotssh/sshwindow.py:465 msgid "Local" msgstr "Local" #: ../hotssh/sshwindow.py:473 msgid "Name" msgstr "Nombre" #: ../hotssh/sshwindow.py:476 msgid "Address" msgstr "Dirección" #: ../hotssh/sshwindow.py:1137 msgid "Connection closed" msgstr "Conexión cerrada" #: ../hotssh/sshwindow.py:1303 msgid "Connecting" msgstr "Conectando" #: ../hotssh/sshwindow.py:1305 #, python-format msgid "Connected; %.2fs latency; %s" msgstr "Conectado; %.2fs latencia; %s" #: ../hotssh/sshwindow.py:1307 msgid "Connection timed out" msgstr "Expiró la conexión" #: ../hotssh/sshwindow.py:1309 msgid "Checking connection" msgstr "Verificando conexión" #: ../hotssh/sshwindow.py:1334 msgid "Network connection changed" msgstr "Cambió la conexión de red" #: ../hotssh/sshwindow.py:1418 msgid "Connect to server" msgstr "Conectar con un servidor" #: ../hotssh/sshwindow.py:1419 msgid "Open a new Secure Shell connection" msgstr "Abrir una nueva conexión de Shell segura" #: ../hotssh/sshwindow.py:1420 msgid "New tab for connection" msgstr "Solapa nueva para conexión" #: ../hotssh/sshwindow.py:1421 msgid "Open a new tab for the same remote computer" msgstr "Abrir solapa nueva para el mismo equipo remoto" #: ../hotssh/sshwindow.py:1422 msgid "Open SFTP" msgstr "Abrir SFTP" #: ../hotssh/sshwindow.py:1423 msgid "Open a SFTP connection" msgstr "Abrir una conexión SFTP" #: ../hotssh/sshwindow.py:1425 ../hotssh/sshwindow.py:1515 msgid "_Reconnect" msgstr "_Reconectar" #: ../hotssh/sshwindow.py:1425 msgid "Reset connection to server" msgstr "Reiniciar la conexión con el servidor" #: ../hotssh/sshwindow.py:1426 msgid "R_econnect All" msgstr "R_econectar todo" #: ../hotssh/sshwindow.py:1426 msgid "Reset all connections" msgstr "Reiniciar todas las conexiones" #: ../hotssh/sshwindow.py:1514 msgid "Restore saved session?" msgstr "¿Restaurar la sesión guardada?" #: ../hotssh/sshwindow.py:1519 #, python-format msgid "Reconnect to %d host" msgid_plural "Reconnect to %d hosts" msgstr[0] "Reconectar con el equipo %d" msgstr[1] "Reconectar con los equipos %d" hotssh-0.2.6+dfsg1/waf0000755000175000017500000000665211777064501013217 0ustar javijavi#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2008 """ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import os, sys if sys.hexversion<0x203000f: raise "Waf requires Python >= 2.3" if 'PSYCOWAF' in os.environ: try:import psyco;psyco.full() except:pass VERSION="1.5.1" REVISION="3009bf2a0164643771f76f0e24c46d7e" INSTALL=sys.platform=='win32' and 'c:/temp' or '/usr/local' C1='#*' C2='#&' cwd = os.getcwd() join = os.path.join def err(m): print '\033[91mError: %s\033[0m' % m sys.exit(1) def unpack_wafdir(dir): f = open(sys.argv[0],'rb') c = "corrupted waf (%d)" while 1: line = f.readline() if not line: err("run waf-light from a folder containing wafadmin") if line == '#==>\n': txt = f.readline() if not txt: err(c % 1) if f.readline()!='#<==\n': err(c % 2) break if not txt: err(c % 3) txt = txt[1:-1].replace(C1, '\n').replace(C2, '\r') import shutil, tarfile try: shutil.rmtree(dir) except OSError: pass try: os.makedirs(join(dir, 'wafadmin', 'Tools')) except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir) os.chdir(dir) tmp = 't.tbz2' t = open(tmp,'wb') t.write(txt) t.close() t = tarfile.open(tmp) for x in t: t.extract(x) t.close() os.chmod(join('wafadmin','Tools'), 0755) os.unlink(tmp) os.chdir(cwd) def test(dir): try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir) except OSError: pass def find_lib(): name = sys.argv[0] base = os.path.dirname(os.path.abspath(name)) #devs use $WAFDIR w=test(os.environ.get('WAFDIR', '')) if w: return w #waf-light if name.endswith('waf-light'): w = test(base) if w: return w err("waf-light requires wafadmin -> export WAFDIR=/folder") dir = "/lib/waf-%s-%s/" % (VERSION, REVISION) for i in [INSTALL,'/usr','/usr/local','/opt']: w = test(i+dir) if w: return w #waf-local s = '.waf-%s-%s' if sys.platform == 'win32': s = s[1:] dir = join(base, s % (VERSION, REVISION)) w = test(dir) if w: return w #unpack unpack_wafdir(dir) return dir wafdir = find_lib() w = join(wafdir, 'wafadmin') t = join(w, 'Tools') sys.path = [w, t] + sys.path import Scripting Scripting.prepare(t, cwd, VERSION, wafdir) hotssh-0.2.6+dfsg1/MAINTAINERS0000644000175000017500000000007111045643435014173 0ustar javijaviColin Walters E-mail: walters@verbum.org Userid: walters hotssh-0.2.6+dfsg1/wafadmin/0000755000175000017500000000000011777064501014271 5ustar javijavihotssh-0.2.6+dfsg1/wafadmin/Logs.py0000644000175000017500000000430311075216573015546 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,re,logging,traceback,sys,Utils from Constants import* zones='' verbose=0 colors_lst={'USE':True,'BOLD':'\x1b[01;1m','RED':'\x1b[01;91m','GREEN':'\x1b[32m','YELLOW':'\x1b[33m','PINK':'\x1b[35m','BLUE':'\x1b[01;34m','CYAN':'\x1b[36m','NORMAL':'\x1b[0m','cursor_on':'\x1b[?25h','cursor_off':'\x1b[?25l',} if(sys.platform=='win32')or('NOCOLOR'in os.environ)or(os.environ.get('TERM','dumb')in['dumb','emacs'])or(not sys.stdout.isatty()): colors_lst['USE']=False def get_color(cl): if not colors_lst['USE']:return'' return colors_lst.get(cl,'') class foo(object): def __getattr__(self,a): return get_color(a) def __call__(self,a): return get_color(a) colors=foo() re_log=re.compile(r'(\w+): (.*)',re.M) class log_filter(logging.Filter): def __init__(self,name=None): pass def filter(self,rec): rec.c1=colors.PINK rec.c2=colors.NORMAL rec.zone=rec.module if rec.levelno>=logging.INFO: if rec.levelno>=logging.ERROR: rec.c1=colors.RED else: rec.c1=colors.GREEN return True zone='' m=re_log.match(rec.msg) if m: zone=rec.zone=m.group(1) rec.msg=m.group(2) if zones: return getattr(rec,'zone','')in zones or'*'in zones elif not verbose>2: return False return True class formatter(logging.Formatter): def __init__(self): logging.Formatter.__init__(self,LOG_FORMAT,HOUR_FORMAT) def format(self,rec): if rec.levelno>=logging.WARNING or rec.levelno==logging.INFO: return'%s%s%s'%(rec.c1,rec.msg,rec.c2) return logging.Formatter.format(self,rec) def debug(msg): msg=msg.replace('\n',' ') if verbose: logging.debug(msg) def error(msg): logging.error(msg) if verbose: if isinstance(msg,Utils.WafError): st=msg.stack else: st=traceback.extract_stack() if st: st=st[:-1] buf=[] for filename,lineno,name,line in st: buf.append(' File "%s", line %d, in %s'%(filename,lineno,name)) if line: buf.append(' %s'%line.strip()) if buf:logging.error("\n".join(buf)) warn=logging.warn info=logging.info def init_log(): log=logging.getLogger() log.handlers=[] hdlr=logging.StreamHandler() hdlr.setFormatter(formatter()) log.addHandler(hdlr) log.addFilter(log_filter()) log.setLevel(logging.DEBUG) hotssh-0.2.6+dfsg1/wafadmin/pproc.py0000644000175000017500000003471211075216573015774 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys mswindows=(sys.platform=="win32") import os import types import traceback import gc class CalledProcessError(Exception): def __init__(self,returncode,cmd): self.returncode=returncode self.cmd=cmd def __str__(self): return"Command '%s' returned non-zero exit status %d"%(self.cmd,self.returncode) if mswindows: import threading import msvcrt if 0: import pywintypes from win32api import GetStdHandle,STD_INPUT_HANDLE,STD_OUTPUT_HANDLE,STD_ERROR_HANDLE from win32api import GetCurrentProcess,DuplicateHandle,GetModuleFileName,GetVersion from win32con import DUPLICATE_SAME_ACCESS,SW_HIDE from win32pipe import CreatePipe from win32process import CreateProcess,STARTUPINFO,GetExitCodeProcess,STARTF_USESTDHANDLES,STARTF_USESHOWWINDOW,CREATE_NEW_CONSOLE from win32event import WaitForSingleObject,INFINITE,WAIT_OBJECT_0 else: from _subprocess import* class STARTUPINFO: dwFlags=0 hStdInput=None hStdOutput=None hStdError=None wShowWindow=0 class pywintypes: error=IOError else: import select import errno import fcntl import pickle __all__=["Popen","PIPE","STDOUT","call","check_call","CalledProcessError"] try: MAXFD=os.sysconf("SC_OPEN_MAX") except: MAXFD=256 try: False except NameError: False=0 True=1 _active=[] def _cleanup(): for inst in _active[:]: if inst.poll(_deadstate=sys.maxint)>=0: try: _active.remove(inst) except ValueError: pass PIPE=-1 STDOUT=-2 def call(*popenargs,**kwargs): return Popen(*popenargs,**kwargs).wait() def check_call(*popenargs,**kwargs): retcode=call(*popenargs,**kwargs) cmd=kwargs.get("args") if cmd is None: cmd=popenargs[0] if retcode: raise CalledProcessError(retcode,cmd) return retcode def list2cmdline(seq): result=[] needquote=False for arg in seq: bs_buf=[] if result: result.append(' ') needquote=(" "in arg)or("\t"in arg)or arg=="" if needquote: result.append('"') for c in arg: if c=='\\': bs_buf.append(c) elif c=='"': result.append('\\'*len(bs_buf)*2) bs_buf=[] result.append('\\"') else: if bs_buf: result.extend(bs_buf) bs_buf=[] result.append(c) if bs_buf: result.extend(bs_buf) if needquote: result.extend(bs_buf) result.append('"') return''.join(result) class Popen(object): def __init__(self,args,bufsize=0,executable=None,stdin=None,stdout=None,stderr=None,preexec_fn=None,close_fds=False,shell=False,cwd=None,env=None,universal_newlines=False,startupinfo=None,creationflags=0): _cleanup() self._child_created=False if not isinstance(bufsize,(int,long)): raise TypeError("bufsize must be an integer") if mswindows: if preexec_fn is not None: raise ValueError("preexec_fn is not supported on Windows platforms") if close_fds: raise ValueError("close_fds is not supported on Windows platforms") else: if startupinfo is not None: raise ValueError("startupinfo is only supported on Windows platforms") if creationflags!=0: raise ValueError("creationflags is only supported on Windows platforms") self.stdin=None self.stdout=None self.stderr=None self.pid=None self.returncode=None self.universal_newlines=universal_newlines (p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite)=self._get_handles(stdin,stdout,stderr) self._execute_child(args,executable,preexec_fn,close_fds,cwd,env,universal_newlines,startupinfo,creationflags,shell,p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite) if mswindows: if stdin is None and p2cwrite is not None: os.close(p2cwrite) p2cwrite=None if stdout is None and c2pread is not None: os.close(c2pread) c2pread=None if stderr is None and errread is not None: os.close(errread) errread=None if p2cwrite: self.stdin=os.fdopen(p2cwrite,'wb',bufsize) if c2pread: if universal_newlines: self.stdout=os.fdopen(c2pread,'rU',bufsize) else: self.stdout=os.fdopen(c2pread,'rb',bufsize) if errread: if universal_newlines: self.stderr=os.fdopen(errread,'rU',bufsize) else: self.stderr=os.fdopen(errread,'rb',bufsize) def _translate_newlines(self,data): data=data.replace("\r\n","\n") data=data.replace("\r","\n") return data def __del__(self,sys=sys): if not self._child_created: return self.poll(_deadstate=sys.maxint) if self.returncode is None and _active is not None: _active.append(self) def communicate(self,input=None): if[self.stdin,self.stdout,self.stderr].count(None)>=2: stdout=None stderr=None if self.stdin: if input: self.stdin.write(input) self.stdin.close() elif self.stdout: stdout=self.stdout.read() elif self.stderr: stderr=self.stderr.read() self.wait() return(stdout,stderr) return self._communicate(input) if mswindows: def _get_handles(self,stdin,stdout,stderr): if stdin is None and stdout is None and stderr is None: return(None,None,None,None,None,None) p2cread,p2cwrite=None,None c2pread,c2pwrite=None,None errread,errwrite=None,None if stdin is None: p2cread=GetStdHandle(STD_INPUT_HANDLE) if p2cread is not None: pass elif stdin is None or stdin==PIPE: p2cread,p2cwrite=CreatePipe(None,0) p2cwrite=p2cwrite.Detach() p2cwrite=msvcrt.open_osfhandle(p2cwrite,0) elif isinstance(stdin,int): p2cread=msvcrt.get_osfhandle(stdin) else: p2cread=msvcrt.get_osfhandle(stdin.fileno()) p2cread=self._make_inheritable(p2cread) if stdout is None: c2pwrite=GetStdHandle(STD_OUTPUT_HANDLE) if c2pwrite is not None: pass elif stdout is None or stdout==PIPE: c2pread,c2pwrite=CreatePipe(None,0) c2pread=c2pread.Detach() c2pread=msvcrt.open_osfhandle(c2pread,0) elif isinstance(stdout,int): c2pwrite=msvcrt.get_osfhandle(stdout) else: c2pwrite=msvcrt.get_osfhandle(stdout.fileno()) c2pwrite=self._make_inheritable(c2pwrite) if stderr is None: errwrite=GetStdHandle(STD_ERROR_HANDLE) if errwrite is not None: pass elif stderr is None or stderr==PIPE: errread,errwrite=CreatePipe(None,0) errread=errread.Detach() errread=msvcrt.open_osfhandle(errread,0) elif stderr==STDOUT: errwrite=c2pwrite elif isinstance(stderr,int): errwrite=msvcrt.get_osfhandle(stderr) else: errwrite=msvcrt.get_osfhandle(stderr.fileno()) errwrite=self._make_inheritable(errwrite) return(p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite) def _make_inheritable(self,handle): return DuplicateHandle(GetCurrentProcess(),handle,GetCurrentProcess(),0,1,DUPLICATE_SAME_ACCESS) def _find_w9xpopen(self): w9xpopen=os.path.join(os.path.dirname(GetModuleFileName(0)),"w9xpopen.exe") if not os.path.exists(w9xpopen): w9xpopen=os.path.join(os.path.dirname(sys.exec_prefix),"w9xpopen.exe") if not os.path.exists(w9xpopen): raise RuntimeError("Cannot locate w9xpopen.exe, which is needed for Popen to work with your shell or platform.") return w9xpopen def _execute_child(self,args,executable,preexec_fn,close_fds,cwd,env,universal_newlines,startupinfo,creationflags,shell,p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite): if not isinstance(args,types.StringTypes): args=list2cmdline(args) if startupinfo is None: startupinfo=STARTUPINFO() if None not in(p2cread,c2pwrite,errwrite): startupinfo.dwFlags|=STARTF_USESTDHANDLES startupinfo.hStdInput=p2cread startupinfo.hStdOutput=c2pwrite startupinfo.hStdError=errwrite if shell: startupinfo.dwFlags|=STARTF_USESHOWWINDOW startupinfo.wShowWindow=SW_HIDE comspec=os.environ.get("COMSPEC","cmd.exe") args=comspec+" /c "+args if(GetVersion()>=0x80000000L or os.path.basename(comspec).lower()=="command.com"): w9xpopen=self._find_w9xpopen() args='"%s" %s'%(w9xpopen,args) creationflags|=CREATE_NEW_CONSOLE try: hp,ht,pid,tid=CreateProcess(executable,args,None,None,1,creationflags,env,cwd,startupinfo) except pywintypes.error,e: raise WindowsError(*e.args) self._child_created=True self._handle=hp self.pid=pid ht.Close() if p2cread is not None: p2cread.Close() if c2pwrite is not None: c2pwrite.Close() if errwrite is not None: errwrite.Close() def poll(self,_deadstate=None): if self.returncode is None: if WaitForSingleObject(self._handle,0)==WAIT_OBJECT_0: self.returncode=GetExitCodeProcess(self._handle) return self.returncode def wait(self): if self.returncode is None: obj=WaitForSingleObject(self._handle,INFINITE) self.returncode=GetExitCodeProcess(self._handle) return self.returncode def _readerthread(self,fh,buffer): buffer.append(fh.read()) def _communicate(self,input): stdout=None stderr=None if self.stdout: stdout=[] stdout_thread=threading.Thread(target=self._readerthread,args=(self.stdout,stdout)) stdout_thread.setDaemon(True) stdout_thread.start() if self.stderr: stderr=[] stderr_thread=threading.Thread(target=self._readerthread,args=(self.stderr,stderr)) stderr_thread.setDaemon(True) stderr_thread.start() if self.stdin: if input is not None: self.stdin.write(input) self.stdin.close() if self.stdout: stdout_thread.join() if self.stderr: stderr_thread.join() if stdout is not None: stdout=stdout[0] if stderr is not None: stderr=stderr[0] if self.universal_newlines and hasattr(file,'newlines'): if stdout: stdout=self._translate_newlines(stdout) if stderr: stderr=self._translate_newlines(stderr) self.wait() return(stdout,stderr) else: def _get_handles(self,stdin,stdout,stderr): p2cread,p2cwrite=None,None c2pread,c2pwrite=None,None errread,errwrite=None,None if stdin is None: pass elif stdin==PIPE: p2cread,p2cwrite=os.pipe() elif isinstance(stdin,int): p2cread=stdin else: p2cread=stdin.fileno() if stdout is None: pass elif stdout==PIPE: c2pread,c2pwrite=os.pipe() elif isinstance(stdout,int): c2pwrite=stdout else: c2pwrite=stdout.fileno() if stderr is None: pass elif stderr==PIPE: errread,errwrite=os.pipe() elif stderr==STDOUT: errwrite=c2pwrite elif isinstance(stderr,int): errwrite=stderr else: errwrite=stderr.fileno() return(p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite) def _set_cloexec_flag(self,fd): try: cloexec_flag=fcntl.FD_CLOEXEC except AttributeError: cloexec_flag=1 old=fcntl.fcntl(fd,fcntl.F_GETFD) fcntl.fcntl(fd,fcntl.F_SETFD,old|cloexec_flag) def _close_fds(self,but): for i in xrange(3,MAXFD): if i==but: continue try: os.close(i) except: pass def _execute_child(self,args,executable,preexec_fn,close_fds,cwd,env,universal_newlines,startupinfo,creationflags,shell,p2cread,p2cwrite,c2pread,c2pwrite,errread,errwrite): if isinstance(args,types.StringTypes): args=[args] else: args=list(args) if shell: args=["/bin/sh","-c"]+args if executable is None: executable=args[0] errpipe_read,errpipe_write=os.pipe() self._set_cloexec_flag(errpipe_write) gc_was_enabled=gc.isenabled() gc.disable() try: self.pid=os.fork() except: if gc_was_enabled: gc.enable() raise self._child_created=True if self.pid==0: try: if p2cwrite: os.close(p2cwrite) if c2pread: os.close(c2pread) if errread: os.close(errread) os.close(errpipe_read) if p2cread: os.dup2(p2cread,0) if c2pwrite: os.dup2(c2pwrite,1) if errwrite: os.dup2(errwrite,2) if p2cread and p2cread not in(0,): os.close(p2cread) if c2pwrite and c2pwrite not in(p2cread,1): os.close(c2pwrite) if errwrite and errwrite not in(p2cread,c2pwrite,2): os.close(errwrite) if close_fds: self._close_fds(but=errpipe_write) if cwd is not None: os.chdir(cwd) if preexec_fn: apply(preexec_fn) if env is None: os.execvp(executable,args) else: os.execvpe(executable,args,env) except: exc_type,exc_value,tb=sys.exc_info() exc_lines=traceback.format_exception(exc_type,exc_value,tb) exc_value.child_traceback=''.join(exc_lines) os.write(errpipe_write,pickle.dumps(exc_value)) os._exit(255) if gc_was_enabled: gc.enable() os.close(errpipe_write) if p2cread and p2cwrite: os.close(p2cread) if c2pwrite and c2pread: os.close(c2pwrite) if errwrite and errread: os.close(errwrite) data=os.read(errpipe_read,1048576) os.close(errpipe_read) if data!="": os.waitpid(self.pid,0) child_exception=pickle.loads(data) raise child_exception def _handle_exitstatus(self,sts): if os.WIFSIGNALED(sts): self.returncode=-os.WTERMSIG(sts) elif os.WIFEXITED(sts): self.returncode=os.WEXITSTATUS(sts) else: raise RuntimeError("Unknown child exit status!") def poll(self,_deadstate=None): if self.returncode is None: try: pid,sts=os.waitpid(self.pid,os.WNOHANG) if pid==self.pid: self._handle_exitstatus(sts) except os.error: if _deadstate is not None: self.returncode=_deadstate return self.returncode def wait(self): if self.returncode is None: pid,sts=os.waitpid(self.pid,0) self._handle_exitstatus(sts) return self.returncode def _communicate(self,input): read_set=[] write_set=[] stdout=None stderr=None if self.stdin: self.stdin.flush() if input: write_set.append(self.stdin) else: self.stdin.close() if self.stdout: read_set.append(self.stdout) stdout=[] if self.stderr: read_set.append(self.stderr) stderr=[] input_offset=0 while read_set or write_set: rlist,wlist,xlist=select.select(read_set,write_set,[]) if self.stdin in wlist: bytes_written=os.write(self.stdin.fileno(),buffer(input,input_offset,512)) input_offset+=bytes_written if input_offset>=len(input): self.stdin.close() write_set.remove(self.stdin) if self.stdout in rlist: data=os.read(self.stdout.fileno(),1024) if data=="": self.stdout.close() read_set.remove(self.stdout) stdout.append(data) if self.stderr in rlist: data=os.read(self.stderr.fileno(),1024) if data=="": self.stderr.close() read_set.remove(self.stderr) stderr.append(data) if stdout is not None: stdout=''.join(stdout) if stderr is not None: stderr=''.join(stderr) if self.universal_newlines and hasattr(file,'newlines'): if stdout: stdout=self._translate_newlines(stdout) if stderr: stderr=self._translate_newlines(stderr) self.wait() return(stdout,stderr) hotssh-0.2.6+dfsg1/wafadmin/Environment.py0000644000175000017500000000650311075216573017152 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,copy,re import Logs,Options from Constants import* re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M) class Environment(object): __slots__=("table","parent") def __init__(self,filename=None): self.table={} if Options.commands['configure']: self.table['PREFIX']=os.path.abspath(os.path.expanduser(Options.options.prefix)) if filename: self.load(filename) def __contains__(self,key): if key in self.table:return True try:return self.parent.__contains__(key) except AttributeError:return False def __str__(self): keys=set() cur=self while cur: keys.update(cur.table.keys()) cur=getattr(cur,'parent',None) keys=list(keys) keys.sort() return"\n".join(["%r %r"%(x,self.__getitem__(x))for x in keys]) def set_variant(self,name): self.table[VARIANT]=name def variant(self): env=self while 1: try: return env.table[VARIANT] except KeyError: try:env=env.parent except AttributeError:return DEFAULT def copy(self): newenv=Environment() if Options.commands['configure']: if self['PREFIX']:del newenv.table['PREFIX'] newenv.parent=self return newenv def __getitem__(self,key): x=self.table.get(key,None) if not x is None:return x try: u=self.parent except AttributeError: return[] else: return u[key] def __setitem__(self,key,value): self.table[key]=value def get_flat(self,key): s=self[key] if not s:return'' elif isinstance(s,list):return' '.join(s) else:return s def _get_list_value_for_modification(self,key): try: value=self.table[key] except KeyError: try:value=self.parent[key] except AttributeError:value=[] if isinstance(value,list): value=copy.copy(value) else: value=[value] self.table[key]=value return value else: if not isinstance(value,list): value=[value] self.table[key]=value return value def append_value(self,var,value): current_value=self._get_list_value_for_modification(var) if isinstance(value,list): current_value.extend(value) else: current_value.append(value) def prepend_value(self,var,value): current_value=self._get_list_value_for_modification(var) if isinstance(value,list): current_value=value+current_value self.table[var]=current_value else: current_value.insert(0,value) def append_unique(self,var,value): current_value=self._get_list_value_for_modification(var) if isinstance(value,list): for value_item in value: if value_item not in current_value: current_value.append(value_item) else: if value not in current_value: current_value.append(value) def store(self,filename): file=open(filename,'w') table_list=[] env=self while 1: table_list.insert(0,env.table) try:env=env.parent except AttributeError:break merged_table={} for table in table_list: merged_table.update(table) keys=merged_table.keys() keys.sort() for k in keys:file.write('%s = %r\n'%(k,merged_table[k])) file.close() def load(self,filename): tbl=self.table file=open(filename,'r') code=file.read() file.close() for m in re_imp.finditer(code): g=m.group tbl[g(2)]=eval(g(3)) Logs.debug('env: %s'%str(self.table)) def get_destdir(self): if self.__getitem__('NOINSTALL'):return'' return Options.options.destdir hotssh-0.2.6+dfsg1/wafadmin/Node.pyc0000644000175000017500000003733711777064501015710 0ustar javijavi <4Ic@sddlZddlZddlZddlZddlZdZdZdZdZide6de6de6d e6Z d e fd YZ ej d krd Z e e _edZee _nde fdYZdS(iNiiiitunktdirtsrctbldtNodecBsaeZd'ZedZdZdZdZdZd Z d Z d Z d(d Z d(d Zd(dZdZdZdZdZdZdZdZdZd(dZdZdZdZd(dZdZdZdZdZ d(d Z!d(d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'RS()tnametparenttidtchildscCs||_||_|jjjd7_|jjj||_|tkrUi|_ntj |d|krtj d|n|r||jkrtj d|t |fn|r||j|((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Node.pytensure_dir_node_from_pathws    cCstj|}|d}t|dkrd}y|j|d }Wntk r[nX|s|j|d }d|jjj |j ((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Node.pytfind_dir_win32%s(    6 cCs*|j|}|jjj|j|jd}|r;|S|s|}g}x#|rr|j|j|j }qPW|j t j j |}nBt j j |jjjj|j|j|jjjf}|jdr|d}n|jdr |d}n||jjj||j<|S(Ns\i(RWR RRaR!RR"RFRRRGR/R0RHRVRRMRXt startswith(RRYRWRLtcurR4R_((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Node.pyt abspath_win32=s&"   B  tNoducBseZRS((RsRt(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Node.pyR}Ps(R/tsysR*R tBuildRvR RR'RtobjectRtplatformRyR,R"R|RR}(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Node.pyts$"    hotssh-0.2.6+dfsg1/wafadmin/Build.py0000644000175000017500000003735111115036226015700 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,sys,cPickle,types,imp,errno,re,glob,gc,time,shutil import Runner,TaskGen,Node,Scripting,Utils,Environment,Task,Logs,Options from Logs import debug,error,info from Constants import* SAVED_ATTRS='root srcnode bldnode node_sigs node_deps raw_deps task_sigs id_nodes'.split() g_modcache={} bld=None class BuildError(Utils.WafError): def __init__(self,b=None,t=[]): self.bld=b self.tasks=t self.ret=1 Utils.WafError.__init__(self,self.format_error()) def format_error(self): lst=['Build failed'] for tsk in self.tasks: txt=tsk.format_error() if txt:lst.append(txt) return'\n'.join(lst) class BuildContext(object): def __init__(self): global bld bld=self self.task_manager=Task.TaskManager() self.id_nodes=0 self.all_envs={} self.bdir='' self.path=None self.cache_node_abspath={} self.cache_scanned_folders={} self.uninstall=[] for v in'cache_node_abspath task_sigs node_deps raw_deps node_sigs'.split(): var={} setattr(self,v,var) self.cache_dir_contents={} self.all_task_gen=[] self.task_gen_cache_names={} self.cache_sig_vars={} self.log=None self.root=None self.srcnode=None self.bldnode=None class node_class(Node.Node): pass self.node_class=node_class self.node_class.__module__="Node" self.node_class.__name__="Nodu" self.node_class.bld=self def load(self): try: env=Environment.Environment(os.path.join(self.cachedir,'build.config.py')) except(IOError,OSError): pass else: if env['version']1:raise if data: for x in SAVED_ATTRS:setattr(self,x,data[x]) else: debug('build: Build cache loading failed') finally: if f:f.close() gc.enable() def save(self): gc.disable() self.root.__class__.bld=None Node.Nodu=self.node_class file=open(os.path.join(self.bdir,DBFILE),'wb') data={} for x in SAVED_ATTRS:data[x]=getattr(self,x) cPickle.dump(data,file,-1) file.close() self.root.__class__.bld=self gc.enable() def clean(self): debug('build: clean called') def clean_rec(node): for x in node.childs.keys(): nd=node.childs[x] tp=nd.id&3 if tp==Node.DIR: clean_rec(nd) elif tp==Node.BUILD: for env in self.all_envs.values(): pt=nd.abspath(env) if pt in env['waf_config_files']:continue try:os.remove(pt) except OSError:pass node.childs.__delitem__(x) node=self.srcnode clean_rec(node) if node==self.srcnode: for v in'node_sigs node_deps task_sigs raw_deps cache_node_abspath'.split(): var={} setattr(self,v,var) def compile(self): debug('build: compile called') os.chdir(self.bdir) self.flush() self.generator=Runner.Parallel(self,Options.options.jobs) def dw(on=True): if Options.options.progress_bar: if on:sys.stdout.write(Logs.colors.cursor_on) else:sys.stdout.write(Logs.colors.cursor_off) debug('build: executor starting') try: dw(on=False) self.generator.start() except KeyboardInterrupt: dw() os.chdir(self.srcnode.abspath()) self.save() Utils.pprint('RED','Build interrupted') if Logs.verbose>1:raise else:sys.exit(68) except Exception: dw() raise else: dw() self.save() if self.generator.error: os.chdir(self.srcnode.abspath()) raise BuildError(self,self.task_manager.tasks_done) os.chdir(self.srcnode.abspath()) def install(self): debug('build: install called') self.flush() if Options.commands['uninstall']: lst=[] for x in self.uninstall: dir=os.path.dirname(x) if not dir in lst:lst.append(dir) lst.sort() lst.reverse() nlst=[] for y in lst: x=y while len(x)>4: if not x in nlst:nlst.append(x) x=os.path.dirname(x) nlst.sort() nlst.reverse() for x in nlst: try:os.rmdir(x) except OSError:pass def add_subdirs(self,dirs): for dir in Utils.to_list(dirs): if dir:Scripting.add_subdir(dir,self) def new_task_gen(self,*k,**kw): kw['bld']=self if len(k)==0:return TaskGen.task_gen(*k,**kw) cls_name=k[0] try:cls=TaskGen.task_gen.classes[cls_name] except KeyError:raise Utils.WscriptError('%s is not a valid task generator -> %s'%(cls_name,[x for x in TaskGen.task_gen.classes])) else:return cls(*k,**kw) def load_envs(self): try: lst=Utils.listdir(self.cachedir) except OSError,e: if e.errno==errno.ENOENT: raise Utils.WafError('The project was not configured: run "waf configure" first!') else: raise if not lst: raise Utils.WafError('The cache directory is empty: reconfigure the project') for file in lst: if file.endswith(CACHE_SUFFIX): env=Environment.Environment(os.path.join(self.cachedir,file)) name=file.split('.')[0] self.all_envs[name]=env self.init_variants() for env in self.all_envs.values(): for f in env['dep_files']: newnode=self.srcnode.find_or_declare(f) try: hash=Utils.h_file(newnode.abspath(env)) except(IOError,AttributeError): error("cannot find "+f) hash=SIG_NIL self.node_sigs[env.variant()][newnode.id]=hash self.bldnode=self.root.find_dir(self.bldnode.abspath()) self.path=self.srcnode=self.root.find_dir(self.srcnode.abspath()) def setup(self,tool,tooldir=None,funs=None): if type(tool)is types.ListType: for i in tool:self.setup(i,tooldir) return if not tooldir:tooldir=Options.tooldir file=None key=str((tool,tooldir)) module=g_modcache.get(key,None) if not module: file,name,desc=imp.find_module(tool,tooldir) module=imp.load_module(tool,file,name,desc) g_modcache[key]=module if hasattr(module,"setup"):module.setup(self) if file:file.close() def init_variants(self): debug('build: init variants') lstvariants=[] for env in self.all_envs.values(): if not env.variant()in lstvariants: lstvariants.append(env.variant()) self.lst_variants=lstvariants debug('build: list of variants is %s'%str(lstvariants)) for name in lstvariants+[0]: for v in'node_sigs cache_node_abspath'.split(): var=getattr(self,v) if not name in var: var[name]={} def load_dirs(self,srcdir,blddir,load_cache=1): assert(os.path.isabs(srcdir)) assert(os.path.isabs(blddir)) self.cachedir=os.path.join(blddir,CACHE_DIR) if srcdir==blddir: raise Utils.WafError("build dir must be different from srcdir: %s <-> %s "%(srcdir,blddir)) self.bdir=blddir self.load() if not self.root: Node.Nodu=self.node_class self.root=Node.Nodu('',None,Node.DIR) if not self.srcnode: self.srcnode=self.root.ensure_dir_node_from_path(srcdir) debug('build: srcnode is %s and srcdir %s'%(str(self.srcnode.name),srcdir)) self.path=self.srcnode try:os.makedirs(blddir) except OSError:pass if not self.bldnode: self.bldnode=self.root.ensure_dir_node_from_path(blddir) self.init_variants() def rescan(self,src_dir_node): if self.cache_scanned_folders.get(src_dir_node.id,None):return self.cache_scanned_folders[src_dir_node.id]=1 if hasattr(self,'repository'):self.repository(src_dir_node) if sys.platform=="win32"and not src_dir_node.name: return self.listdir_src(src_dir_node,src_dir_node.abspath()) h1=self.srcnode.height() h2=src_dir_node.height() lst=[] child=src_dir_node while h2>h1: lst.append(child.name) child=child.parent h2-=1 lst.reverse() for variant in self.lst_variants: sub_path=os.path.join(self.bldnode.abspath(),variant,*lst) try: self.listdir_bld(src_dir_node,sub_path,variant) except OSError: dict=self.node_sigs[variant] for node in src_dir_node.childs.values(): if node.id in dict: dict.__delitem__(node.id) if node.id!=self.bldnode.id: src_dir_node.childs.__delitem__(node.name) os.makedirs(sub_path) def listdir_src(self,parent_node,path): listed_files=set(Utils.listdir(path)) self.cache_dir_contents[parent_node.id]=listed_files debug('build: folder contents '+str(listed_files)) node_names=set([x.name for x in parent_node.childs.values()if x.id&3==Node.FILE]) cache=self.node_sigs[0] to_keep=listed_files&node_names for x in to_keep: node=parent_node.childs[x] try: cache[node.id]=Utils.h_file(path+os.sep+node.name) except IOError: raise Utils.WafError("The file %s is not readable or has become a dir"%node.abspath()) to_remove=node_names-listed_files if to_remove: cache=self.node_sigs[0] for name in to_remove: nd=parent_node.childs[name] if nd.id in cache: cache.__delitem__(nd.id) parent_node.childs.__delitem__(name) def listdir_bld(self,parent_node,path,variant): i_existing_nodes=[x for x in parent_node.childs.values()if x.id&3==Node.BUILD] listed_files=set(Utils.listdir(path)) node_names=set([x.name for x in i_existing_nodes]) remove_names=node_names-listed_files ids_to_remove=[x.id for x in i_existing_nodes if x.name in remove_names] cache=self.node_sigs[variant] for nid in ids_to_remove: if nid in cache: cache.__delitem__(nid) def get_env(self): return self.env_of_name('default') def set_env(self,name,val): self.all_envs[name]=val env=property(get_env,set_env) def add_manual_dependency(self,path,value): h=getattr(self,'deps_man',{}) if isinstance(path,Node.Node): node=path elif os.path.isabs(path): node=self.root.find_resource(path) else: node=self.path.find_resource(path) try:h[node.id].append(value) except KeyError:h[node.id]=[value] self.deps_man=h def launch_node(self): try: return self.p_ln except AttributeError: self.p_ln=self.root.find_dir(Options.launch_dir) return self.p_ln def glob(self,pattern,relative=True): path=self.path.abspath() files=[self.root.find_resource(x)for x in glob.glob(path+os.sep+pattern)] if relative: files=[x.path_to_parent(self.path)for x in files if x] else: files=[x.abspath()for x in files if x] return files def add_group(self): self.flush(all=0) self.task_manager.add_group() def hash_env_vars(self,env,vars_lst): idx=str(id(env))+str(vars_lst) try:return self.cache_sig_vars[idx] except KeyError:pass lst=[env.get_flat(a)for a in vars_lst] ret=Utils.h_list(lst) debug("envhash: %s %s"%(ret.encode('hex'),str(lst))) self.cache_sig_vars[idx]=ret return ret def name_to_obj(self,name,env): cache=self.task_gen_cache_names if not cache: for x in self.all_task_gen: vt=x.env.variant()+'_' if x.name: cache[vt+x.name]=x else: v=vt+x.target if not cache.get(v,None): cache[v]=x return cache.get(env.variant()+'_'+name,None) def flush(self,all=1): self.ini=time.time() self.task_gen_cache_names={} self.name_to_obj('',self.env) debug('build: delayed operation TaskGen.flush() called') if Options.options.compile_targets: debug('task_gen: posting objects listed in compile_targets') target_objects={} for target_name in Options.options.compile_targets.split(','): target_name=target_name.strip() for env in self.all_envs.values(): obj=self.name_to_obj(target_name,env) if obj: try: target_objects[target_name].append(obj) except KeyError: target_objects[target_name]=[obj] if not target_name in target_objects and all: raise Utils.WafError("target '%s' does not exist"%target_name) for target_obj in target_objects.values(): for x in target_obj: x.post() else: debug('task_gen: posting objects (normal)') ln=self.launch_node() if ln.is_child_of(self.bldnode)or not ln.is_child_of(self.srcnode): ln=self.srcnode for obj in self.all_task_gen: if not obj.path.is_child_of(ln):continue obj.post() def env_of_name(self,name): if not name: error('env_of_name called with no name!') return None try: return self.all_envs[name] except KeyError: error('no such environment: '+name) return None def progress_line(self,state,total,col1,col2): n=len(str(total)) Utils.rot_idx+=1 ind=Utils.rot_chr[Utils.rot_idx%4] ini=self.ini pc=(100.*state)/total eta=time.strftime('%H:%M:%S',time.gmtime(time.time()-ini)) fs="[%%%dd/%%%dd][%%s%%2d%%%%%%s][%s]["%(n,n,ind) left=fs%(state,total,col1,pc,col2) right='][%s%s%s]'%(col1,eta,col2) cols=Utils.get_term_cols()-len(left)-len(right)+2*len(col1)+2*len(col2) if cols<7:cols=7 ratio=int((cols*state)/total)-1 bar=('='*ratio+'>').ljust(cols) msg=Utils.indicator%(left,bar,right) return msg def do_install(self,src,tgt,chmod=0644): if Options.commands['install']: if not Options.options.force: try: t1=os.stat(tgt).st_mtime t2=os.stat(src).st_mtime except OSError: pass else: if t1>=t2: return False srclbl=src.replace(self.srcnode.abspath(None)+os.sep,'') info("* installing %s as %s"%(srclbl,tgt)) try:os.remove(tgt) except OSError:pass try: shutil.copy2(src,tgt) os.chmod(tgt,chmod) except IOError: try: os.stat(src) except(OSError,IOError): error('File %r does not exist'%src) raise Utils.WafError('Could not install the file %r'%tgt) return True elif Options.commands['uninstall']: info("* uninstalling %s"%tgt) self.uninstall.append(tgt) try:os.remove(tgt) except OSError:pass return True def get_install_path(self,path,env=None): if not env:env=self.env destdir=env.get_destdir() destpath=Utils.subst_vars(path,env) if destdir: destpath=os.path.join(destdir,destpath.lstrip(os.sep)) return destpath def install_files(self,path,files,env=None,chmod=0644,relative_trick=False): if not Options.is_install:return[] if not path:return[] node=self.path if type(files)is types.StringType and'*'in files: gl=node.abspath()+os.sep+files lst=glob.glob(gl) else: lst=Utils.to_list(files) env=env or self.env destpath=self.get_install_path(path,env) Utils.check_dir(destpath) installed_files=[] for filename in lst: if not os.path.isabs(filename): nd=node.find_resource(filename) if not nd: raise Utils.WafError("Unable to install the file `%s': not found in %s"%(filename,node)) if relative_trick: destfile=os.path.join(destpath,filename) Utils.check_dir(os.path.dirname(destfile)) else: destfile=os.path.join(destpath,nd.name) filename=nd.abspath(env) else: alst=Utils.split_path(filename) destfile=os.path.join(destpath,alst[-1]) if self.do_install(filename,destfile,chmod): installed_files.append(destfile) return installed_files def install_as(self,path,srcfile,env=None,chmod=0644): if not Options.is_install:return False if not path:return False if not env:env=self.env node=self.path destpath=self.get_install_path(path,env) dir,name=os.path.split(destpath) Utils.check_dir(dir) if not os.path.isabs(srcfile): filenode=node.find_resource(srcfile) src=filenode.abspath(env) else: src=srcfile return self.do_install(src,destpath,chmod) def symlink_as(self,path,src,env=None): if not Options.is_install:return if not path:return tgt=self.get_install_path(path,env) dir,name=os.path.split(tgt) Utils.check_dir(dir) if Options.commands['install']: try: if not os.path.islink(tgt)or os.readlink(tgt)!=src: info("* symlink %s (-> %s)"%(tgt,src)) os.symlink(src,tgt) return 0 except OSError: return 1 elif Options.commands['uninstall']: try: info("* removing %s"%(tgt)) os.remove(tgt) return 0 except OSError: return 1 def exec_command(self,cmd,shell=1): debug('runner: system command -> %s'%cmd) if self.log:self.log.write('%s\n'%cmd) return Utils.exec_command(cmd,shell=shell,log=self.log) def printout(self,s): f=self.log or sys.stdout f.write(s) f.flush() hotssh-0.2.6+dfsg1/wafadmin/__init__.py0000644000175000017500000000005311075216572016376 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 hotssh-0.2.6+dfsg1/wafadmin/pproc.pyc0000644000175000017500000004322711777064501016141 0ustar javijavi {Hc@sddlZejdkZddlZddlZddlZddlZdefdYZerddl Z ddl Z ddl TdddYZ ddd YZ n0ddlZddlZddlZddlZd d d d ddgZyejdZWn dZnXyeWnek rDdZdZnXgZdZdZdZdZdZdZd efdYZ dS(iNtwin32tCalledProcessErrorcBseZdZdZRS(cCs||_||_dS(N(t returncodetcmd(tselfRR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt__init__ s cCsd|j|jfS(Ns-Command '%s' returned non-zero exit status %d(RR(R((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt__str__s(t__name__t __module__RR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR s (t*t STARTUPINFOcBs&eZdZdZdZdZdZRS(iN(RRtdwFlagstNonet hStdInputt hStdOutputt hStdErrort wShowWindow(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR s t pywintypescBseZeZRS((RRtIOErrorterror(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR#stPopentPIPEtSTDOUTtcallt check_callt SC_OPEN_MAXiiicCsYxRtD]I}|jdtjdkrytj|WqQtk rMqQXqqWdS(Nt _deadstatei(t_activetpolltsystmaxinttremovet ValueError(tinst((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt_cleanup5s  icOst||jS(N(Rtwait(t popenargstkwargs((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR>scOsSt||}|jd}|dkr7|d}n|rOt||n|S(Ntargsi(RtgetR R(R$R%tretcodeR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR@s  cCsLg}t}x0|D](}g}|r5|jdnd|kpVd|kpV|dk}|ro|jdnx|D]}|dkr|j|qv|dkr|jdt|dg}|jdqv|r|j|g}n|j|qvW|r|j|n|r|j||jdqqWdj|S(Nt s tt"s\is\"(tFalsetappendtlentextendtjoin(tseqtresultt needquotetargtbs_buftc((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt list2cmdlineHs4 $      cBseZddddddeeddeddd ZdZedZddZe rdZ dZ dZ dZ dd Zd Zd Zd ZnKd Z dZdZdZ dZddZdZdZRS(icCsvtt|_t|ttfs4tdntrm|dk rUt dn|rt dqn6| dk rt dn|dkrt dnd|_ d|_ d|_ d|_ d|_| |_|j|||\}}}}}}|j||||| | | | || ||||||tr|dkrn|dk rntj|d}n|dkr|dk rtj|d}n|dkr|dk rtj|d}qn|rtj|d||_ n|r0| rtj|d||_ q0tj|d ||_ n|rr| rWtj|d||_ qrtj|d ||_ ndS( Nsbufsize must be an integers0preexec_fn is not supported on Windows platformss/close_fds is not supported on Windows platformss2startupinfo is only supported on Windows platformsis4creationflags is only supported on Windows platformstwbtrUtrb(R"R,t_child_createdt isinstancetinttlongt TypeErrort mswindowsR R tstdintstdouttstderrtpidRtuniversal_newlinest _get_handlest_execute_childtostclosetfdopen(RR&tbufsizet executableRARBRCt preexec_fnt close_fdstshelltcwdtenvREt startupinfot creationflagstp2creadtp2cwritetc2preadtc2pwriteterrreadterrwrite((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyResR          ':      cCs(|jdd}|jdd}|S(Ns s s (treplace(Rtdata((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt_translate_newlinesscCsO|js dS|jd|j|jdkrKtdk rKtj|ndS(NR(R;RRRR RR-(RR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt__del__s  cCs|j|j|jgjddkrd}d}|jre|rU|jj|n|jjn6|jr|jj}n|jr|jj}n|j||fS|j |S(Ni( RARBRCtcountR twriteRItreadR#t _communicate(RtinputRBRC((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt communicates'     c Cs|dkr(|dkr(|dkr(dSd\}}d\}}d\}} |dkrgtt}n|dk rvn|dks|tkrtdd\}}|j}tj|d}n6t|t rtj |}ntj |j }|j |}|dkr$tt }n|dk r3n|dksK|tkrtdd\}}|j}tj|d}n6t|t rtj |}ntj |j }|j |}|dkrtt} n| dk rn|dks|tkr>tdd\}} |j}tj|d}nK|tkrS|} n6t|t rttj |} ntj |j } |j | } |||||| fS(Ni(NNNNNN(NN(NN(NN(R t GetStdHandletSTD_INPUT_HANDLERt CreatePipetDetachtmsvcrttopen_osfhandleR<R=t get_osfhandletfilenot_make_inheritabletSTD_OUTPUT_HANDLEtSTD_ERROR_HANDLER( RRARBRCRTRURVRWRXRY((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRFsX$              cCstt|tddtS(Nii(tDuplicateHandletGetCurrentProcesstDUPLICATE_SAME_ACCESS(Rthandle((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRlscCstjjtjjtdd}tjj|stjjtjjtjd}tjj|stdqn|S(Nis w9xpopen.exesZCannot locate w9xpopen.exe, which is needed for Popen to work with your shell or platform.( RHtpathR0tdirnametGetModuleFileNametexistsRt exec_prefixt RuntimeError(Rtw9xpopen((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt_find_w9xpopens '$c Cst|tjs!t|}n|dkr9t}nd| ||fkr{|jtO_| |_||_ ||_ n| r|jt O_t |_ tjjdd}|d|}tdkstjj|jdkr|j}d||f}| tO} qny4t||ddd| ||| \}}}}Wn%tjk rp}t|jnXt|_||_||_|j | dk r| j n|dk r|j n|dk r|j ndS(NtCOMSPECscmd.exes /c ls command.coms"%s" %si(!R<ttypest StringTypesR7R R R tSTARTF_USESTDHANDLESR RRtSTARTF_USESHOWWINDOWtSW_HIDERRHtenvironR't GetVersionRstbasenametlowerRztCREATE_NEW_CONSOLEt CreateProcessRRt WindowsErrorR&tTrueR;t_handleRDtClose(RR&RLRMRNRPRQRERRRSRORTRURVRWRXRYtcomspecRythpthtRDttidte((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRGs@      - 4         cCsF|jdkr?t|jdtkr?t|j|_q?n|jS(Ni(RR tWaitForSingleObjectRt WAIT_OBJECT_0tGetExitCodeProcess(RR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRscCs=|jdkr6t|jt}t|j|_n|jS(N(RR RRtINFINITER(Rtobj((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR# scCs|j|jdS(N(R-R`(Rtfhtbuffer((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt _readerthreadscCsd}d}|jrYg}tjd|jd|j|f}|jt|jn|jrg}tjd|jd|j|f}|jt|jn|j r|dk r|j j |n|j j n|jr|j n|jr |j n|dk r#|d}n|dk r<|d}n|j rttdr|rl|j|}n|r|j|}qn|j||fS(NttargetR&itnewlines(R RBt threadingtThreadRt setDaemonRtstartRCRAR_RIR0REthasattrtfileR\R#(RRbRBRCt stdout_threadt stderr_thread((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRas> $   $             c CsKd\}}d\}}d\}} |dkr3nE|tkrTtj\}}n$t|trl|}n |j}|dkrnE|tkrtj\}}n$t|tr|}n |j}|dkrnZ|tkrtj\}} n9|tkr|} n$t|tr)|} n |j} |||||| fS(N(NN(NN(NN(R RRHtpipeR<R=RkR( RRARBRCRTRURVRWRXRY((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRF3s6                 cCsZy tj}Wntk r&d}nXtj|tj}tj|tj||BdS(Ni(tfcntlt FD_CLOEXECtAttributeErrortF_GETFDtF_SETFD(Rtfdt cloexec_flagtold((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt_set_cloexec_flagRs    cCsKxDtdtD]3}||kr(qnytj|WqqXqWdS(Ni(txrangetMAXFDRHRI(Rtbutti((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt _close_fdsYs c Cst|tjr|g}n t|}| rCddg|}n|dkr\|d}ntj\}}|j|tj }tj ytj |_ Wn|rtj nnXt|_|j dkry| rtj| n| r tj| n|r!tj|ntj|| rGtj| dn|r`tj|dn|rytj|dn| r| d krtj| n|r|| dfkrtj|n|r|| |dfkrtj|n|r|jd|n|dk r#tj|n|r6t|n|dkrUtj||ntj|||Wn\tj\}}}tj|||}dj||_tj|tj|nXtj dn|rtj ntj|| r| rtj| n|r0| r0tj|n|rL|rLtj|ntj!|d }tj||dkrtj"|j dtj#|}|ndS( Ns/bin/shs-ciiiRR*ii(i($R<R|R}tlistR RHRRtgct isenabledtdisabletforkRDtenableRR;RItdup2RtchdirtapplytexecvptexecvpeRtexc_infot tracebacktformat_exceptionR0tchild_tracebackR_tpickletdumpst_exitR`twaitpidtloads(RR&RLRMRNRPRQRERRRSRORTRURVRWRXRYt errpipe_readt errpipe_writetgc_was_enabledtexc_typet exc_valuettbt exc_linesR[tchild_exception((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRGas                    cCsYtj|r%tj| |_n0tj|rItj||_n tddS(NsUnknown child exit status!(RHt WIFSIGNALEDtWTERMSIGRt WIFEXITEDt WEXITSTATUSRx(Rtsts((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyt_handle_exitstatuss cCs|jdkryAtj|jtj\}}||jkrO|j|nWqtjk r~|dk r||_qqXn|jS(N(RR RHRRDtWNOHANGRR(RRRDR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRs cCsA|jdkr:tj|jd\}}|j|n|jS(Ni(RR RHRRDR(RRDR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyR#sc Csg}g}d}d}|jrW|jj|rG|j|jqW|jjn|jry|j|jg}n|jr|j|jg}nd}xo|s|rtj||g\}}} |j|krCtj |jj t ||d} || 7}|t |krC|jj|j |jqCn|j|krtj|jj d} | dkr|jj|j |jn|j| n|j|krtj|jj d} | dkr|jj|j |jn|j| qqW|dk r1dj|}n|dk rOdj|}n|jrttdr|r|j|}n|r|j|}qn|j||fS(NiiiR*R(R RAtflushR-RIRBRCtselectRHR_RkRR.RR`R0RERRR\R#( RRbtread_sett write_setRBRCt input_offsettrlisttwlisttxlistt bytes_writtenR[((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRas^      '         N(RRR R,RR\RR]RcR@RFRlRzRGRR#RRaRRR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pyRds*0-    0   !    !    H  (((!RtplatformR@RHR|RRt ExceptionRRRht _subprocessR RRterrnoRRt__all__tsysconfRR,t NameErrorRRR"RRRRR7tobjectR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/pproc.pytsD                  hotssh-0.2.6+dfsg1/wafadmin/Utils.py0000644000175000017500000001702111115036226015731 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,sys,imp,types,string,errno,traceback,inspect,re from UserDict import UserDict import Logs,pproc from Constants import* is_win32=sys.platform=='win32' class WafError(Exception): def __init__(self,*args): self.args=args self.stack=traceback.extract_stack() Exception.__init__(self,*args) def __str__(self): return str(len(self.args)==1 and self.args[0]or self.args) class WscriptError(WafError): def __init__(self,message,wscript_file=None): if wscript_file: self.wscript_file=wscript_file self.wscript_line=None else: (self.wscript_file,self.wscript_line)=self.locate_error() msg_file_line='' if self.wscript_file: msg_file_line="%s:"%self.wscript_file if self.wscript_line: msg_file_line+="%s:"%self.wscript_line err_message="%s error: %s"%(msg_file_line,message) WafError.__init__(self,err_message) def locate_error(self): stack=traceback.extract_stack() stack.reverse() for frame in stack: file_name=os.path.basename(frame[0]) is_wscript=(file_name==WSCRIPT_FILE or file_name==WSCRIPT_BUILD_FILE) if is_wscript: return(frame[0],frame[1]) return(None,None) indicator=is_win32 and'\x1b[A\x1b[K%s%s%s\r'or'\x1b[K%s%s%s\r' try: from fnv import new as md5 import Constants Constants.SIG_NIL='signofnv' def h_file(filename): m=md5() try: m.hfile(filename) x=m.digest() if x is None:raise OSError,"not a file" return x except SystemError: raise OSError,"not a file"+filename except ImportError: try: from hashlib import md5 except ImportError: from md5 import md5 def h_file(filename): f=file(filename,'rb') m=md5() readBytes=100000 while(readBytes): readString=f.read(readBytes) m.update(readString) readBytes=len(readString) f.close() return m.digest() class ordered_dict(UserDict): def __init__(self,dict=None): self.allkeys=[] UserDict.__init__(self,dict) def __delitem__(self,key): self.allkeys.remove(key) UserDict.__delitem__(self,key) def __setitem__(self,key,item): if key not in self.allkeys:self.allkeys.append(key) UserDict.__setitem__(self,key,item) def exec_command(s,shell=1,log=None): proc=pproc.Popen(s,shell=shell,stdout=log,stderr=log) return proc.wait() if is_win32: old_log=exec_command def exec_command(s,shell=1,log=None): if len(s)<2000:return old_log(s,shell=shell,log=log) startupinfo=pproc.STARTUPINFO() startupinfo.dwFlags|=pproc.STARTF_USESHOWWINDOW proc=pproc.Popen(s,shell=False,startupinfo=startupinfo) return proc.wait() listdir=os.listdir if is_win32: def listdir_win32(s): if re.match('^[A-Z]:$',s): s+=os.sep if not os.path.isdir(s): e=OSError() e.errno=errno.ENOENT raise e return os.listdir(s) listdir=listdir_win32 def waf_version(mini=0x010000,maxi=0x100000): ver=HEXVERSION try:min_val=mini+0 except TypeError:min_val=int(mini.replace('.','0'),16) if min_val>ver: Logs.error("waf version should be at least %s (%s found)"%(mini,ver)) sys.exit(0) try:max_val=maxi+0 except TypeError:max_val=int(maxi.replace('.','0'),16) if max_val= 2.3 but the raw source requires Python 2.4" def ex_stack(): exc_type,exc_value,tb=sys.exc_info() exc_lines=traceback.format_exception(exc_type,exc_value,tb) return''.join(exc_lines) def to_list(sth): if type(sth)is types.ListType: return sth else: return sth.split() g_loaded_modules={} g_module=None def load_module(file_path,name=WSCRIPT_FILE): try: return g_loaded_modules[file_path] except KeyError: pass module=imp.new_module(name) try: file=open(file_path,'r') except(IOError,OSError): raise WscriptError('The file %s could not be opened!'%file_path) module_dir=os.path.dirname(file_path) sys.path.insert(0,module_dir) exec file in module.__dict__ sys.path.remove(module_dir) if file:file.close() g_loaded_modules[file_path]=module return module def set_main_module(file_path): global g_module g_module=load_module(file_path,'wscript_main') def to_hashtable(s): tbl={} lst=s.split('\n') for line in lst: if not line:continue mems=line.split('=') tbl[mems[0]]=mems[1] return tbl def get_term_cols(): return 80 try: import struct,fcntl,termios except ImportError: pass else: if sys.stdout.isatty(): def myfun(): dummy_lines,cols=struct.unpack("HHHH",fcntl.ioctl(sys.stdout.fileno(),termios.TIOCGWINSZ,struct.pack("HHHH",0,0,0,0)))[:2] return cols try: myfun() except IOError: pass else: get_term_cols=myfun rot_idx=0 rot_chr=['\\','|','/','-'] def split_path(path): if not path:return[''] return path.split('/') if is_win32: def split_path(path): h,t=os.path.splitunc(path) if not h:return __split_dirs(t) return[h]+__split_dirs(t)[1:] def __split_dirs(path): h,t=os.path.split(path) if not h:return[t] if h==path:return[h.replace('\\','')] if not t:return __split_dirs(h) else:return __split_dirs(h)+[t] def copy_attrs(orig,dest,names,only_if_set=False): for a in to_list(names): u=getattr(orig,a,()) if u or not only_if_set: setattr(dest,a,u) def def_attrs(self,**kw): for k,v in kw.iteritems(): if not hasattr(self,k): setattr(self,k,v) quote_define_name_table=None def quote_define_name(path): global quote_define_name_table if not quote_define_name_table: invalid_chars=set([chr(x)for x in xrange(256)])-set(string.digits+string.uppercase) quote_define_name_table=string.maketrans(''.join(invalid_chars),'_'*len(invalid_chars)) return string.translate(string.upper(path),quote_define_name_table) def quote_whitespace(path): return(path.strip().find(' ')>0 and'"%s"'%path or path).replace('""','"') def trimquotes(s): if not s:return'' s=s.rstrip() if s[0]=="'"and s[-1]=="'":return s[1:-1] return s def h_list(lst): m=md5() m.update(str(lst)) return m.digest() def h_fun(fun): try: return fun.code except AttributeError: try: h=inspect.getsource(fun) except IOError: h="nocode" try: fun.code=h except AttributeError: pass return h _hash_blacklist_types=(types.BuiltinFunctionType,types.ModuleType,types.FunctionType,types.ClassType,types.TypeType,types.NoneType,) def hash_function_with_globals(prevhash,func): assert type(func)is types.FunctionType for name,value in func.func_globals.iteritems(): if type(value)in _hash_blacklist_types: continue if isinstance(value,type): continue try: prevhash=hash((prevhash,name,value)) except TypeError: pass return hash((prevhash,inspect.getsource(func))) def pprint(col,str,label=''): print"%s%s%s %s"%(Logs.colors(col),str,Logs.colors.NORMAL,label) def check_dir(dir): try: os.stat(dir) except OSError: try: os.makedirs(dir) except OSError,e: raise WafError("Cannot create folder '%s' (original error: %s)"%(dir,e)) def cmd_output(cmd,e=None,silent=False): p=pproc.Popen(cmd,stdout=pproc.PIPE,shell=True,env=e) output=p.communicate()[0] if p.returncode: if not silent: msg="command execution failed: %s -> %r"%(cmd,str(output)) raise ValueError,msg output='' return output reg_subst=re.compile(r"(\\\\)|(\\\$)|\$\{([^}]+)\}") def subst_vars(expr,params): def repl_var(m): if m.group(1): return'\\' if m.group(2): return'$' return params[m.group(3)] return reg_subst.sub(repl_var,expr) def detect_platform(): s=sys.platform for x in'cygwin linux irix sunos hpux aix darwin'.split(): if s.find(x)>=0: return x if os.name in'posix java os2'.split(): return os.name return s hotssh-0.2.6+dfsg1/wafadmin/Tools/0000755000175000017500000000000011777064501015371 5ustar javijavihotssh-0.2.6+dfsg1/wafadmin/Tools/kde4.py0000644000175000017500000000424611115036226016565 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,re import Options,TaskGen,Task,Utils from TaskGen import taskgen,feature,after class msgfmt_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def init_msgfmt(self): Utils.def_attrs(self,default_install_path='${KDE4_LOCALE_INSTALL_DIR}',appname='set_your_app_name') def apply_msgfmt(self): for lang in self.to_list(self.langs): node=self.path.find_resource(lang+'.po') task=self.create_task('msgfmt') task.set_inputs(node) task.set_outputs(node.change_ext('.mo')) if not Options.is_install:continue langname=lang.split('/') langname=langname[-1] tsk.install_path=self.install_path+os.sep+langname+os.sep+'LC_MESSAGES' task.filename=self.appname+'.mo' task.chmod=self.chmod def detect(conf): kdeconfig=conf.find_program('kde4-config') if not kdeconfig: conf.fatal('we need kde4-config') prefix=Utils.cmd_output('%s --prefix'%kdeconfig,silent=True).strip() file='%s/share/apps/cmake/modules/KDELibsDependencies.cmake'%prefix try:os.stat(file) except OSError: file='%s/share/kde4/apps/cmake/modules/KDELibsDependencies.cmake'%prefix try:os.stat(file) except OSError:conf.fatal('could not open %s'%file) try: f=open(file,'r') txt=f.read() f.close() except(OSError,IOError): conf.fatal('could not read %s'%file) txt=txt.replace('\\\n','\n') fu=re.compile('#(.*)\n') txt=fu.sub('',txt) setregexp=re.compile('([sS][eE][tT]\s*\()\s*([^\s]+)\s+\"([^"]+)\"\)') found=setregexp.findall(txt) for(_,key,val)in found: conf.env[key]=val conf.env['LIB_KDECORE']='kdecore' conf.env['LIB_KDEUI']='kdeui' conf.env['LIB_KIO']='kio' conf.env['LIB_KHTML']='khtml' conf.env['LIB_KPARTS']='kparts' conf.env['LIBPATH_KDECORE']=conf.env['KDE4_LIB_INSTALL_DIR'] conf.env['CPPPATH_KDECORE']=conf.env['KDE4_INCLUDE_INSTALL_DIR'] conf.env.append_value('CPPPATH_KDECORE',conf.env['KDE4_INCLUDE_INSTALL_DIR']+"/KDE") conf.env['MSGFMT']=conf.find_program('msgfmt') Task.simple_task_type('msgfmt','${MSGFMT} ${SRC} -o ${TGT}',color='BLUE') taskgen(init_msgfmt) feature('msgfmt')(init_msgfmt) taskgen(apply_msgfmt) feature('msgfmt')(apply_msgfmt) after('init_msgfmt')(apply_msgfmt) hotssh-0.2.6+dfsg1/wafadmin/Tools/dmd.py0000644000175000017500000000224211075216572016505 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys import ar def find_dmd(conf): v=conf.env d_compiler=None if v['D_COMPILER']: d_compiler=v['D_COMPILER'] if not d_compiler:d_compiler=conf.find_program('dmd',var='D_COMPILER') if not d_compiler:return 0 v['D_COMPILER']=d_compiler def common_flags(conf): v=conf.env v['DFLAGS']={'gdc':[],'dmd':['-version=Posix']} v['D_SRC_F']='' v['D_TGT_F']='-c -of' v['DPATH_ST']='-I%s' v['D_LINKER']=v['D_COMPILER'] v['DLNK_SRC_F']='' v['DLNK_TGT_F']='-of' v['DLIB_ST']='-L-l%s' v['DLIBPATH_ST']='-L-L%s' v['DFLAGS_OPTIMIZED']=['-O'] v['DFLAGS_DEBUG']=['-g','-debug'] v['DFLAGS_ULTRADEBUG']=['-g','-debug'] v['DLINKFLAGS']=['-quiet'] v['D_shlib_DFLAGS']=['-fPIC'] v['D_shlib_LINKFLAGS']=['-L-shared'] v['DHEADER_ext']='.di' v['D_HDR_F']='-H -Hf' if sys.platform=="win32": v['D_program_PATTERN']='%s.exe' v['D_shlib_PATTERN']='lib%s.dll' v['D_staticlib_PATTERN']='lib%s.a' else: v['D_program_PATTERN']='%s' v['D_shlib_PATTERN']='lib%s.so' v['D_staticlib_PATTERN']='lib%s.a' def detect(conf): v=conf.env find_dmd(conf) ar.find_ar(conf) conf.check_tool('d') common_flags(conf) def set_options(opt): pass hotssh-0.2.6+dfsg1/wafadmin/Tools/java.py0000644000175000017500000001011111115036226016643 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,re from Configure import conf import TaskGen,Task,Utils from TaskGen import feature,taskgen class java_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_java(self): Utils.def_attrs(self,jarname='',jaropts='',classpath='',source_root='.',jar_mf_attributes={},jar_mf_classpath=[]) nodes_lst=[] if not self.classpath: if not self.env['CLASSPATH']: self.env['CLASSPATH']='..'+os.pathsep+'.' else: self.env['CLASSPATH']=self.classpath re_foo=re.compile(self.source) source_root_node=self.path.find_dir(self.source_root) src_nodes=[] bld_nodes=[] prefix_path=source_root_node.abspath() for(root,dirs,filenames)in os.walk(source_root_node.abspath()): for x in filenames: file=root+'/'+x file=file.replace(prefix_path,'') if file.startswith('/'): file=file[1:] if re_foo.search(file)>-1: node=source_root_node.find_resource(file) src_nodes.append(node) node2=node.change_ext(".class") bld_nodes.append(node2) self.env['OUTDIR']=source_root_node.abspath(self.env) tsk=self.create_task('javac') tsk.set_inputs(src_nodes) tsk.set_outputs(bld_nodes) if self.jarname: tsk=self.create_task('jar_create') tsk.set_inputs(bld_nodes) tsk.set_outputs(self.path.find_or_declare(self.jarname)) if not self.env['JAROPTS']: if self.jaropts: self.env['JAROPTS']=self.jaropts else: dirs='.' self.env['JAROPTS']='-C %s %s'%(self.env['OUTDIR'],dirs) Task.simple_task_type('jar_create','${JAR} ${JARCREATE} ${TGT} ${JAROPTS}',color='GREEN') cls=Task.simple_task_type('javac','${JAVAC} -classpath ${CLASSPATH} -d ${OUTDIR} ${SRC}',before='jar_create') cls.color='BLUE' def post_run_javac(self): par={} for x in self.inputs: par[x.parent.id]=x.parent inner={} for k in par.values(): path=k.abspath(self.env) lst=os.listdir(path) for u in lst: if u.find('$')>=0: inner_class_node=k.find_or_declare(u) inner[inner_class_node.id]=inner_class_node to_add=set(inner.keys())-set([x.id for x in self.outputs]) for x in to_add: self.outputs.append(inner[x]) return Task.Task.post_run(self) cls.post_run=post_run_javac def detect(conf): java_path=os.environ['PATH'].split(os.pathsep) v=conf.env if os.environ.has_key('JAVA_HOME'): java_path=[os.path.join(os.environ['JAVA_HOME'],'bin')]+java_path conf.env['JAVA_HOME']=os.environ['JAVA_HOME'] conf.find_program('javac',var='JAVAC',path_list=java_path) conf.find_program('java',var='JAVA',path_list=java_path) conf.find_program('jar',var='JAR',path_list=java_path) v['JAVA_EXT']=['.java'] if os.environ.has_key('CLASSPATH'): v['CLASSPATH']=os.environ['CLASSPATH'] if not v['JAR']:conf.fatal('jar is required for making java packages') if not v['JAVAC']:conf.fatal('javac is required for compiling java classes') v['JARCREATE']='cf' def check_java_class(self,classname,with_classpath=None): class_check_source=""" public class Test { public static void main(String[] argv) { Class lib; if (argv.length < 1) { System.err.println("Missing argument"); System.exit(77); } try { lib = Class.forName(argv[0]); } catch (ClassNotFoundException e) { System.err.println("ClassNotFoundException"); System.exit(1); } lib = null; System.exit(0); } } """ import shutil javatestdir='.waf-javatest' classpath=javatestdir if self.env['CLASSPATH']: classpath+=os.pathsep+self.env['CLASSPATH'] if isinstance(with_classpath,str): classpath+=os.pathsep+with_classpath shutil.rmtree(javatestdir,True) os.mkdir(javatestdir) java_file=open(os.path.join(javatestdir,'Test.java'),'w') java_file.write(class_check_source) java_file.close() os.popen(self.env['JAVAC']+' '+os.path.join(javatestdir,'Test.java')) cmd=self.env['JAVA']+' -cp '+classpath+' Test '+classname self.log.write("%s\n"%cmd) found=Utils.exec_command(cmd,shell=True,log=self.log) self.check_message('Java class %s'%classname,"",not found) shutil.rmtree(javatestdir,True) return found taskgen(apply_java) feature('java')(apply_java) conf(check_java_class) hotssh-0.2.6+dfsg1/wafadmin/Tools/vala.py0000644000175000017500000001453211115036226016660 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os.path,shutil import Task,Runner,Utils,Logs,Build,Node from TaskGen import extension EXT_VALA=['.vala','.gs'] class valac_task(Task.Task): vars=("VALAC","VALAC_VERSION","VALAFLAGS") before=("cc","cxx") def run(self): env=self.env inputs=[a.srcpath(env)for a in self.inputs] valac=env['VALAC'] vala_flags=env.get_flat('VALAFLAGS') top_src=self.generator.bld.srcnode.abspath() top_bld=self.generator.bld.srcnode.abspath(env) if env['VALAC_VERSION']>(0,1,6): cmd=[valac,'-C','--quiet',vala_flags] else: cmd=[valac,'-C',vala_flags] if self.threading: cmd.append('--thread') if self.target_glib: cmd.append('--target-glib=%s'%self.target_glib) features=self.generator.features if'cshlib'in features or'cstaticlib'in features: cmd.append('--library '+self.target) cmd.append('--basedir '+top_src) cmd.append('-d '+top_bld) else: output_dir=self.outputs[0].bld_dir(env) cmd.append('-d %s'%output_dir) for vapi_dir in self.vapi_dirs: cmd.append('--vapidir=%s'%vapi_dir) for package in self.packages: cmd.append('--pkg %s'%package) for package in self.packages_private: cmd.append('--pkg %s'%package) cmd.append(" ".join(inputs)) result=self.generator.bld.exec_command(" ".join(cmd)) if'cshlib'in features or'cstaticlib'in features: if self.packages: filename=os.path.join(self.generator.path.abspath(env),"%s.deps"%self.target) deps=open(filename,'w') for package in self.packages: deps.write(package+'\n') deps.close() self._fix_output("../%s.vapi"%self.target) self._fix_output("%s.vapi"%self.target) self._fix_output("%s.gidl"%self.target) self._fix_output("%s.gir"%self.target) return result def install(self): bld=self.generator.bld features=self.generator.features if self.attr("install_path")and("cshlib"in features or"cstaticlib"in features): headers_list=[o for o in self.outputs if o.suffix()==".h"] vapi_list=[o for o in self.outputs if(o.suffix()in(".vapi",".deps"))] for header in headers_list: top_src=self.generator.bld.srcnode package=self.env['PACKAGE'] try: api_version=Utils.g_module.API_VERSION except AttributeError: version=Utils.g_module.VERSION.split(".") if version[0]=="0": api_version="0."+version[1] else: api_version=version[0]+".0" install_path="${INCLUDEDIR}/%s-%s/%s"%(package,api_version,header.relpath_gen(top_src)) bld.install_as(install_path,header.abspath(self.env),self.env) for vapi in vapi_list: bld.install_files("${DATAROOTDIR}/vala/vapi",vapi.abspath(self.env),self.env) def _fix_output(self,output): top_bld=self.generator.bld.srcnode.abspath(self.env) try: src=os.path.join(top_bld,output) dst=self.generator.path.abspath(self.env) shutil.move(src,dst) except: pass def vala_file(self,node): valatask=getattr(self,"valatask",None) if not valatask: valatask=self.create_task('valac') self.valatask=valatask valatask.packages=[] valatask.packages_private=Utils.to_list(getattr(self,'packages_private',[])) valatask.vapi_dirs=[] valatask.target=self.target valatask.threading=False valatask.install_path=self.install_path valatask.target_glib=None packages=Utils.to_list(getattr(self,'packages',[])) vapi_dirs=Utils.to_list(getattr(self,'vapi_dirs',[])) if hasattr(self,'uselib_local'): local_packages=Utils.to_list(self.uselib_local) seen=[] while len(local_packages)>0: package=local_packages.pop() if package in seen: continue seen.append(package) package_obj=self.name_to_obj(package) if not package_obj: raise Utils.WafError("object '%s' was not found in uselib_local (required by '%s')"%(package,self.name)) package_name=package_obj.target package_node=package_obj.path package_dir=package_node.relpath_gen(self.path) for task in package_obj.tasks: for output in task.outputs: if output.name==package_name+".vapi": valatask.set_run_after(task) if package_name not in packages: packages.append(package_name) if package_dir not in vapi_dirs: vapi_dirs.append(package_dir) if hasattr(package_obj,'uselib_local'): lst=self.to_list(package_obj.uselib_local) lst.reverse() local_packages=[pkg for pkg in lst if pkg not in seen]+local_packages valatask.packages=packages for vapi_dir in vapi_dirs: try: valatask.vapi_dirs.append(self.path.find_dir(vapi_dir).abspath()) valatask.vapi_dirs.append(self.path.find_dir(vapi_dir).abspath(self.env)) except AttributeError: Params.warning("Unable to locate Vala API directory: '%s'"%vapi_dir) if hasattr(self,'threading'): valatask.threading=self.threading self.uselib=self.to_list(self.uselib) if not'GTHREAD'in self.uselib: self.uselib.append('GTHREAD') if hasattr(self,'target_glib'): valatask.target_glib=self.target_glib env=valatask.env output_nodes=[] c_node=node.change_ext('.c') output_nodes.append(c_node) self.allnodes.append(c_node) output_nodes.append(node.change_ext('.h')) if not'cprogram'in self.features: output_nodes.append(self.path.find_or_declare('%s.vapi'%self.target)) if env['VALAC_VERSION']>(0,3,5): output_nodes.append(self.path.find_or_declare('%s.gir'%self.target)) elif env['VALAC_VERSION']>(0,1,7): output_nodes.append(self.path.find_or_declare('%s.gidl'%self.target)) if valatask.packages: output_nodes.append(self.path.find_or_declare('%s.deps'%self.target)) valatask.inputs.append(node) valatask.outputs.extend(output_nodes) def detect(conf): min_version=(0,1,6) min_version_str="%d.%d.%d"%min_version valac=conf.find_program('valac',var='VALAC') if not valac: conf.fatal("valac not found") return if not conf.env["HAVE_GTHREAD"]: conf.check_cfg(package='gthread-2.0',uselib_store='GTHREAD',args='--cflags --libs') try: output=Utils.cmd_output(valac+" --version",silent=True) version=output.split(' ',1)[-1].strip().split(".") version=[int(x)for x in version] valac_version=tuple(version) except Exception: valac_version=(0,0,0) conf.check_message('program version','valac >= '+min_version_str,valac_version>=min_version,"%d.%d.%d"%valac_version) conf.check_tool('gnu_dirs') if valac_versiontlinguastfiletlangstlinet re_linguastlangR&R(((R sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/intltool.pyR)$s&$  7  (R*R+RR)(((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/intltool.pyR,s Rs${POCOM} -o ${TGT} ${SRC}tcolortBLUERsI${INTLTOOL} ${INTLFLAGS} -q -u -c ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}tafterscc_link cxx_linkcCs|jd}|s%|jdn||jd<|jd}|sW|jdn||jdsH   hotssh-0.2.6+dfsg1/wafadmin/Tools/perl.py0000644000175000017500000000571511105644247016711 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os import pproc import Task,Options,Utils from Configure import conf from TaskGen import extension,taskgen,feature,before xsubpp_str='${PERL} ${XSUBPP} -noprototypes -typemap ${EXTUTILS_TYPEMAP} ${SRC} > ${TGT}' EXT_XS=['.xs'] def init_pyext(self): self.uselib=self.to_list(getattr(self,'uselib','')) if not'PERL'in self.uselib:self.uselib.append('PERL') if not'PERLEXT'in self.uselib:self.uselib.append('PERLEXT') self.env['shlib_PATTERN']=self.env['perlext_PATTERN'] def xsubpp_file(self,node): gentask=self.create_task('xsubpp') gentask.set_inputs(node) outnode=node.change_ext('.c') gentask.set_outputs(outnode) self.allnodes.append(outnode) Task.simple_task_type('xsubpp',xsubpp_str,color='BLUE',before="cc cxx") def check_perl_version(conf,minver=None): res=True if not getattr(Options.options,'perlbinary',None): perl=conf.find_program("perl",var="PERL") if not perl: return False else: perl=Options.options.perlbinary conf.env['PERL']=perl version=Utils.cmd_output(perl+" -e'printf \"%vd\", $^V'") if not version: res=False version="Unknown" elif not minver is None: ver=tuple(map(int,version.split("."))) if ver=satleast-versions==s exact-versions<=s max-versioncCstj|}x|r|jd}|d }|d}|dksS|dkr|sk|jd}n|jd||q|dkr|s|jd}n|jd|||jd||q|d kr |s|jd}n|jd ||q|d krG|s0|jd}n|jd ||q|d ksb|jdr|jd|||jd|||jd||q|jdr|jd|||jd||qqWdS(Niis-Is/ItCPPPATH_s-Dt CXXDEFINES_t CCDEFINES_s-ltLIB_s-LtLIBPATH_s-pthreadt+tCCFLAGS_t CXXFLAGS_t LINKFLAGS_s-std(tshlextsplittpopt append_uniquet startswith(tlinetuselibtenvtlsttxtsttot((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt parse_flags s:      cCs8d|krd|d= %st modversiont-t_tpackages%s requires a packagesChecking for %s %s %ssChecking for %s flagstokmsgtokterrmsgs not found(tcfg_vertkeystreplacet ValueError(tselftkwRty((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt validate_cfg%s,        &    cCs>tjd||jr1|jjd|ntj|S(Ns runner: %s s%s (tLogstdebugtlogtwritetUtilst cmd_output(R)tcmd((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt cmd_and_log<s c Cs+d|kry)d|d|df}|j|Wn1d|krTd|d (R1tto_listRA(tdctR((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt to_headers $tframework_nameRZt function_nameRsChecking for function %ss0int main(){ void *p; p=(void*)(%s); return 0; } tcodeR5t define_namesChecking for header %ss%s/%s.ht remove_dot_hisChecking for framework %st frameworks'list of headers in header_name is emptytlibsChecking for library %st staticlibsChecking for static library %stfragmentsChecking for custom codeR$tfailtcxxflagstcflagst linkflagstlinkersChecking for %s flags %ss not foundR"R#tsuccess(Rhscompiler(scflagsscompiler(RjRk(RtcopytTasktTaskBasetclassesR=RKtAssertionErrorRBt have_defineR1R[tlent simple_c_codetFalse( R)R*RR]tfutfwknametfwktlt flagsnamet flagstype((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt validate_cs    "  /                                     c sfd}dkr(|n;dkr>|n%dkrcdkrc|qcndrddk }nddk}|rd krd dl}d dl}xt|jj|jD]}|j}|d krd }n|d krd}n|dkr'd}n|kr|}t|t j krj|j t j j}njj|dd |qqWndS(Ncsed}d rIjdd rIjdddk njdddS(NRaRYt define_retRl(R=RKt define_condR;(tnm(R*R)(sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pytdefine_or_stuffs !RZR_RfRaRYRliR5itCPPPATHtincludest CXXDEFINEStdefinest CCDEFINESR (RKRTRVtsettg_cc_flag_varstuniontg_cxx_flag_varstlowerRWttypest StringTypetrstriptosRtsepRt append_value( R)RPR*Rt is_successRTRVtlkRE((R)R*sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt post_checks4        "      cOs|j||j|dd}y|j||}Wnetjk r}|j|ddd|kr|drtjdkrq|j dqnX|j|d||d<|j |||S( NRR$RHRIis)the configuration failed (see config.log)R"Rl( R|RJRKt run_c_codeRLRMRNR-ROR:R(R)RPR*RFRQ((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pytchecks  cOs|ddkrd}d}n d}d}tjj|jd}ytj|Wntk rgnXtj|tjj|d}tjj|stj|n|d}t tjj||d }|j |d |j tjj d } t j} |j| _| jj|j|| jd <| jj| _| j||tj|| j| j| j||d } || _d| _x*|jD]\}} t| || qW|jj d|d y| jWntj} nXd} tj| | r8|j t!| n|dr^| j"j#dj |}n|drytj$d|j%}Wn&t&k r}|j tjnX|} n| S(NRSRVstest.cppRTstest.cs.wscript-trybuildt testbuildRtwR`t.tdefaultRWttestprogs ==> %s <== iRYs"%s"('RRRAtblddirtshutiltrmtreetOSErrortmakedirstexiststopenR0tclosetabspathtBuildt BuildContextR/tall_envstupdateR&t lst_variantst load_dirstchdirtrescantsrcnodet new_task_gentsourcettargetR?tsetattrtcompileR1tex_stackR:tstrt link_tasktoutputsR2R>R((R)RPR*ttpt test_f_nametdirtbdirRtdesttbacktbldtotvRFtlastprogtdataRQ((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyRsd               cOsd|d<|j||S(NRVRS(R(R)RPR*((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyt check_cxx6s cOsd|d<|j||S(NRTRS(R(R)RPR*((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pytcheck_cc9s icCs|rt|tst|jtp1tj}t|trs|dkrfdt||| %r must be a string or an int( t isinstanceRRqRtDEFINESR1t ordered_dicttintt TypeError(R)R;tvaluetquotettbl((sv/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/config_c.pyR;<s    cCsb|rt|tst|jtp1tj}t}|||<||jt<||j|s\ TH     /  N   5                        hotssh-0.2.6+dfsg1/wafadmin/Tools/suncc.py0000644000175000017500000000234011115036226017042 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,optparse import Utils,Options,Configure import ccroot,ar from Configure import conftest def find_scc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in os.environ:cc=os.environ['CC'] if not cc:cc=conf.find_program('cc',var='CC') if not cc:conf.fatal('suncc was not found') try: if not Utils.cmd_output('%s -flags'%cc): conf.fatal('suncc %r was not found'%cc) except ValueError: conf.fatal('suncc -flags could not be executed') v['CC']=cc v['CC_NAME']='sun' def scc_common_flags(conf): v=conf.env v['CC_SRC_F']='' v['CC_TGT_F']='-c -o ' v['CPPPATH_ST']='-I%s' if not v['LINK_CC']:v['LINK_CC']=v['CC'] v['CCLNK_SRC_F']='' v['CCLNK_TGT_F']='-o ' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STATICLIB_ST']='-l%s' v['STATICLIBPATH_ST']='-L%s' v['CCDEFINES_ST']='-D%s' v['SHLIB_MARKER']='-Bdynamic' v['STATICLIB_MARKER']='-Bstatic' v['program_PATTERN']='%s' v['shlib_CCFLAGS']=['-Kpic','-DPIC'] v['shlib_LINKFLAGS']=['-G'] v['shlib_PATTERN']='lib%s.so' v['staticlib_LINKFLAGS']=['-Bstatic'] v['staticlib_PATTERN']='lib%s.a' detect=''' find_scc find_cpp find_ar scc_common_flags cc_load_tools cc_add_flags ''' conftest(find_scc) conftest(scc_common_flags) hotssh-0.2.6+dfsg1/wafadmin/Tools/d.py0000644000175000017500000002334711115036226016164 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,re,optparse import ccroot import TaskGen,Utils,Task,Configure,Logs,Build from Logs import debug,error from TaskGen import taskgen,feature,after,before,extension EXT_D=['.d','.di','.D'] D_METHS=['apply_core','apply_vnum','apply_objdeps'] def filter_comments(filename): f=open(filename,'r') txt=f.read() f.close() buf=[] i=0 max=len(txt) while i1: self.features.append('d'+k[1]) TaskGen.bind_feature('d',D_METHS) def init_d(self): Utils.def_attrs(self,dflags={'gdc':'','dmd':''},importpaths='',libs='',libpaths='',uselib='',uselib_local='',generate_headers=False,compiled_tasks=[],add_objects=[],link_task=None) def apply_d_libs(self): uselib=self.to_list(self.uselib) seen=[] local_libs=self.to_list(self.uselib_local) libs=[] libpaths=[] env=self.env while local_libs: x=local_libs.pop() if x in seen: continue else: seen.append(x) y=self.name_to_obj(x) if not y: raise Utils.WafError('object not found in uselib_local: obj %s uselib %s'%(self.name,x)) if y.uselib_local: added=0 lst=y.to_list(y.uselib_local) lst.reverse() for u in lst: if u in seen:continue added=1 local_libs=[u]+local_libs if added:continue y.post() seen.append(x) if'dshlib'in y.features or'dstaticlib'in y.features: libs.append(y.target) tmp_path=y.path.bldpath(env) if not tmp_path in libpaths:libpaths=[tmp_path]+libpaths if y.link_task is not None: self.link_task.set_run_after(y.link_task) dep_nodes=getattr(self.link_task,'dep_nodes',[]) self.link_task.dep_nodes=dep_nodes+y.link_task.outputs morelibs=y.to_list(y.uselib) for v in morelibs: if v in uselib:continue uselib=[v]+uselib self.uselib=uselib def apply_d_link(self): link=getattr(self,'link',None) if not link: if'dstaticlib'in self.features:link='ar_link_static' else:link='d_link' linktask=self.create_task(link) outputs=[t.outputs[0]for t in self.compiled_tasks] linktask.set_inputs(outputs) linktask.set_outputs(self.path.find_or_declare(get_target_name(self))) self.link_task=linktask def apply_d_vars(self): env=self.env dpath_st=env['DPATH_ST'] lib_st=env['DLIB_ST'] libpath_st=env['DLIBPATH_ST'] dflags={'gdc':[],'dmd':[]} importpaths=self.to_list(self.importpaths) libpaths=[] libs=[] uselib=self.to_list(self.uselib) for i in uselib: if env['DFLAGS_'+i]: for dflag in self.to_list(env['DFLAGS_'+i][env['COMPILER_D']]): if not dflag in dflags[env['COMPILER_D']]: dflags[env['COMPILER_D']]+=[dflag] dflags[env['COMPILER_D']]=self.to_list(self.dflags[env['COMPILER_D']])+dflags[env['COMPILER_D']] for dflag in dflags[env['COMPILER_D']]: if not dflag in env['DFLAGS'][env['COMPILER_D']]: env['DFLAGS'][env['COMPILER_D']]+=[dflag] for x in self.features: if not x in['dprogram','dstaticlib','dshlib']: continue x.lstrip('d') d_shlib_dflags=env['D_'+x+'_DFLAGS'] if d_shlib_dflags: for dflag in d_shlib_dflags: if not dflag in env['DFLAGS'][env['COMPILER_D']]: env['DFLAGS'][env['COMPILER_D']]+=[dflag] env['_DFLAGS']=env['DFLAGS'][env['COMPILER_D']] for i in uselib: if env['DPATH_'+i]: for entry in self.to_list(env['DPATH_'+i]): if not entry in importpaths: importpaths.append(entry) for path in importpaths: if os.path.isabs(path): env.append_unique('_DIMPORTFLAGS',dpath_st%path) else: node=self.path.find_dir(path) self.env.append_unique('INC_PATHS',node) env.append_unique('_DIMPORTFLAGS',dpath_st%node.srcpath(env)) env.append_unique('_DIMPORTFLAGS',dpath_st%node.bldpath(env)) for i in uselib: if env['LIBPATH_'+i]: for entry in self.to_list(env['LIBPATH_'+i]): if not entry in libpaths: libpaths+=[entry] libpaths=self.to_list(self.libpaths)+libpaths for path in libpaths: env.append_unique('_DLIBDIRFLAGS',libpath_st%path) for i in uselib: if env['LIB_'+i]: for entry in self.to_list(env['LIB_'+i]): if not entry in libs: libs+=[entry] libs=libs+self.to_list(self.libs) for lib in libs: env.append_unique('_DLIBFLAGS',lib_st%lib) for i in uselib: dlinkflags=env['DLINKFLAGS_'+i] if dlinkflags: for linkflag in dlinkflags: env.append_unique('DLINKFLAGS',linkflag) def add_shlib_d_flags(self): for linkflag in self.env['D_shlib_LINKFLAGS']: self.env.append_unique('DLINKFLAGS',linkflag) def d_hook(self,node): task=self.create_task(self.generate_headers and'd_with_header'or'd') try:obj_ext=self.obj_ext except AttributeError:obj_ext='_%d.o'%self.idx task.inputs=[node] task.outputs=[node.change_ext(obj_ext)] self.compiled_tasks.append(task) if self.generate_headers: header_node=node.change_ext(self.env['DHEADER_ext']) task.outputs+=[header_node] d_str='${D_COMPILER} ${_DFLAGS} ${_DIMPORTFLAGS} ${D_SRC_F}${SRC} ${D_TGT_F}${TGT}' d_with_header_str='${D_COMPILER} ${_DFLAGS} ${_DIMPORTFLAGS} \ ${D_HDR_F}${TGT[1].bldpath(env)} \ ${D_SRC_F}${SRC} \ ${D_TGT_F}${TGT[0].bldpath(env)}' link_str='${D_LINKER} ${DLNK_SRC_F}${SRC} ${DLNK_TGT_F}${TGT} ${DLINKFLAGS} ${_DLIBDIRFLAGS} ${_DLIBFLAGS}' cls=Task.simple_task_type('d',d_str,'GREEN') cls.scan=scan Task.simple_task_type('d_with_header',d_with_header_str,'GREEN') Task.simple_task_type('d_link',link_str,color='YELLOW',after=['d']) def generate_header(self,filename,install_path): if not hasattr(self,'header_lst'):self.header_lst=[] self.meths.append('process_header') self.header_lst.append([filename,install_path]) def process_header(self): env=self.env for i in getattr(self,'header_lst',[]): node=self.path.find_resource(i[0]) if not node: raise Utils.WafError('file not found on d obj '+i[0]) task=self.create_task('d_header') task.set_inputs(node) task.set_outputs(node.change_ext('.di')) d_header_str='${D_COMPILER} ${D_HEADER} ${SRC}' Task.simple_task_type('d_header',d_header_str,color='BLUE') feature('d')(init_d) before('apply_type_vars')(init_d) feature('d')(init_d) before('apply_d_libs')(init_d) feature('d')(apply_d_libs) after('apply_d_link')(apply_d_libs) before('apply_vnum')(apply_d_libs) feature('dprogram','dshlib','dstaticlib')(apply_d_link) after('apply_core')(apply_d_link) feature('d')(apply_d_vars) after('apply_core')(apply_d_vars) feature('dshlib')(add_shlib_d_flags) after('apply_d_vars')(add_shlib_d_flags) extension(EXT_D)(d_hook) taskgen(generate_header) taskgen(process_header) before('apply_core')(process_header) hotssh-0.2.6+dfsg1/wafadmin/Tools/dbus.py0000644000175000017500000000204311105644247016673 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import Task,Utils from TaskGen import taskgen,before,after,feature def add_dbus_file(self,filename,prefix,mode): if not hasattr(self,'dbus_lst'): self.dbus_lst=[] self.meths.append('process_dbus') self.dbus_lst.append([filename,prefix,mode]) def process_dbus(self): for filename,prefix,mode in getattr(self,'dbus_lst',[]): env=self.env.copy() node=self.path.find_resource(filename) if not node: raise Utils.WafError('file not found '+filename) env['DBUS_BINDING_TOOL_PREFIX']=prefix env['DBUS_BINDING_TOOL_MODE']=mode task=self.create_task('dbus_binding_tool',env) task.set_inputs(node) task.set_outputs(node.change_ext('.h')) Task.simple_task_type('dbus_binding_tool','${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}',color='BLUE',before='cc') def detect(conf): dbus_binding_tool=conf.find_program('dbus-binding-tool',var='DBUS_BINDING_TOOL') taskgen(add_dbus_file) taskgen(process_dbus) before('apply_core')(process_dbus) hotssh-0.2.6+dfsg1/wafadmin/Tools/misc.pyc0000644000175000017500000004233411777064501017047 0ustar javijavi <4Ic@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddlm Z m Z mZddlmZdZdZdejfdYZdZd ejfd YZd Zd Zd ejfdYZdZdefdYZdefdYZdefdYZdefdYZdefdYZ defdYZ!dejfdYZ"dejfdYZ#d Z$d!Z%d"Z&d#Z'ej(d$d%gd&ee#ejj)d'sJ<T       :  O       hotssh-0.2.6+dfsg1/wafadmin/Tools/cs.py0000644000175000017500000000263711075216572016356 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import TaskGen,Utils,Task from Logs import error from TaskGen import before,after,taskgen,feature flag_vars=['FLAGS','ASSEMBLIES'] def init_cs(self): Utils.def_attrs(self,flags='',assemblies='',resources='',uselib='') def apply_uselib_cs(self): if not self.uselib: return global flag_vars for var in self.to_list(self.uselib): for v in self.flag_vars: val=self.env[v+'_'+var] if val:self.env.append_value(v,val) def apply_cs(self): assemblies_flags=[] for i in self.to_list(self.assemblies)+self.env['ASSEMBLIES']: assemblies_flags+='/r:'+i self.env['_ASSEMBLIES']+=assemblies_flags for i in self.to_list(self.resources): self.env['_RESOURCES'].append('/resource:'+i) self.env['_FLAGS']+=self.to_list(self.flags)+self.env['FLAGS'] curnode=self.path nodes=[] for i in self.to_list(self.source): nodes.append(curnode.find_resource(i)) task=self.create_task('mcs') task.inputs=nodes task.set_outputs(self.path.find_or_declare(self.target)) Task.simple_task_type('mcs','${MCS} ${SRC} /out:${TGT} ${_FLAGS} ${_ASSEMBLIES} ${_RESOURCES}',color='YELLOW') def detect(conf): mcs=conf.find_program('mcs',var='MCS') if not mcs:mcs=conf.find_program('gmcs',var='MCS') taskgen(init_cs) feature('cs')(init_cs) taskgen(apply_uselib_cs) feature('cs')(apply_uselib_cs) after('init_cs')(apply_uselib_cs) taskgen(apply_cs) feature('cs')(apply_cs) after('apply_uselib_cs')(apply_cs) hotssh-0.2.6+dfsg1/wafadmin/Tools/flex.py0000644000175000017500000000063611075216572016704 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import TaskGen def decide_ext(self,node): if'cxx'in self.features:return'.lex.cc' else:return'.lex.c' TaskGen.declare_chain(name='flex',action='${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',ext_in='.l',decider=decide_ext,before='cc cxx',) def detect(conf): flex=conf.find_program('flex',var='FLEX') if not flex:conf.fatal("flex was not found") v=conf.env v['FLEXFLAGS']='' hotssh-0.2.6+dfsg1/wafadmin/Tools/gcc.py0000644000175000017500000000510211115036226016462 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys import Configure,Options,Utils import ccroot,ar from Configure import conftest def find_gcc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in os.environ:cc=os.environ['CC'] if not cc:cc=conf.find_program('gcc',var='CC') if not cc:cc=conf.find_program('cc',var='CC') if not cc:conf.fatal('gcc was not found') try: if Utils.cmd_output('%s --version'%cc).find('gcc')<0: conf.fatal('gcc was not found, see the result of gcc --version') except ValueError: conf.fatal('gcc --version could not be executed') v['CC']=cc v['CC_NAME']='gcc' ccroot.get_cc_version(conf,cc,'CC_VERSION') def gcc_common_flags(conf): v=conf.env v['CC_SRC_F']='' v['CC_TGT_F']='-c -o ' v['CPPPATH_ST']='-I%s' if not v['LINK_CC']:v['LINK_CC']=v['CC'] v['CCLNK_SRC_F']='' v['CCLNK_TGT_F']='-o ' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STATICLIB_ST']='-l%s' v['STATICLIBPATH_ST']='-L%s' v['RPATH_ST']='-Wl,-rpath,%s' v['CCDEFINES_ST']='-D%s' v['SHLIB_MARKER']='-Wl,-Bdynamic' v['STATICLIB_MARKER']='-Wl,-Bstatic' v['program_PATTERN']='%s' v['shlib_CCFLAGS']=['-fPIC','-DPIC'] v['shlib_LINKFLAGS']=['-shared'] v['shlib_PATTERN']='lib%s.so' v['staticlib_LINKFLAGS']=['-Wl,-Bstatic'] v['staticlib_PATTERN']='lib%s.a' v['MACBUNDLE_LINKFLAGS']=['-bundle','-undefined dynamic_lookup'] v['MACBUNDLE_CCFLAGS']=['-fPIC'] v['MACBUNDLE_PATTERN']='%s.bundle' def gcc_modifier_win32(conf): v=conf.env if sys.platform!='win32':return v['program_PATTERN']='%s.exe' v['shlib_PATTERN']='lib%s.dll' v['shlib_CCFLAGS']=[] v['staticlib_LINKFLAGS']=[] def gcc_modifier_cygwin(conf): v=conf.env if sys.platform!='cygwin':return v['program_PATTERN']='%s.exe' v['shlib_PATTERN']='lib%s.dll' v['shlib_CCFLAGS']=[] v['staticlib_LINKFLAGS']=[] def gcc_modifier_darwin(conf): v=conf.env if sys.platform!='darwin':return v['shlib_CCFLAGS']=['-fPIC','-compatibility_version 1','-current_version 1'] v['shlib_LINKFLAGS']=['-dynamiclib'] v['shlib_PATTERN']='lib%s.dylib' v['staticlib_LINKFLAGS']=[] v['SHLIB_MARKER']='' v['STATICLIB_MARKER']='' def gcc_modifier_aix5(conf): v=conf.env if sys.platform!='aix5':return v['program_LINKFLAGS']=['-Wl,-brtl'] v['shlib_LINKFLAGS']=['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER']='' detect=''' find_gcc find_cpp find_ar gcc_common_flags gcc_modifier_win32 gcc_modifier_cygwin gcc_modifier_darwin gcc_modifier_aix5 cc_load_tools cc_add_flags ''' conftest(find_gcc) conftest(gcc_common_flags) conftest(gcc_modifier_win32) conftest(gcc_modifier_cygwin) conftest(gcc_modifier_darwin) conftest(gcc_modifier_aix5) hotssh-0.2.6+dfsg1/wafadmin/Tools/gnome.py0000644000175000017500000002023311105644247017044 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,re import TaskGen,Utils,Runner,Task,Build,Options,Logs import cc from Logs import error from TaskGen import taskgen,before,after,feature n1_regexp=re.compile('(.*)',re.M) n2_regexp=re.compile('(.*)',re.M) def postinstall_schemas(prog_name): if Options.commands['install']: dir=Build.bld.get_install_path('${PREFIX}/etc/gconf/schemas/%s.schemas'%prog_name) if not Options.options.destdir: Utils.pprint('YELLOW','Installing GConf schema') command='gconftool-2 --install-schema-file=%s 1> /dev/null'%dir ret=Utils.exec_command(command) else: Utils.pprint('YELLOW','GConf schema not installed. After install, run this:') Utils.pprint('YELLOW','gconftool-2 --install-schema-file=%s'%dir) def postinstall_icons(): dir=Build.bld.get_install_path('${DATADIR}/icons/hicolor') if Options.commands['install']: if not Options.options.destdir: Utils.pprint('YELLOW',"Updating Gtk icon cache.") command='gtk-update-icon-cache -q -f -t %s'%dir ret=Utils.exec_command(command) else: Utils.pprint('YELLOW','Icon cache not updated. After install, run this:') Utils.pprint('YELLOW','gtk-update-icon-cache -q -f -t %s'%dir) def postinstall_scrollkeeper(prog_name): if Options.commands['install']: if os.path.iswriteable('/var/log/scrollkeeper.log'): dir1=Build.bld.get_install_path('${PREFIX}/var/scrollkeeper') dir2=Build.bld.get_install_path('${DATADIR}/omf/%s'%prog_name) command='scrollkeeper-update -q -p %s -o %s'%(dir1,dir2) ret=Utils.exec_command(command) def postinstall(prog_name='myapp',schemas=1,icons=1,scrollkeeper=1): if schemas:postinstall_schemas(prog_name) if icons:postinstall_icons() if scrollkeeper:postinstall_scrollkeeper(prog_name) class gnome_doc_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def init_gnome_doc(self): self.default_install_path='${PREFIX}/share' def apply_gnome_doc(self): self.env['APPNAME']=self.doc_module lst=self.to_list(self.doc_linguas) for x in lst: tsk=self.create_task('xml2po') node=self.path.find_resource(x+'/'+x+'.po') src=self.path.find_resource('C/%s.xml'%self.doc_module) out=self.path.find_or_declare('%s/%s.xml'%(x,self.doc_module)) tsk.set_inputs([node,src]) tsk.set_outputs(out) tsk2=self.create_task('xsltproc2po') out2=self.path.find_or_declare('%s/%s-%s.omf'%(x,self.doc_module,x)) tsk2.set_outputs(out2) node=self.path.find_resource(self.doc_module+".omf.in") tsk2.inputs=[node,out] tsk2.run_after.append(tsk) if Options.is_install: path=self.install_path+'gnome/help/%s/%s'%(self.doc_module,x) Build.bld.install_files(self.install_path+'omf',out2.abspath(self.env)) for y in self.to_list(self.doc_figures): try: os.stat(self.path.abspath()+'/'+x+'/'+y) Common.install_as(path+'/'+y,self.path.abspath()+'/'+x+'/'+y) except: Common.install_as(path+'/'+y,self.path.abspath()+'/C/'+y) Common.install_as(path+'/%s.xml'%self.doc_module,out.abspath(self.env)) class xml_to_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def init_xml_to(self): Utils.def_attrs(self,source='xmlfile',xslt='xlsltfile',target='hey',default_install_path='${PREFIX}',task_created=None) def apply_xml_to(self): tree=Build.bld xmlfile=self.path.find_resource(self.source) xsltfile=self.path.find_resource(self.xslt) tsk=self.create_task('xmlto') tsk.set_inputs([xmlfile,xsltfile]) tsk.set_outputs(xmlfile.change_ext('html')) tsk.install_path=self.install_path def sgml_scan(self): node=self.inputs[0] env=self.env variant=node.variant(env) fi=open(node.abspath(env),'r') content=fi.read() fi.close() name=n1_regexp.findall(content)[0] num=n2_regexp.findall(content)[0] doc_name=name+'.'+num return([],[doc_name]) def sig_implicit_deps(self): def sgml_outputs(): dps=Build.bld.raw_deps[self.unique_id()] name=dps[0] self.set_outputs(self.task_generator.path.find_or_declare(name)) tree=Build.bld key=self.unique_id() prev_sigs=tree.task_sigs.get(key,()) if prev_sigs and prev_sigs[2]==self.compute_sig_implicit_deps(): sgml_outputs() return prev_sigs[2] (nodes,names)=self.scan() if Logs.verbose and Logs.zones: debug('deps: scanner for %s returned %s %s'%(str(self),str(nodes),str(names))) tree=Build.bld tree.node_deps[self.unique_id()]=nodes tree.raw_deps[self.unique_id()]=names sgml_outputs() sig=self.compute_sig_implicit_deps() return sig class gnome_sgml2man_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_gnome_sgml2man(self): assert(getattr(self,'appname',None)) def install_result(task): out=task.outputs[0] name=out.name ext=name[-1] env=task.env Build.bld.install_files('DATADIR','man/man%s/'%ext,out.abspath(env),env) tree=Build.bld tree.rescan(self.path) for name in Build.bld.cache_dir_contents[self.path.id]: base,ext=os.path.splitext(name) if ext!='.sgml':continue task=self.create_task('sgml2man') task.set_inputs(self.path.find_resource(name)) task.task_generator=self if Options.is_install:task.install=install_result task.scan() cls=Task.simple_task_type('sgml2man','${SGML2MAN} -o ${TGT[0].bld_dir(env)} ${SRC} > /dev/null',color='BLUE') cls.scan=sgml_scan cls.sig_implicit_deps=sig_implicit_deps old_runnable_status=Task.Task.runnable_status def runnable_status(self): old_runnable_status(self) return old_runnable_status(self) cls.runnable_status=runnable_status cls.quiet=1 Task.simple_task_type('xmlto','${XMLTO} html -m ${SRC[1].abspath(env)} ${SRC[0].abspath(env)}') Task.simple_task_type('xml2po','${XML2PO} ${XML2POFLAGS} ${SRC} > ${TGT}',color='BLUE') xslt_magic="""${XSLTPROC2PO} -o ${TGT[0].abspath(env)} \ --stringparam db2omf.basename ${APPNAME} \ --stringparam db2omf.format docbook \ --stringparam db2omf.lang C \ --stringparam db2omf.dtd '-//OASIS//DTD DocBook XML V4.3//EN' \ --stringparam db2omf.omf_dir ${PREFIX}/share/omf \ --stringparam db2omf.help_dir ${PREFIX}/share/gnome/help \ --stringparam db2omf.omf_in ${SRC[0].abspath(env)} \ --stringparam db2omf.scrollkeeper_cl ${SCROLLKEEPER_DATADIR}/Templates/C/scrollkeeper_cl.xml \ ${DB2OMF} ${SRC[1].abspath(env)}""" Task.simple_task_type('xsltproc2po',xslt_magic,color='BLUE') def detect(conf): conf.check_tool('gnu_dirs glib2 dbus') sgml2man=conf.find_program('docbook2man',var='SGML2MAN') def getstr(varname): return getattr(Options.options,varname,'') conf.define('GNOMELOCALEDIR',os.path.join(conf.env['DATADIR'],'locale')) xml2po=conf.find_program('xml2po',var='XML2PO') xsltproc2po=conf.find_program('xsltproc',var='XSLTPROC2PO') conf.env['XML2POFLAGS']='-e -p' conf.env['SCROLLKEEPER_DATADIR']=Utils.cmd_output("scrollkeeper-config --pkgdatadir",silent=1).strip() conf.env['DB2OMF']=Utils.cmd_output("/usr/bin/pkg-config --variable db2omf gnome-doc-utils",silent=1).strip() conf.define('ENABLE_NLS',1) conf.define('HAVE_BIND_TEXTDOMAIN_CODESET',1) conf.define('HAVE_DCGETTEXT',1) conf.check(header_name='dlfcn.h',define_name='HAVE_DLFCN_H') conf.define('HAVE_GETTEXT',1) conf.check(header_name='inttypes.h',define_name='HAVE_INTTYPES_H') conf.check(header_name='locale.h',define_name='HAVE_LOCALE_H') conf.check(header_name='memory.h',define_name='HAVE_MEMORY_H') conf.check(header_name='stdint.h',define_name='HAVE_STDINT_H') conf.check(header_name='stdlib.h',define_name='HAVE_STDLIB_H') conf.check(header_name='strings.h',define_name='HAVE_STRINGS_H') conf.check(header_name='string.h',define_name='HAVE_STRING_H') conf.check(header_name='sys/stat.h',define_name='HAVE_SYS_STAT_H') conf.check(header_name='sys/types.h',define_name='HAVE_SYS_TYPES_H') conf.check(header_name='unistd.h',define_name='HAVE_UNISTD_H') def set_options(opt): opt.add_option('--want-rpath',type='int',default=1,dest='want_rpath',help='set rpath to 1 or 0 [Default 1]') taskgen(init_gnome_doc) feature('gmome_doc')(init_gnome_doc) taskgen(apply_gnome_doc) feature('gnome_doc')(apply_gnome_doc) after('init_gnome_doc')(apply_gnome_doc) taskgen(init_xml_to) feature('xml_to')(init_xml_to) taskgen(apply_xml_to) feature('xml_to')(apply_xml_to) after('init_xml_to')(apply_xml_to) taskgen(apply_gnome_sgml2man) feature('gnome_sgml2man')(apply_gnome_sgml2man) hotssh-0.2.6+dfsg1/wafadmin/Tools/qt4.py0000644000175000017500000003046211115036226016445 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 try: from xml.sax import make_parser from xml.sax.handler import ContentHandler except ImportError: has_xml=False ContentHandler=object else: has_xml=True import os,sys import ccroot,cxx import TaskGen,Task,Utils,Runner,Options,Build from TaskGen import taskgen,feature,after,extension from Logs import error from Constants import* MOC_H=['.h','.hpp','.hxx','.hh'] EXT_RCC=['.qrc'] EXT_UI=['.ui'] EXT_QT4=['.cpp','.cc','.cxx','.C'] class MTask(Task.Task): scan=ccroot.scan before=['cxx_link','ar_link_static'] def __init__(self,parent): Task.Task.__init__(self,parent.env) self.moc_done=0 self.parent=parent def runnable_status(self): if self.moc_done: for t in self.run_after: if not t.hasrun: return ASK_LATER self.signature() return Task.Task.runnable_status(self) else: self.add_moc_tasks() return ASK_LATER def add_moc_tasks(self): tree=Build.bld parn=self.parent node=self.inputs[0] try: self.signature() except KeyError: pass else: delattr(self,'cache_sig') moctasks=[] mocfiles=[] variant=node.variant(parn.env) try: tmp_lst=tree.raw_deps[self.unique_id()] tree.raw_deps[self.unique_id()]=[] except KeyError: tmp_lst=[] for d in tmp_lst: if not d.endswith('.moc'):continue if d in mocfiles: error("paranoia owns") continue mocfiles.append(d) ext='' try:ext=Options.options.qt_header_ext except AttributeError:pass if not ext: base2=d[:-4] path=node.parent.srcpath(parn.env) for i in MOC_H: try: os.stat(os.path.join(path,base2+i)) except OSError: pass else: ext=i break if not ext:raise Utils.WafError("no header found for %s which is a moc file"%str(d)) h_node=node.parent.find_resource(base2+i) m_node=h_node.change_ext('.moc') tree.node_deps[(self.inputs[0].parent.id,self.env.variant(),m_node.name)]=h_node task=Task.TaskBase.classes['moc'](parn.env,normal=0) task.set_inputs(h_node) task.set_outputs(m_node) generator=Build.bld.generator generator.outstanding.insert(0,task) generator.total+=1 moctasks.append(task) tmp_lst=tree.raw_deps[self.unique_id()]=mocfiles lst=tree.node_deps.get(self.unique_id(),()) for d in lst: name=d.name if name.endswith('.moc'): task=Task.TaskBase.classes['moc'](parn.env,normal=0) task.set_inputs(tree.node_deps[(self.inputs[0].parent.id,self.env.variant(),name)]) task.set_outputs(d) generator=Build.bld.generator generator.outstanding.insert(0,task) generator.total+=1 moctasks.append(task) self.run_after=moctasks self.moc_done=1 run=Task.TaskBase.classes['cxx'].__dict__['run'] def translation_update(task): outs=[a.abspath(task.env)for a in task.outputs] outs=" ".join(outs) lupdate=task.env['QT_LUPDATE'] for x in task.inputs: file=x.abspath(task.env) cmd="%s %s -ts %s"%(lupdate,file,outs) Utils.pprint('BLUE',cmd) task.generator.bld.exec_command(cmd) class XMLHandler(ContentHandler): def __init__(self): self.buf=[] self.files=[] def startElement(self,name,attrs): if name=='file': self.buf=[] def endElement(self,name): if name=='file': self.files.append(''.join(self.buf)) def characters(self,cars): self.buf.append(cars) def scan(self): node=self.inputs[0] parser=make_parser() curHandler=XMLHandler() parser.setContentHandler(curHandler) fi=open(self.inputs[0].abspath(self.env)) parser.parse(fi) fi.close() nodes=[] names=[] root=self.inputs[0].parent for x in curHandler.files: x=x.encode('utf8') nd=root.find_resource(x) if nd:nodes.append(nd) else:names.append(x) return(nodes,names) def create_rcc_task(self,node): rcnode=node.change_ext('_rc.cpp') rcctask=self.create_task('rcc') rcctask.inputs=[node] rcctask.outputs=[rcnode] cpptask=self.create_task('cxx') cpptask.inputs=[rcnode] cpptask.outputs=[rcnode.change_ext('.o')] cpptask.defines=self.scanner_defines self.compiled_tasks.append(cpptask) return cpptask def create_uic_task(self,node): uictask=self.create_task('ui4') uictask.inputs=[node] uictask.outputs=[node.change_ext('.h')] class qt4_taskgen(cxx.cxx_taskgen): def __init__(self,*k,**kw): cxx.cxx_taskgen.__init__(self,*k,**kw) self.features.append('qt4') def apply_qt4(self): if getattr(self,'lang',None): lst=[] trans=[] for l in self.to_list(self.lang): t=Task.TaskBase.classes['ts2qm'](self.env) t.set_inputs(self.path.find_resource(l+'.ts')) t.set_outputs(t.inputs[0].change_ext('.qm')) lst.append(t.outputs[0]) if self.update: trans.append(t.inputs[0]) if getattr(self,'update',None)and Options.options.trans_qt4: u=Task.TaskCmd(translation_update,self.env,2) u.inputs=[a.inputs[0]for a in self.compiled_tasks] u.outputs=trans if getattr(self,'langname',None): t=Task.TaskBase.classes['qm2rcc'](self.env) t.set_inputs(lst) t.set_outputs(self.path.find_or_declare(self.langname+'.qrc')) t.path=self.path k=create_rcc_task(self,t.outputs[0]) self.link_task.inputs.append(k.outputs[0]) lst=[] for flag in self.to_list(self.env['CXXFLAGS']): if len(flag)<2:continue if flag[0:2]=='-D'or flag[0:2]=='-I': lst.append(flag) self.env['MOC_FLAGS']=lst def find_sources_in_dirs(self,dirnames,excludes=[],exts=[]): lst=[] excludes=self.to_list(excludes) dirnames=self.to_list(dirnames) ext_lst=exts or self.mappings.keys()+TaskGen.task_gen.mappings.keys() self.lang=getattr(self,'lang','') for name in dirnames: anode=self.path.find_dir(name) Build.bld.rescan(anode) for name in Build.bld.cache_dir_contents[anode.id]: (base,ext)=os.path.splitext(name) if ext in ext_lst: if not name in lst: if name in excludes:continue lst.append((anode.path_to_parent(self.path)or'.')+'/'+name) elif ext=='.ts': self.lang+=' '+base lst.sort() self.source=self.source+' '+(" ".join(lst)) setattr(qt4_taskgen,'find_sources_in_dirs',find_sources_in_dirs) def cxx_hook(self,node): task=MTask(self) self.tasks.append(task) try:obj_ext=self.obj_ext except AttributeError:obj_ext='_%d.o'%self.idx task.defines=self.scanner_defines task.inputs=[node] task.outputs=[node.change_ext(obj_ext)] self.compiled_tasks.append(task) def process_qm2rcc(task): outfile=task.outputs[0].abspath(task.env) f=open(outfile,'w') f.write('\n\n') for k in task.inputs: f.write(' ') f.write(k.path_to_parent(task.path)) f.write('\n') f.write('\n') f.close() b=Task.simple_task_type b('moc','${QT_MOC} ${MOC_FLAGS} ${SRC} ${MOC_ST} ${TGT}',color='BLUE',vars=['QT_MOC','MOC_FLAGS']) cls=b('rcc','${QT_RCC} -name ${SRC[0].name} ${SRC[0].abspath(env)} ${RCC_ST} -o ${TGT}',color='BLUE',before='cxx moc',after="qm2rcc") cls.scan=scan b('ui4','${QT_UIC} ${SRC} -o ${TGT}',color='BLUE',before='cxx moc') b('ts2qm','${QT_LRELEASE} ${QT_LRELEASE_FLAGS} ${SRC} -qm ${TGT}',color='BLUE',before='qm2rcc') Task.task_type_from_func('qm2rcc',vars=[],func=process_qm2rcc,color='BLUE',before='rcc',after='ts2qm') def detect_qt4(conf): env=conf.env opt=Options.options qtlibs=getattr(opt,'qtlibs','') qtincludes=getattr(opt,'qtincludes','') qtbin=getattr(opt,'qtbin','') useframework=getattr(opt,'use_qt4_osxframework',True) qtdir=getattr(opt,'qtdir','') if not qtdir:qtdir=os.environ.get('QT4_ROOT','') if not qtdir: try: lst=os.listdir('/usr/local/Trolltech/') lst.sort() lst.reverse() qtdir='/usr/local/Trolltech/%s/'%lst[0] except OSError: pass if not qtdir: try: path=os.environ['PATH'].split(':') for qmk in['qmake-qt4','qmake4','qmake']: qmake=conf.find_program(qmk,path) if qmake: version=Utils.cmd_output(qmake+" -query QT_VERSION").strip().split('.') if version[0]=="4": qtincludes=Utils.cmd_output(qmake+" -query QT_INSTALL_HEADERS").strip() qtdir=Utils.cmd_output(qmake+" -query QT_INSTALL_PREFIX").strip()+"/" qtbin=Utils.cmd_output(qmake+" -query QT_INSTALL_BINS").strip()+"/" break except(OSError,ValueError): pass if not qtlibs:qtlibs=os.path.join(qtdir,'lib') vars="QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtTest QtXml QtWebKit Qt3Support".split() framework_ok=False if sys.platform=="darwin"and useframework: for i in vars: e=conf.create_framework_configurator() e.path=[qtlibs,'/Library/Frameworks'] e.name=i e.remove_dot_h=True e.run() if not i=='QtCore': for r in env['CCFLAGS_'+i.upper()]: if r.startswith('-F'): env['CCFLAGS_'+i.upper()].remove(r) break if conf.is_defined("HAVE_QTOPENGL")and not'-framework OpenGL'in env["LINKFLAGS_QTOPENGL"]: env["LINKFLAGS_QTOPENGL"]+=['-framework OpenGL'] if conf.is_defined("HAVE_QTGUI"): if not'-framework AppKit'in env["LINKFLAGS_QTGUI"]: env["LINKFLAGS_QTGUI"]+=['-framework AppKit'] if not'-framework ApplicationServices'in env["LINKFLAGS_QTGUI"]: env["LINKFLAGS_QTGUI"]+=['-framework ApplicationServices'] framework_ok=True if not conf.is_defined("HAVE_QTGUI"): if not qtincludes:qtincludes=os.path.join(qtdir,'include') env['QTINCLUDEPATH']=qtincludes lst=[qtincludes,'/usr/share/qt4/include/','/opt/qt4/include'] conf.check(header_name='QtGui/QFont',define_name='HAVE_QTGUI',mandatory=1,includes=lst) if not qtbin:qtbin=os.path.join(qtdir,'bin') binpath=[qtbin,'/usr/share/qt4/bin/']+os.environ['PATH'].split(':') def find_bin(lst,var): for f in lst: ret=conf.find_program(f,path_list=binpath) if ret: env[var]=ret break find_bin(['uic-qt3','uic3'],'QT_UIC3') find_bin(['uic-qt4','uic'],'QT_UIC') try: version=Utils.cmd_output(env['QT_UIC']+" -version 2>&1").strip() except ValueError: conf.fatal('your uic compiler is for qt3, add uic for qt4 to your path') version=version.replace('Qt User Interface Compiler ','') version=version.replace('User Interface Compiler for Qt','') if version.find(" 3.")!=-1: conf.check_message('uic version','(too old)',0,option='(%s)'%version) sys.exit(1) conf.check_message('uic version','',1,option='(%s)'%version) find_bin(['moc-qt4','moc'],'QT_MOC') find_bin(['rcc'],'QT_RCC') find_bin(['lrelease-qt4','lrelease'],'QT_LRELEASE') find_bin(['lupdate-qt4','lupdate'],'QT_LUPDATE') env['UIC3_ST']='%s -o %s' env['UIC_ST']='%s -o %s' env['MOC_ST']='-o' env['QT_LRELEASE_FLAGS']=['-silent'] if not framework_ok: vars_debug=[a+'_debug'for a in vars] pkgconfig=env['pkg-config']or'PKGCONFIG_PATH=%s:%s/pkgconfig:/usr/lib/qt4/lib/pkgconfig:/opt/qt4/lib/pkgconfig:/usr/lib/qt4/lib:/opt/qt4/lib pkg-config --silence-errors'%(qtlibs,qtlibs) for i in vars_debug+vars: try: conf.check_cfg(package=i,args='--cflags --libs',path=pkgconfig) except ValueError: pass def process_lib(vars_,coreval): for d in vars_: var=d.upper() if var=='QTCORE':continue value=env['LIBPATH_'+var] if value: core=env[coreval] accu=[] for lib in value: if lib in core:continue accu.append(lib) env['LIBPATH_'+var]=accu process_lib(vars,'LIBPATH_QTCORE') process_lib(vars_debug,'LIBPATH_QTCORE_DEBUG') if Options.options.want_rpath: def process_rpath(vars_,coreval): for d in vars_: var=d.upper() value=env['LIBPATH_'+var] if value: core=env[coreval] accu=[] for lib in value: if var!='QTCORE': if lib in core: continue accu.append('-Wl,--rpath='+lib) env['RPATH_'+var]=accu process_rpath(vars,'LIBPATH_QTCORE') process_rpath(vars_debug,'LIBPATH_QTCORE_DEBUG') env['QTLOCALE']=str(env['PREFIX'])+'/share/locale' def detect(conf): if sys.platform=='win32':conf.fatal('Qt4.py will not work on win32 for now - ask the author') detect_qt4(conf) def set_options(opt): opt.add_option('--want-rpath',type='int',default=1,dest='want_rpath',help='set rpath to 1 or 0 [Default 1]') opt.add_option('--header-ext',type='string',default='',help='header extension for moc files',dest='qt_header_ext') for i in"qtdir qtincludes qtlibs qtbin".split(): opt.add_option('--'+i,type='string',default='',dest=i) if sys.platform=="darwin": opt.add_option('--no-qt4-framework',action="store_false",help='do not use the framework version of Qt4 in OS X',dest='use_qt4_osxframework',default=True) opt.add_option('--translate',action="store_true",help="collect translation strings",dest="trans_qt4",default=False) extension(EXT_RCC)(create_rcc_task) extension(EXT_UI)(create_uic_task) taskgen(apply_qt4) feature('qt4')(apply_qt4) after('apply_link')(apply_qt4) extension(EXT_QT4)(cxx_hook) hotssh-0.2.6+dfsg1/wafadmin/Tools/osx.py0000644000175000017500000000765511115036226016556 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,shutil,sys import TaskGen,Task,Build,Options from TaskGen import taskgen,feature,after,before from Logs import error,debug def apply_framework(self): for x in self.to_list(self.env['FRAMEWORKPATH']): self.env.append_unique('CXXFLAGS',x) self.env.append_unique('CCFLAGS',x) self.env.append_unique('LINKFLAGS',x) for x in self.to_list(self.env['FRAMEWORK']): self.env.append_unique('LINKFLAGS',x) def create_task_macapp(self): if'cprogram'in self.features and self.link_task: apptask=self.create_task('macapp',self.env) apptask.set_inputs(self.link_task.outputs) apptask.set_outputs(self.link_task.outputs[0].change_ext('.app')) self.apptask=apptask def apply_link_osx(self): if self.env['MACAPP']or getattr(self,'mac_app',False): self.create_task_macapp() name=self.link_task.outputs[0].name if self.vnum:name=name.replace('.dylib','.%s.dylib'%self.vnum) path=os.path.join(self.env['PREFIX'],lib,name) path='-install_name %s'%path self.env.append_value('LINKFLAGS',path) def apply_bundle(self): if not'shlib'in self.features:return if self.env['MACBUNDLE']or getattr(self,'mac_bundle',False): self.env['shlib_PATTERN']='%s.bundle' uselib=self.to_list(self.uselib) if not'MACBUNDLE'in uselib:uselib.append('MACBUNDLE') def apply_bundle_remove_dynamiclib(self): if not'shlib'in self.features:return if self.env['MACBUNDLE']or getattr(self,'mac_bundle',False): self.env["LINKFLAGS"].remove("-dynamiclib") self.env.append_value("LINKFLAGS","-bundle") app_dirs=['Contents',os.path.join('Contents','MacOS'),os.path.join('Contents','Resources')] app_info=''' CFBundlePackageType APPL CFBundleGetInfoString Created by Waf CFBundleSignature ???? NOTE THIS IS A GENERATED FILE, DO NOT MODIFY CFBundleExecutable %s ''' def app_build(task): global app_dirs env=task.env i=0 for p in task.outputs: srcfile=p.srcpath(env) debug('osx: creating directories') try: os.mkdir(srcfile) [os.makedirs(os.path.join(srcfile,d))for d in app_dirs] except(OSError,IOError): pass srcprg=task.inputs[i].srcpath(env) dst=os.path.join(srcfile,'Contents','MacOS') debug('osx: copy %s to %s'%(srcprg,dst)) shutil.copy(srcprg,dst) debug('osx: generate Info.plist') f=file(os.path.join(srcfile,"Contents","Info.plist"),"w") f.write(app_info%os.path.basename(srcprg)) f.close() i+=1 return 0 def install_shlib(task): nums=task.vnum.split('.') path=self.install_path libname=task.outputs[0].name name3=libname.replace('.dylib','.%s.dylib'%task.vnum) name2=libname.replace('.dylib','.%s.dylib'%nums[0]) name1=libname filename=task.outputs[0].abspath(task.env) bld=Build.bld bld.install_as(path+name3,filename,env=task.env) bld.symlink_as(path+name2,name3) bld.symlink_as(path+name1,name3) def install_target_osx_cshlib(self): if not Options.is_install:return if getattr(self,'vnum','')and sys.platform!='win32': self.link_task.install=install_shlib Task.task_type_from_func('macapp',vars=[],func=app_build,after="cxx_link cc_link ar_link_static") taskgen(apply_framework) feature('cc','cxx')(apply_framework) after('apply_lib_vars')(apply_framework) taskgen(create_task_macapp) taskgen(apply_link_osx) after('apply_link')(apply_link_osx) feature('cc','cxx')(apply_link_osx) taskgen(apply_bundle) before('apply_link')(apply_bundle) before('apply_lib_vars')(apply_bundle) feature('cc','cxx')(apply_bundle) taskgen(apply_bundle_remove_dynamiclib) after('apply_link')(apply_bundle_remove_dynamiclib) feature('cc','cxx')(apply_bundle_remove_dynamiclib) taskgen(install_target_osx_cshlib) feature('osx')(install_target_osx_cshlib) after('install_target_cshlib')(install_target_osx_cshlib) hotssh-0.2.6+dfsg1/wafadmin/Tools/g++.py0000644000175000017500000000523511115036226016311 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,optparse,sys,re import Configure,Options,Utils import ccroot,ar from Configure import conftest def find_gxx(conf): v=conf.env cxx=None if v['CXX']:cxx=v['CXX'] elif'CXX'in os.environ:cxx=os.environ['CXX'] if not cxx:cxx=conf.find_program('g++',var='CXX') if not cxx:cxx=conf.find_program('c++',var='CXX') if not cxx:conf.fatal('g++ was not found') try: if Utils.cmd_output('%s --version'%cxx).find('g++')<0: conf.fatal('g++ was not found, see the result of g++ --version') except ValueError: conf.fatal('g++ --version could not be executed') v['CXX']=cxx v['CXX_NAME']='gcc' ccroot.get_cc_version(conf,cxx,'CXX_VERSION') def gxx_common_flags(conf): v=conf.env v['CXX_SRC_F']='' v['CXX_TGT_F']='-c -o ' v['CPPPATH_ST']='-I%s' if not v['LINK_CXX']:v['LINK_CXX']=v['CXX'] v['CXXLNK_SRC_F']='' v['CXXLNK_TGT_F']='-o ' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STATICLIB_ST']='-l%s' v['STATICLIBPATH_ST']='-L%s' v['RPATH_ST']='-Wl,-rpath,%s' v['CXXDEFINES_ST']='-D%s' v['SHLIB_MARKER']='-Wl,-Bdynamic' v['STATICLIB_MARKER']='-Wl,-Bstatic' v['FULLSTATIC_MARKER']='-static' v['program_PATTERN']='%s' v['shlib_CXXFLAGS']=['-fPIC','-DPIC'] v['shlib_LINKFLAGS']=['-shared'] v['shlib_PATTERN']='lib%s.so' v['staticlib_LINKFLAGS']=['-Wl,-Bstatic'] v['staticlib_PATTERN']='lib%s.a' v['MACBUNDLE_LINKFLAGS']=['-bundle','-undefined dynamic_lookup'] v['MACBUNDLE_CCFLAGS']=['-fPIC'] v['MACBUNDLE_PATTERN']='%s.bundle' def gxx_modifier_win32(conf): if sys.platform!='win32':return v=conf.env v['program_PATTERN']='%s.exe' v['shlib_PATTERN']='lib%s.dll' v['shlib_CXXFLAGS']=[''] v['staticlib_LINKFLAGS']=[''] def gxx_modifier_cygwin(conf): if sys.platform!='cygwin':return v=conf.env v['program_PATTERN']='%s.exe' v['shlib_PATTERN']='lib%s.dll' v['shlib_CXXFLAGS']=[''] v['staticlib_LINKFLAGS']=[''] def gxx_modifier_darwin(conf): if sys.platform!='darwin':return v=conf.env v['shlib_CXXFLAGS']=['-fPIC','-compatibility_version 1','-current_version 1'] v['shlib_LINKFLAGS']=['-dynamiclib'] v['shlib_PATTERN']='lib%s.dylib' v['staticlib_LINKFLAGS']=[''] v['SHLIB_MARKER']='' v['STATICLIB_MARKER']='' def gxx_modifier_aix5(conf): if sys.platform!='aix5':return v=conf.env v['program_LINKFLAGS']=['-Wl,-brtl'] v['shlib_LINKFLAGS']=['-shared','-Wl,-brtl,-bexpfull'] v['SHLIB_MARKER']='' detect=''' find_gxx find_cpp find_ar gxx_common_flags gxx_modifier_win32 gxx_modifier_cygwin gxx_modifier_darwin gxx_modifier_aix5 cxx_load_tools cxx_add_flags ''' conftest(find_gxx) conftest(gxx_common_flags) conftest(gxx_modifier_win32) conftest(gxx_modifier_cygwin) conftest(gxx_modifier_darwin) conftest(gxx_modifier_aix5) hotssh-0.2.6+dfsg1/wafadmin/Tools/gnu_dirs.py0000644000175000017500000000532111075216572017554 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import re import Utils,Options _options=[x.split(', ')for x in''' bindir, user executables, $(EXEC_PREFIX)/bin sbindir, system admin executables, $(EXEC_PREFIX)/sbin libexecdir, program executables, $(EXEC_PREFIX)/libexec sysconfdir, read-only single-machine data, $(PREFIX)/etc sharedstatedir, modifiable architecture-independent data, $(PREFIX)/com localstatedir, modifiable single-machine data, $(PREFIX)/var libdir, object code libraries, $(EXEC_PREFIX)/lib includedir, C header files, $(PREFIX)/include oldincludedir, C header files for non-gcc, /usr/include datarootdir, read-only arch.-independent data root, $(PREFIX)/share datadir, read-only architecture-independent data, $(DATAROOTDIR) infodir, info documentation, $(DATAROOTDIR)/info localedir, locale-dependent data, $(DATAROOTDIR)/locale mandir, man documentation, $(DATAROOTDIR)/man docdir, documentation root, $(DATAROOTDIR)/doc/$(PACKAGE) htmldir, html documentation, $(DOCDIR) dvidir, dvi documentation, $(DOCDIR) pdfdir, pdf documentation, $(DOCDIR) psdir, ps documentation, $(DOCDIR) '''.split('\n')if x] re_var=re.compile(r'\$\(([a-zA-Z0-9_]+)\)') def subst_vars(foo,vars): def repl(m): s=m.group(1) return s and''+vars[s]or'' return re_var.sub(repl,foo) def detect(conf): def get_param(varname,default): return getattr(Options.options,varname,'')or default env=conf.env env['EXEC_PREFIX']=get_param('EXEC_PREFIX',env['PREFIX']) env['PACKAGE']=Utils.g_module.APPNAME or env['PACKAGE'] complete=False iter=0 while not complete and iter #include int main() { std::cout << BOOST_VERSION << std::endl; } ''' boost_libpath=['/usr/lib','/usr/local/lib','/opt/local/lib','/sw/lib','/lib'] boost_cpppath=['/usr/include','/usr/local/include','/opt/local/include','/sw/include'] STATIC_NOSTATIC='nostatic' STATIC_BOTH='both' STATIC_ONLYSTATIC='onlystatic' is_versiontag=re.compile('^\d+_\d+_?\d*$') is_threadingtag=re.compile('^mt$') is_abitag=re.compile('^[sgydpn]+$') is_toolsettag=re.compile('^(acc|borland|como|cw|dmc|darwin|gcc|hp_cxx|intel|kylix|msvc|qcc|sun|vacpp)\d*$') def set_options(opt): opt.add_option('--boost-includes',type='string',default='',dest='boostincludes',help='path to the boost directory where the includes are e.g. /usr/local/include/boost-1_35') opt.add_option('--boost-libs',type='string',default='',dest='boostlibs',help='path to the directory where the boost libs are e.g. /usr/local/lib') def string_to_version(s): version=s.split('.') if len(version)<3:return 0 return int(version[0])*100000+int(version[1])*100+int(version[2]) def version_string(version): major=version/100000 minor=version/100%1000 minor_minor=version%100 if minor_minor==0: return"%d_%d"%(major,minor) else: return"%d_%d_%d"%(major,minor,minor_minor) def libfiles(lib,pattern,lib_paths): result=[] for lib_path in lib_paths: libname=pattern%('boost_'+lib+'*') result+=glob.glob(lib_path+'/'+libname) return result def get_boost_version_number(self,dir): try: return self.run_c_code(compiler='cxx',code=boost_code,includes=dir,execute=1,env=self.env.copy(),type='cprogram') except Configure.ConfigurationError,e: return-1 def set_default(kw,var,val): if not var in kw: kw[var]=val def tags_score(tags,kw): score=0 needed_tags={'threading':kw['tag_threading'],'abi':kw['tag_abi'],'toolset':kw['tag_toolset'],'version':kw['tag_version']} if kw['tag_toolset']is None: v=kw['env'] toolset=v['CXX_NAME'] if v['CXX_VERSION']: version_no=v['CXX_VERSION'].split('.') toolset+=version_no[0] if len(version_no)>1: toolset+=version_no[1] needed_tags['toolset']=toolset found_tags={} for tag in tags: if is_versiontag.match(tag):found_tags['version']=tag if is_threadingtag.match(tag):found_tags['threading']=tag if is_abitag.match(tag):found_tags['abi']=tag if is_toolsettag.match(tag):found_tags['toolset']=tag for tagname in needed_tags.iterkeys(): if needed_tags[tagname]is not None and found_tags.has_key(tagname): if re.compile(needed_tags[tagname]).match(found_tags[tagname]): score+=kw['score_'+tagname][0] else: score+=kw['score_'+tagname][1] return score def validate_boost(self,kw): ver=kw.get('version','') for x in'min_version max_version version'.split(): set_default(kw,x,ver) set_default(kw,'lib','') kw['lib']=Utils.to_list(kw['lib']) set_default(kw,'env',self.env) set_default(kw,'libpath',boost_libpath) set_default(kw,'cpppath',boost_cpppath) for x in'tag_threading tag_version tag_toolset'.split(): set_default(kw,x,None) set_default(kw,'tag_abi','^[^d]*$') set_default(kw,'score_threading',(10,-10)) set_default(kw,'score_abi',(10,-10)) set_default(kw,'score_toolset',(1,-1)) set_default(kw,'score_version',(100,-100)) set_default(kw,'score_min',0) set_default(kw,'static',STATIC_NOSTATIC) set_default(kw,'found_includes',False) set_default(kw,'min_score',0) set_default(kw,'errmsg','not found') set_default(kw,'okmsg','ok') def find_boost_includes(self,kw): boostPath=getattr(Options.options,'boostincludes','') if boostPath: boostPath=[os.path.normpath(os.path.expandvars(os.path.expanduser(boostPath)))] else: boostPath=Utils.to_list(kw['cpppath']) min_version=string_to_version(kw.get('min_version','')) max_version=string_to_version(kw.get('max_version',''))or(sys.maxint-1) version=0 for include_path in boostPath: boost_paths=glob.glob(os.path.join(include_path,'boost*')) for path in boost_paths: pathname=os.path.split(path)[-1] ret=-1 if pathname=='boost': path=include_path ret=self.get_boost_version_number(path) elif pathname.startswith('boost-'): ret=self.get_boost_version_number(path) ret=int(ret) if ret!=-1 and ret>=min_version and ret<=max_version and ret>version: boost_path=path version=ret break if not version: self.fatal('boost headers not found! (required version min: %s max: %s)'%(kw['min_version'],kw['max_version'])) return False found_version=version_string(version) versiontag='^'+found_version+'$' if kw['tag_version']is None: kw['tag_version']=versiontag elif kw['tag_version']!=versiontag: warn('boost header version %r and tag_version %r do not match!'%(versiontag,kw['tag_version'])) env=self.env env['CPPPATH_BOOST']=boost_path env['BOOST_VERSION']=found_version self.found_includes=1 ret='Version %s (%s)'%(found_version,boost_path) return ret def find_boost_library(self,lib,kw): def find_library_from_list(lib,files): lib_pattern=re.compile('.*boost_(.*?)\..*') result=(None,None) resultscore=kw['min_score']-1 for file in files: m=lib_pattern.search(file,1) if m: libname=m.group(1) libtags=libname.split('-')[1:] currentscore=tags_score(libtags,kw) if currentscore>resultscore: result=(libname,file) resultscore=currentscore return result lib_paths=getattr(Options.options,'boostlibs','') if lib_paths: lib_paths=[os.path.normpath(os.path.expandvars(os.path.expanduser(lib_paths)))] else: lib_paths=Utils.to_list(kw['libpath']) v=kw.get('env',self.env) (libname,file)=(None,None) if kw['static']in[STATIC_NOSTATIC,STATIC_BOTH]: st_env_prefix='LIB' files=libfiles(lib,v['shlib_PATTERN'],lib_paths) (libname,file)=find_library_from_list(lib,files) if libname is None and kw['static']in[STATIC_ONLYSTATIC,STATIC_BOTH]: st_env_prefix='STATICLIB' files=libfiles(lib,v['staticlib_PATTERN'],lib_paths) (libname,file)=find_library_from_list(lib,files) if libname is not None: v['LIBPATH_BOOST_'+lib.upper()]=os.path.split(file)[0] v[st_env_prefix+'_BOOST_'+lib.upper()]='boost_'+libname return self.fatal('lib boost_'+lib+' not found!') def check_boost(self,*k,**kw): self.validate_boost(kw) ret=None try: if not kw.get('found_includes',None): self.check_message_1(kw.get('msg_includes','boost headers')) ret=self.find_boost_includes(kw) except Configure.ConfigurationError,e: if'errmsg'in kw: self.check_message_2(kw['errmsg'],'YELLOW') if'mandatory'in kw: if Logs.verbose>1: raise else: self.fatal('the configuration failed (see config.log)') else: if'okmsg'in kw: self.check_message_2(kw.get('okmsg_includes',ret)) for lib in kw['lib']: self.check_message_1('library boost_'+lib) try: self.find_boost_library(lib,kw) except Configure.ConfigurationError,e: if'errmsg'in kw: self.check_message_2(kw['errmsg'],'YELLOW') if'mandatory'in kw: if Logs.verbose>1: raise else: self.fatal('the configuration failed (see config.log)') else: if'okmsg'in kw: self.check_message_2(kw['okmsg']) return ret conf(get_boost_version_number) conf(validate_boost) conf(find_boost_includes) conf(find_boost_library) conf(check_boost) hotssh-0.2.6+dfsg1/wafadmin/Tools/compiler_d.py0000644000175000017500000000151711075216572020062 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,imp,types import Utils,Configure,Options def detect(conf): if getattr(Options.options,'check_dmd_first',None): test_for_compiler=['dmd','gdc'] else: test_for_compiler=['gdc','dmd'] for d_compiler in test_for_compiler: conf.check_tool(d_compiler) if conf.env['D_COMPILER']: conf.check_message("%s"%d_compiler,'',True) conf.env["COMPILER_D"]=d_compiler return conf.check_message("%s"%d_compiler,'',False) def set_options(opt): d_compiler_opts=opt.add_option_group("D Compiler Options") d_compiler_opts.add_option('--check-dmd-first',action="store_true",help='checks for the gdc compiler before dmd (default is the other way round)',dest='check_dmd_first',default=False) for d_compiler in['gdc','dmd']: opt.tool_options('%s'%d_compiler,option_group=d_compiler_opts) hotssh-0.2.6+dfsg1/wafadmin/Tools/UnitTest.py0000644000175000017500000000703611075216572017526 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys import Build,TaskGen,Utils,Options,Logs import pproc class unit_test(object): def __init__(self): self.returncode_ok=0 self.num_tests_ok=0 self.num_tests_failed=0 self.num_tests_err=0 self.total_num_tests=0 self.max_label_length=0 self.unit_tests={} self.unit_test_results={} self.unit_test_erroneous={} self.change_to_testfile_dir=False self.want_to_see_test_output=False self.want_to_see_test_error=False self.run_if_waf_does='check' def run(self): self.num_tests_ok=0 self.num_tests_failed=0 self.num_tests_err=0 self.total_num_tests=0 self.max_label_length=0 self.unit_tests={} self.unit_test_results={} self.unit_test_erroneous={} if not Options.commands[self.run_if_waf_does]:return for obj in Build.bld.all_task_gen: if not hasattr(obj,'unit_test'):continue unit_test=getattr(obj,'unit_test') if not unit_test:continue try: if'program'in obj.features: output=obj.path filename=os.path.join(output.abspath(obj.env),obj.target) srcdir=output.abspath() label=os.path.join(output.bldpath(obj.env),obj.target) self.max_label_length=max(self.max_label_length,len(label)) self.unit_tests[label]=(filename,srcdir) except KeyError: pass self.total_num_tests=len(self.unit_tests) Utils.pprint('GREEN','Running the unit tests') count=0 result=1 for label,file_and_src in self.unit_tests.iteritems(): filename=file_and_src[0] srcdir=file_and_src[1] count+=1 line=Build.bld.progress_line(count,self.total_num_tests,Logs.colors.GREEN,Logs.colors.NORMAL) if Options.options.progress_bar and line: sys.stdout.write(line) sys.stdout.flush() try: kwargs={} if self.change_to_testfile_dir: kwargs['cwd']=srcdir if not self.want_to_see_test_output: kwargs['stdout']=pproc.PIPE if not self.want_to_see_test_error: kwargs['stderr']=pproc.PIPE pp=pproc.Popen(filename,**kwargs) pp.wait() result=int(pp.returncode==self.returncode_ok) if result: self.num_tests_ok+=1 else: self.num_tests_failed+=1 self.unit_test_results[label]=result self.unit_test_erroneous[label]=0 except OSError: self.unit_test_erroneous[label]=1 self.num_tests_err+=1 except KeyboardInterrupt: pass if Options.options.progress_bar:sys.stdout.write(Logs.colors.cursor_on) def print_results(self): if not Options.commands[self.run_if_waf_does]:return p=Utils.pprint if self.total_num_tests==0: p('YELLOW','No unit tests present') return p('GREEN','Running unit tests') print for label,filename in self.unit_tests.iteritems(): err=0 result=0 try:err=self.unit_test_erroneous[label] except KeyError:pass try:result=self.unit_test_results[label] except KeyError:pass n=self.max_label_length-len(label) if err:n+=4 elif result:n+=7 else:n+=3 line='%s %s'%(label,'.'*n) print line, if err:p('RED','ERROR') elif result:p('GREEN','OK') else:p('YELLOW','FAILED') percentage_ok=float(self.num_tests_ok)/float(self.total_num_tests)*100.0 percentage_failed=float(self.num_tests_failed)/float(self.total_num_tests)*100.0 percentage_erroneous=float(self.num_tests_err)/float(self.total_num_tests)*100.0 print''' Successful tests: %i (%.1f%%) Failed tests: %i (%.1f%%) Erroneous tests: %i (%.1f%%) Total number of tests: %i '''%(self.num_tests_ok,percentage_ok,self.num_tests_failed,percentage_failed,self.num_tests_err,percentage_erroneous,self.total_num_tests) p('GREEN','Unit tests finished') hotssh-0.2.6+dfsg1/wafadmin/Tools/preproc.pyc0000644000175000017500000004476011777064501017573 0ustar javijavi <4Ic@sddlZddlZddlZddlZddlZedkraddgeje_nddlZddlZddl Z ddlm Z m Z ddl Z de j fdYZdZd Zd gZejd krgZnd Zd Zi d d 6dd6dd6dd6dd6dd6dd6dd6dd6dd6Zejd ejejBZejd!Zejd"Zejd#ejZejd$ejZejd%ejZged&d'D]\Z Z!d(e e!f^qZ"i d d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6Z#d<Z$d=Z%d>Z&d?Z'd@Z(e$e'e&e%gZ)dAdBdCdDgZ*ejdj+gee)e*D]\Z,Z-dEe,e-f^qej.Z/d+Z0d<Z1dFZ2d?Z3dGZ4dHZ5iZ6dIdJdKdLdMdNdOdPgZ7xEe8e9e7D]1Z:e7e:Z;xe;j<D]Z=e:e6e=dRZ?dSZ@dTZAdUeBfdVYZCdWZDejdXZEdYZFdZZGd[ZHdS(\iNt__main__t.s..(tdebugterrort PreprocErrorcBseZRS((t__name__t __module__(((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pyR st-is /usr/includetwin32t!tnots&&tandt&tbitands&=tand_eqs||tort|tbitors|=tor_eqt^txors^=txor_eqt~tcomplsa^[ ]*(#|%:)[ ]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ ]*(.*) *$s ^[a-zA-Z_]\w*s^[a-zA-Z_][a-zA-Z0-9_]*[(]s ^\s*once\s*s\\ * sT(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)s =-/!'()<>s #~\|^[]{}s??t0itaitbi tti tni tfi tvi tri\s\i't'titOtTtstcs$0[xX](?P[a-fA-F0-9]+)(?P[uUlL]*)|L*?'(?P(\\.|[^\\'])+)'|(?P\d+)[Ee](?P[+-]*?\d+)(?P[fFlL]*)|(?P\d*\.\d+)([Ee](?P[+-]*?\d+))?(?P[fFlL]*)|(?P\d+\.\d*)([Ee](?P[+-]*?\d+))?(?P[fFlL]*)|(?P0*)(?P\d+)(?P[uUlL]*)sL?"([^"\\]|\\.)*"s [a-zA-Z_]\w*s%:%:|<<=|>>=|\.\.\.|<<|<%|<:|<=|>>|>=|\+\+|\+=|--|->|-=|\*=|/=|%:|%=|%>|==|&&|&=|\|\||\|=|\^=|:>|!=|##|[\(\)\{\}\[\]<>\?\|\^\*\+&=:!#;,%/\-\?\~\.]s (?P<%s>%s)tucCsB|jd}|dk rdS|jd}|dkr>dS|S(Nit it(tgrouptNone(tmR$((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pytrepl)s  cCst|d}|j}|jtr]x/tD]$\}}|j|j|}q2Wntjd|}t jt |}gt j t |D]$}|jd|jdf^qS(NRR(ii(topentreadtcloset use_trigraphsttrig_deftsplittjointre_nltsubtre_cppR,tretfinditertre_linesR)(tfilenameRtcodeRRR+((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pytfilter_comments/s  s* / %s+ -s<< >>s < <= >= >s== !=s& | ^s&& ||t,cCsyd|}Wntk r-t|}nXyd|}Wntk r[t|}nX|}|dkr{||}n|dkr||}n|dkr||}n|dkr||}n|dkr||}n|dkr||A}n|dkr||B}nx|d kr2t|p)|}nW|d krK||@}n>|d krlt|oc|}n|d krt||k}n|d krt||k}n|dkrt||k}n|dkrt||k}n|dkrt||k}nx|dkr2t||k}nW|dkrQt||A}n8|dkrj||>}n|dkr||?}nd}|S(Nit%t+Rt*t/RRs||R s&&s==s!=s<=ts>=s<>(t TypeErrortint(tval_1tval_2tval_opRRtdR%((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pyt reduce_nums>sb                     c Cs(|sgggfS|d\}}|tkr@|||dfS|tkry5|d\}}|tkr||||dfSWntk rnX|||dfS|tkr|dkrt|d||\}}}|dkr(|tkr td t|ntt|fg|||S|tkrJtd t|n|dkrc|||fS|dkr|t| |fS|dkr|tt| |fS|dkr|t||fS|||fS|d kr$d}d} xs|D]X\} }|d kr*|d8}|dkrCPqCn|d krC|d7}n| d7} qWtd t|t |d| !||} t | dkr| d\}}|||| dfStdt|q$nW|tkr$t |dkry|d\}}|dkry|d\} } | tkrQ| tkrQ| tkrQtdt|nt||| fg|d||Sn|j dkrJ|d\}}d}|d kr|d\}}|tkrtdn|d\} } | d krtdnd}n|tkrtdnd}||kr9d}nt|||fS||ksb||krd|kr|||dfStd|dfSnt ||t jkrt||\}}|||.*)>|"(?P.*)")cCstj|}|r\|jdr7d|jdfS|jdr\d|jdfSnt|}t||dg}|d\}}|tkrtd|nd|fS(NRRBRRROiscould not parse include %s(t re_includeRR)RRXRRR(RRcR+ttokensReR((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pyRs  c CsG|stdn|ddkr,t|S|d}|dkrt|dkrx|dtjkrxt|dd St|dd S|jr|d krt|dkrdSxd D]Q}t||kr|dd|!jrd|t|dd|!d fSqWn-y t|SWntk rBtd |nXdS(Nsattempted to parse a null charis\iRoiiiiRis!could not parse char literal '%s'(iii( RtordRYtstringt hexdigitsREtisdigittchr_escR(RR%R!((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pyt parse_chars&    %  ))  cCsg}xtj|D]}|j}xtD]}||}|r,|tkryt|}t}Wqtk r|jdkrd}t }q|jdkrd}t }qqXn|t krb|drt |d}q|dr t |dd}q|d r&|d }q|d }|rGt |}q|d p\|d }n9|tkr|d krd}q|dkrd}qn|j ||fPq,q,WqW|S(Nttrueitfalseitoctithexitn0tchartn2tn4s%:RKs%:%:s##( t re_clexerR8R)t tok_typesRVt g_optransRTRRZRQRERR_(R$RktmatchR+RR((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pyRsH                (IR7tsystosRR\RtpathRRtUtilsRRRtWafErrorRRt go_absolutetstandard_includestplatformR0RRtcompilet IGNORECASEt MULTILINER9RRRR4R6tzipRRR1RRQRTRVRRtCHARRt exp_typesR3RtparttMRRRRRR,R<RtopstrangeRYRotsymsR2R&RJRURXRtobjectRR^RRRR(((su/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/preproc.pytsh< $   L2LJ      '  . hotssh-0.2.6+dfsg1/wafadmin/Tools/cc.py0000644000175000017500000000567611115036226016333 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import TaskGen,Build,Utils,Task from Logs import debug import ccroot from TaskGen import feature,before,extension,after g_cc_flag_vars=['CCDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS','RPATH','CCFLAGS','CPPPATH','CPPFLAGS','CCDEFINES'] EXT_CC=['.c'] TaskGen.bind_feature('cc',['apply_core']) g_cc_type_vars=['CCFLAGS','LINKFLAGS'] class cc_taskgen(ccroot.ccroot_abstract): pass def init_cc(self): self.p_flag_vars=set(self.p_flag_vars).union(g_cc_flag_vars) self.p_type_vars=set(self.p_type_vars).union(g_cc_type_vars) if not self.env['CC_NAME']: raise Utils.WafError("At least one compiler (gcc, ..) must be selected") def apply_obj_vars_cc(self): env=self.env app=env.append_unique cpppath_st=env['CPPPATH_ST'] for i in env['INC_PATHS']: app('_CCINCFLAGS',cpppath_st%i.bldpath(env)) app('_CCINCFLAGS',cpppath_st%i.srcpath(env)) for i in env['CPPPATH']: app('_CCINCFLAGS',cpppath_st%i) app('_CCINCFLAGS',cpppath_st%'.') app('_CCINCFLAGS',cpppath_st%env.variant()) tmpnode=self.path app('_CCINCFLAGS',cpppath_st%tmpnode.bldpath(env)) app('_CCINCFLAGS',cpppath_st%tmpnode.srcpath(env)) def apply_defines_cc(self): tree=Build.bld self.defines=getattr(self,'defines',[]) lst=self.to_list(self.defines)+self.to_list(self.env['CCDEFINES']) milst=[] for defi in lst: if not defi in milst: milst.append(defi) libs=self.to_list(self.uselib) for l in libs: val=self.env['CCDEFINES_'+l] if val:milst+=val self.env['DEFLINES']=["%s %s"%(x[0],Utils.trimquotes('='.join(x[1:])))for x in[y.split('=')for y in milst]] y=self.env['CCDEFINES_ST'] self.env['_CCDEFFLAGS']=[y%x for x in milst] def c_hook(self,node): task=self.create_task('cc') try:obj_ext=self.obj_ext except AttributeError:obj_ext='_%d.o'%self.idx task.defines=self.scanner_defines task.inputs=[node] task.outputs=[node.change_ext(obj_ext)] self.compiled_tasks.append(task) cc_str='${CC} ${CCFLAGS} ${CPPFLAGS} ${_CCINCFLAGS} ${_CCDEFFLAGS} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}' link_str='${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS}' vnum_link_str='${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[1].bldpath(env)} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS} && ln -sf ${TGT[1].name} ${TGT[0].bldpath(env)}' cls=Task.simple_task_type('cc',cc_str,'GREEN',ext_out='.o',ext_in='.c') cls.scan=ccroot.scan cls.vars.append('CCDEPS') cls=Task.simple_task_type('cc_link',link_str,color='YELLOW',ext_in='.o') cls.maxjobs=1 cls=Task.simple_task_type('vnum_cc_link',vnum_link_str,color='YELLOW',ext_in='.o') cls.maxjobs=1 TaskGen.declare_order('apply_incpaths','apply_defines_cc','apply_core','apply_lib_vars','apply_obj_vars_cc','apply_obj_vars') feature('cc')(init_cc) before('apply_type_vars')(init_cc) after('default_cc')(init_cc) feature('cc')(apply_obj_vars_cc) feature('cc')(apply_defines_cc) extension(EXT_CC)(c_hook) hotssh-0.2.6+dfsg1/wafadmin/Tools/gob2.py0000644000175000017500000000054111075216572016572 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import TaskGen TaskGen.declare_chain(name='gob2',action='${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',ext_in='.gob',ext_out='.c') def detect(conf): gob2=conf.find_program('gob2',var='GOB2') if not gob2:conf.fatal('could not find the gob2 compiler') conf.env['GOB2']=gob2 conf.env['GOB2FLAGS']='' hotssh-0.2.6+dfsg1/wafadmin/Tools/misc.py0000644000175000017500000002356311115036226016674 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import shutil,re,os,types,new import TaskGen,Node,Task,Utils,Build,pproc,Constants from TaskGen import feature,taskgen,after from Logs import debug def copy_func(tsk): env=tsk.env infile=tsk.inputs[0].abspath(env) outfile=tsk.outputs[0].abspath(env) try: shutil.copy2(infile,outfile) except OSError,IOError: return 1 else: if tsk.chmod:os.chmod(outfile,tsk.chmod) return 0 def action_process_file_func(tsk): if not tsk.fun:raise Utils.WafError('task must have a function attached to it for copy_func to work!') return tsk.fun(tsk) class cmd_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_cmd(self): if not self.fun:raise Utils.WafError('cmdobj needs a function!') tsk=Task.TaskBase() tsk.fun=self.fun tsk.env=self.env self.tasks.append(tsk) tsk.install_path=self.install_path class copy_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_copy(self): Utils.def_attrs(self,fun=copy_func) self.default_install_path=0 lst=self.to_list(self.source) for filename in lst: node=self.path.find_resource(filename) if not node:raise Utils.WafError('cannot find input file %s for processing'%filename) target=self.target if not target or len(lst)>1:target=node.name newnode=self.path.find_or_declare(target) tsk=self.create_task('copy') tsk.set_inputs(node) tsk.set_outputs(newnode) tsk.fun=self.fun tsk.chmod=self.chmod if not tsk.env: tsk.debug() raise Utils.WafError('task without an environment') def subst_func(tsk): m4_re=re.compile('@(\w+)@',re.M) env=tsk.env infile=tsk.inputs[0].abspath(env) outfile=tsk.outputs[0].abspath(env) file=open(infile,'r') code=file.read() file.close() code=code.replace('%','%%') s=m4_re.sub(r'%(\1)s',code) dict=tsk.dict if not dict: names=m4_re.findall(code) for i in names: if not env[i]:i=i.upper() if env[i]and type(env[i])is types.ListType: dict[i]=" ".join(env[i]) else:dict[i]=env[i] file=open(outfile,'w') file.write(s%dict) file.close() if tsk.chmod:os.chmod(outfile,tsk.chmod) return 0 class subst_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_subst(self): Utils.def_attrs(self,fun=subst_func) self.default_install_path=0 lst=self.to_list(self.source) self.dict=getattr(self,'dict',{}) for filename in lst: node=self.path.find_resource(filename) if not node:raise Utils.WafError('cannot find input file %s for processing'%filename) newnode=node.change_ext('') if self.dict and not self.env['DICT_HASH']: self.env=self.env.copy() self.env['DICT_HASH']=hash(str(self.dict)) tsk=self.create_task('copy') tsk.set_inputs(node) tsk.set_outputs(newnode) tsk.fun=self.fun tsk.dict=self.dict tsk.dep_vars=['DICT_HASH'] tsk.install_path=self.install_path tsk.chmod=self.chmod if not tsk.env: tsk.debug() raise Utils.WafError('task without an environment') class cmd_arg(object): def __init__(self,name,template='%s'): self.name=name self.template=template self.node=None class input_file(cmd_arg): def find_node(self,base_path): assert isinstance(base_path,Node.Node) self.node=base_path.find_resource(self.name) if self.node is None: raise Utils.WafError("Input file %s not found in "%(self.name,base_path)) def get_path(self,env,absolute): if absolute: return self.template%self.node.abspath(env) else: return self.template%self.node.srcpath(env) class output_file(cmd_arg): def find_node(self,base_path): assert isinstance(base_path,Node.Node) self.node=base_path.find_or_declare(self.name) if self.node is None: raise Utils.WafError("Output file %s not found in "%(self.name,base_path)) def get_path(self,env,absolute): if absolute: return self.template%self.node.abspath(env) else: return self.template%self.node.bldpath(env) class cmd_dir_arg(cmd_arg): def __init__(self,name,template=None): cmd_arg.__init__(self) self.name=name self.node=None if template is None: self.template='%s' else: self.template=template def find_node(self,base_path): assert isinstance(base_path,Node.Node) self.node=base_path.find_dir(self.name) if self.node is None: raise Utils.WafError("Directory %s not found in "%(self.name,base_path)) class input_dir(cmd_dir_arg): def get_path(self,dummy_env,dummy_absolute): return self.template%self.node.abspath() class output_dir(cmd_dir_arg): def get_path(self,env,dummy_absolute): return self.template%self.node.abspath(env) class command_output(Task.Task): color="BLUE" def __init__(self,env,command,command_node,command_args,stdin,stdout,cwd,os_env,stderr): Task.Task.__init__(self,env,normal=1) assert isinstance(command,(str,Node.Node)) self.command=command self.command_args=command_args self.stdin=stdin self.stdout=stdout self.cwd=cwd self.os_env=os_env self.stderr=stderr if command_node is not None:self.dep_nodes=[command_node] self.dep_vars=[] def run(self): task=self def input_path(node,template): if task.cwd is None: return template%node.bldpath(task.env) else: return template%node.abspath() def output_path(node,template): fun=node.abspath if task.cwd is None:fun=node.bldpath return template%fun(task.env) if isinstance(task.command,Node.Node): argv=[input_path(task.command,'%s')] else: argv=[task.command] for arg in task.command_args: if isinstance(arg,str): argv.append(arg) else: assert isinstance(arg,cmd_arg) argv.append(arg.get_path(task.env,(task.cwd is not None))) if task.stdin: stdin=file(input_path(task.stdin,'%s')) else: stdin=None if task.stdout: stdout=file(output_path(task.stdout,'%s'),"w") else: stdout=None if task.stderr: stderr=file(output_path(task.stderr,'%s'),"w") else: stderr=None if task.cwd is None: cwd=('None (actually %r)'%os.getcwd()) else: cwd=repr(task.cwd) debug("command-output: cwd=%s, stdin=%r, stdout=%r, argv=%r"%(cwd,stdin,stdout,argv)) if task.os_env is None: os_env=os.environ else: os_env=task.os_env command=pproc.Popen(argv,stdin=stdin,stdout=stdout,stderr=stderr,cwd=task.cwd,env=os_env) return command.wait() class cmd_output_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def init_cmd_output(self): Utils.def_attrs(self,stdin=None,stdout=None,stderr=None,command=None,command_is_external=False,argv=[],dependencies=[],dep_vars=[],hidden_inputs=[],hidden_outputs=[],cwd=None,os_env=None) def apply_cmd_output(self): if self.command is None: raise Utils.WafError("command-output missing command") if self.command_is_external: cmd=self.command cmd_node=None else: cmd_node=self.path.find_resource(self.command) assert cmd_node is not None,('''Could not find command '%s' in source tree. Hint: if this is an external command, use command_is_external=True''')%(self.command,) cmd=cmd_node if self.cwd is None: cwd=None else: assert isinstance(cwd,CmdDirArg) self.cwd.find_node(self.path) args=[] inputs=[] outputs=[] for arg in self.argv: if isinstance(arg,cmd_arg): arg.find_node(self.path) if isinstance(arg,input_file): inputs.append(arg.node) if isinstance(arg,output_file): outputs.append(arg.node) if self.stdout is None: stdout=None else: assert isinstance(self.stdout,basestring) stdout=self.path.find_or_declare(self.stdout) if stdout is None: raise Utils.WafError("File %s not found"%(self.stdout,)) outputs.append(stdout) if self.stderr is None: stderr=None else: assert isinstance(self.stderr,basestring) stderr=self.path.find_or_declare(self.stderr) if stderr is None: Params.fatal("File %s not found"%(self.stderr,)) outputs.append(stderr) if self.stdin is None: stdin=None else: assert isinstance(self.stdin,basestring) stdin=self.path.find_resource(self.stdin) if stdin is None: raise Utils.WafError("File %s not found"%(self.stdin,)) inputs.append(stdin) for hidden_input in self.to_list(self.hidden_inputs): node=self.path.find_resource(hidden_input) if node is None: raise Utils.WafError("File %s not found in dir %s"%(hidden_input,self.path)) inputs.append(node) for hidden_output in self.to_list(self.hidden_outputs): node=self.path.find_or_declare(hidden_output) if node is None: raise Utils.WafError("File %s not found in dir %s"%(hidden_output,self.path)) outputs.append(node) if not(inputs or getattr(self,'no_inputs',None)): raise Utils.WafError('command-output objects must have at least one input file or give self.no_inputs') if not(outputs or getattr(self,'no_outputs',None)): raise Utils.WafError('command-output objects must have at least one output file or give self.no_outputs') task=command_output(self.env,cmd,cmd_node,self.argv,stdin,stdout,cwd,self.os_env,stderr) Utils.copy_attrs(self,task,'before after ext_in ext_out',only_if_set=True) self.tasks.append(task) task.inputs=inputs task.outputs=outputs task.dep_vars=self.to_list(self.dep_vars) for dep in self.dependencies: assert dep is not self dep.post() for dep_task in dep.tasks: task.set_run_after(dep_task) if not task.inputs: task.runnable_status=new.instancemethod(runnable_status,task,task.__class__) task.post_run=new.instancemethod(post_run,task,task.__class__) def post_run(self): for x in self.outputs: h=Utils.h_file(x.abspath(self.env)) self.generator.bld.node_sigs[self.env.variant()][x.id]=h def runnable_status(self): return Constants.RUN_ME Task.task_type_from_func('copy',vars=[],func=action_process_file_func) TaskGen.task_gen.classes['command-output']=cmd_output_taskgen taskgen(apply_cmd) feature('cmd')(apply_cmd) taskgen(apply_copy) feature('copy')(apply_copy) taskgen(apply_subst) feature('subst')(apply_subst) taskgen(init_cmd_output) feature('command-output')(init_cmd_output) taskgen(apply_cmd_output) feature('command-output')(apply_cmd_output) after('init_cmd_output')(apply_cmd_output) hotssh-0.2.6+dfsg1/wafadmin/Tools/cxx.py0000644000175000017500000000616711115036226016544 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import TaskGen,Task,Utils from Logs import debug import ccroot from TaskGen import feature,before,extension,after g_cxx_flag_vars=['CXXDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS','RPATH','CXXFLAGS','CCFLAGS','CPPPATH','CPPFLAGS','CXXDEFINES'] EXT_CXX=['.cpp','.cc','.cxx','.C','.c++'] TaskGen.bind_feature('cxx',['apply_core']) g_cxx_type_vars=['CXXFLAGS','LINKFLAGS'] class cxx_taskgen(ccroot.ccroot_abstract): pass def init_cxx(self): if not'cc'in self.features: self.mappings['.c']=TaskGen.task_gen.mappings['.cxx'] self.p_flag_vars=set(self.p_flag_vars).union(g_cxx_flag_vars) self.p_type_vars=set(self.p_type_vars).union(g_cxx_type_vars) if not self.env['CXX_NAME']: raise Utils.WafError("At least one compiler (g++, ..) must be selected") def apply_obj_vars_cxx(self): env=self.env app=env.append_unique cxxpath_st=env['CPPPATH_ST'] for i in env['INC_PATHS']: app('_CXXINCFLAGS',cxxpath_st%i.bldpath(env)) app('_CXXINCFLAGS',cxxpath_st%i.srcpath(env)) for i in env['CPPPATH']: app('_CXXINCFLAGS',cxxpath_st%i) app('_CXXINCFLAGS',cxxpath_st%'.') app('_CXXINCFLAGS',cxxpath_st%self.env.variant()) tmpnode=self.path app('_CXXINCFLAGS',cxxpath_st%tmpnode.bldpath(env)) app('_CXXINCFLAGS',cxxpath_st%tmpnode.srcpath(env)) def apply_defines_cxx(self): self.defines=getattr(self,'defines',[]) lst=self.to_list(self.defines)+self.to_list(self.env['CXXDEFINES']) milst=[] for defi in lst: if not defi in milst: milst.append(defi) libs=self.to_list(self.uselib) for l in libs: val=self.env['CXXDEFINES_'+l] if val:milst+=self.to_list(val) self.env['DEFLINES']=["%s %s"%(x[0],Utils.trimquotes('='.join(x[1:])))for x in[y.split('=')for y in milst]] y=self.env['CXXDEFINES_ST'] self.env['_CXXDEFFLAGS']=[y%x for x in milst] def cxx_hook(self,node): task=self.create_task('cxx') try:obj_ext=self.obj_ext except AttributeError:obj_ext='_%d.o'%self.idx task.defines=self.scanner_defines task.inputs=[node] task.outputs=[node.change_ext(obj_ext)] self.compiled_tasks.append(task) cxx_str='${CXX} ${CXXFLAGS} ${CPPFLAGS} ${_CXXINCFLAGS} ${_CXXDEFFLAGS} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT}' link_str='${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS}' vnum_link_str='${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT[1].bldpath(env)} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS} && ln -sf ${TGT[1].name} ${TGT[0].bldpath(env)}' cls=Task.simple_task_type('cxx',cxx_str,color='GREEN',ext_out='.o',ext_in='.cxx') cls.scan=ccroot.scan cls.vars.append('CXXDEPS') cls=Task.simple_task_type('cxx_link',link_str,color='YELLOW',ext_in='.o') cls.maxjobs=1 cls=Task.simple_task_type('vnum_cxx_link',vnum_link_str,color='CYAN',ext_in='.o') cls.maxjobs=1 TaskGen.declare_order('apply_incpaths','apply_defines_cxx','apply_core','apply_lib_vars','apply_obj_vars_cxx','apply_obj_vars') feature('cxx')(init_cxx) before('apply_type_vars')(init_cxx) after('default_cc')(init_cxx) feature('cxx')(apply_obj_vars_cxx) feature('cxx')(apply_defines_cxx) extension(EXT_CXX)(cxx_hook) hotssh-0.2.6+dfsg1/wafadmin/Tools/config_c.py0000644000175000017500000002707711115036226017514 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,types,imp,cPickle,sys,shlex,shutil from Utils import md5 import Build,Utils,Configure,Task,Options,Logs from Constants import* from Configure import conf,conftest cfg_ver={'atleast-version':'>=','exact-version':'==','max-version':'<=',} def parse_flags(line,uselib,env): lst=shlex.split(line) while lst: x=lst.pop(0) st=x[:2] ot=x[2:] if st=='-I'or st=='/I': if not ot:ot=lst.pop(0) env.append_unique('CPPPATH_'+uselib,ot) elif st=='-D': if not ot:ot=lst.pop(0) env.append_unique('CXXDEFINES_'+uselib,ot) env.append_unique('CCDEFINES_'+uselib,ot) elif st=='-l': if not ot:ot=lst.pop(0) env.append_unique('LIB_'+uselib,ot) elif st=='-L': if not ot:ot=lst.pop(0) env.append_unique('LIBPATH_'+uselib,ot) elif x=='-pthread'or x.startswith('+'): env.append_unique('CCFLAGS_'+uselib,x) env.append_unique('CXXFLAGS_'+uselib,x) env.append_unique('LINKFLAGS_'+uselib,x) elif x.startswith('-std'): env.append_unique('CCFLAGS_'+uselib,x) env.append_unique('LINKFLAGS_'+uselib,x) def validate_cfg(self,kw): if not'path'in kw: kw['path']='pkg-config --silence-errors' if'atleast_pkgconfig_version'in kw: if not'msg'in kw: kw['msg']='Checking for pkg-config version >= %s'%kw['atleast_pkgconfig_version'] return if'modversion'in kw: return for x in cfg_ver.keys(): y=x.replace('-','_') if y in kw: if not'package'in kw: raise ValueError,'%s requires a package'%x if not'msg'in kw: kw['msg']='Checking for %s %s %s'%(kw['package'],cfg_ver[x],kw[y]) return if not'msg'in kw: kw['msg']='Checking for %s flags'%kw['package'] if not'okmsg'in kw: kw['okmsg']='ok' if not'errmsg'in kw: kw['errmsg']='not found' def cmd_and_log(self,cmd): Logs.debug('runner: %s\n'%cmd) if self.log:self.log.write('%s\n'%cmd) return Utils.cmd_output(cmd) def exec_cfg(self,kw): if'atleast_pkgconfig_version'in kw: try: cmd='%s --atleast-pkgconfig-version=%s'%(kw['path'],kw['atleast_pkgconfig_version']) self.cmd_and_log(cmd) except: if not'errmsg'in kw: kw['errmsg']='"pkg-config" could not be found or the version found is too old.' self.fatal(kw['errmsg']) if not'okmsg'in kw: kw['okmsg']='ok' return for x in cfg_ver: y=x.replace('-','_') if y in kw: try: self.cmd_and_log('%s --%s=%s %s'%(kw['path'],x,kw[y],kw['package'])) except: if not'errmsg'in kw: kw['errmsg']='Package "%s (%s %s)" could not be found or the found version is too old.'%(kw['package'],cfg_ver[x],kw[y]) self.fatal(kw['errmsg']) if not'okmsg'in kw: kw['okmsg']='ok' self.define('HAVE_%s'%Utils.quote_define_name(kw.get('uselib_store',kw['package'])),1,0) break if'modversion'in kw: try: version=self.cmd_and_log('%s --modversion %s'%(kw['path'],kw['modversion'])).strip() except ValueError: return'' self.define('%s_VERSION'%Utils.quote_define_name(kw.get('uselib_store',kw['modversion'])),version) return version lst=[kw['path']] for key,val in kw.get('define_variable',{}).iteritems(): lst.append('--define-variable=%s=%s'%(key,val)) lst.append(kw.get('args','')) lst.append(kw['package']) cmd=' '.join(lst) try: ret=self.cmd_and_log(cmd) except: self.fatal("no such package") if not'okmsg'in kw: kw['okmsg']='ok' self.define('HAVE_%s'%Utils.quote_define_name(kw.get('uselib_store',kw['package'])),1,0) parse_flags(ret,kw.get('uselib_store',kw['package'].upper()),kw.get('env',self.env)) return ret def check_cfg(self,*k,**kw): self.validate_cfg(kw) if'msg'in kw: self.check_message_1(kw['msg']) ret=None try: ret=self.exec_cfg(kw) except Configure.ConfigurationError,e: if'errmsg'in kw: self.check_message_2(kw['errmsg'],'YELLOW') if'mandatory'in kw and kw['mandatory']: if Logs.verbose>1: raise else: self.fatal('the configuration failed (see config.log)') else: if'okmsg'in kw: self.check_message_2(kw['okmsg']) return ret simple_c_code='int main() {return 0;}\n' def validate_c(self,kw): if not'env'in kw: kw['env']=self.env.copy() env=kw['env'] if not'compiler'in kw: kw['compiler']='cc' if env['CXX_NAME']and Task.TaskBase.classes.get('cxx',None): kw['compiler']='cxx' if not'type'in kw: kw['type']='program' assert not(kw['type']!='program'and kw.get('execute',0)),'can only execute programs' def to_header(dct): if'header_name'in dct: dct=Utils.to_list(dct['header_name']) return''.join(['#include <%s>\n'%x for x in dct]) return'' if'framework_name'in kw: if not kw.get('header_name'): kw['header_name']=[] if'function_name'in kw: fu=kw['function_name'] if not'msg'in kw: kw['msg']='Checking for function %s'%fu kw['code']=to_header(kw)+'int main(){\nvoid *p;\np=(void*)(%s);\nreturn 0;\n}\n'%fu if not'uselib_store'in kw: kw['uselib_store']=fu.upper() if not'define_name'in kw: kw['define_name']=self.have_define(fu) elif'header_name'in kw: if not'msg'in kw: kw['msg']='Checking for header %s'%kw['header_name'] if'framework_name'in kw: fwkname=kw['framework_name'] fwk='%s/%s.h'%(fwkname,fwkname) if kw.get('remove_dot_h',None): fwk=fwk[:-2] kw['header_name']=Utils.to_list(kw['header_name'])+[fwk] kw['msg']='Checking for framework %s'%fwkname kw['framework']=fwkname l=Utils.to_list(kw['header_name']) assert len(l)>0,'list of headers in header_name is empty' kw['code']=to_header(kw)+simple_c_code if not'uselib_store'in kw: kw['uselib_store']=l[0].upper() if not'define_name'in kw: kw['define_name']=self.have_define(l[0]) if'lib'in kw: if not'msg'in kw: kw['msg']='Checking for library %s'%kw['lib'] if not'uselib_store'in kw: kw['uselib_store']=kw['lib'].upper() if'staticlib'in kw: if not'msg'in kw: kw['msg']='Checking for static library %s'%kw['staticlib'] if not'uselib_store'in kw: kw['uselib_store']=kw['staticlib'].upper() if'fragment'in kw: kw['code']=kw['fragment'] if not'msg'in kw: kw['msg']='Checking for custom code' if not'errmsg'in kw: kw['errmsg']='fail' for(flagsname,flagstype)in[('cxxflags','compiler'),('cflags','compiler'),('linkflags','linker')]: if flagsname in kw: if not'msg'in kw: kw['msg']='Checking for %s flags %s'%(flagstype,kw[flagsname]) if not'errmsg'in kw: kw['errmsg']='fail' if not'execute'in kw: kw['execute']=False if not'errmsg'in kw: kw['errmsg']='not found' if not'okmsg'in kw: kw['okmsg']='ok' if not'code'in kw: kw['code']=simple_c_code if not kw.get('success'):kw['success']=0 assert('msg'in kw) def post_check(self,*k,**kw): def define_or_stuff(): nm=kw['define_name'] if not kw['execute']and not kw.get('define_ret',None): self.define_cond(kw['define_name'],kw['success']is not None) else: self.define(kw['define_name'],kw['success']) if'header_name'in kw: define_or_stuff() elif'function_name'in kw: define_or_stuff() elif'fragment'in kw: if'define_name'in kw: define_or_stuff() if kw['execute']: is_success=kw['success']is not None else: is_success=kw['success']==0 if is_success and'uselib_store'in kw: import cc,cxx for k in set(cc.g_cc_flag_vars).union(cxx.g_cxx_flag_vars): lk=k.lower() if k=='CPPPATH':lk='includes' if k=='CXXDEFINES':lk='defines' if k=='CCDEFINES':lk='defines' if lk in kw: val=kw[lk] if type(val)==types.StringType: val=val.rstrip(os.path.sep) self.env.append_value(k+'_'+kw['uselib_store'],val) def check(self,*k,**kw): self.validate_c(kw) self.check_message_1(kw['msg']) ret=None try: ret=self.run_c_code(*k,**kw) except Configure.ConfigurationError,e: self.check_message_2(kw['errmsg'],'YELLOW') if'mandatory'in kw and kw['mandatory']: if Logs.verbose>1: raise else: self.fatal('the configuration failed (see config.log)') else: self.check_message_2(kw['okmsg']) kw['success']=ret self.post_check(*k,**kw) return ret def run_c_code(self,*k,**kw): if kw['compiler']=='cxx': tp='cxx' test_f_name='test.cpp' else: tp='cc' test_f_name='test.c' dir=os.path.join(self.blddir,'.wscript-trybuild') try: shutil.rmtree(dir) except OSError: pass os.makedirs(dir) bdir=os.path.join(dir,'testbuild') if not os.path.exists(bdir): os.makedirs(bdir) env=kw['env'] dest=open(os.path.join(dir,test_f_name),'w') dest.write(kw['code']) dest.close() back=os.path.abspath('.') bld=Build.BuildContext() bld.log=self.log bld.all_envs.update(self.all_envs) bld.all_envs['default']=env bld.lst_variants=bld.all_envs.keys() bld.load_dirs(dir,bdir) os.chdir(dir) bld.rescan(bld.srcnode) o=bld.new_task_gen(tp,kw['type']) o.source=test_f_name o.target='testprog' for k,v in kw.iteritems(): setattr(o,k,v) self.log.write("==>\n%s\n<==\n"%kw['code']) try: bld.compile() except: ret=Utils.ex_stack() else: ret=0 os.chdir(back) if ret: self.fatal(str(ret)) if kw['execute']: lastprog=o.link_task.outputs[0].abspath(env) if kw['execute']: try: data=Utils.cmd_output('"%s"'%lastprog).strip() except ValueError,e: self.fatal(Utils.ex_stack()) ret=data return ret def check_cxx(self,*k,**kw): kw['compiler']='cxx' return self.check(*k,**kw) def check_cc(self,*k,**kw): kw['compiler']='cc' return self.check(*k,**kw) def define(self,define,value,quote=1): assert define and isinstance(define,str) tbl=self.env[DEFINES]or Utils.ordered_dict() if isinstance(value,str): if quote==1: tbl[define]='"%s"'%str(value) else: tbl[define]=value elif isinstance(value,int): tbl[define]=value else: raise TypeError,'define %r -> %r must be a string or an int'%(define,value) self.env[DEFINES]=tbl self.env[define]=value def undefine(self,define): assert define and isinstance(define,str) tbl=self.env[DEFINES]or Utils.ordered_dict() value=UNDEFINED tbl[define]=value self.env[DEFINES]=tbl self.env[define]=value def define_cond(self,name,value): if value: self.define(name,1) else: self.undefine(name) def is_defined(self,key): defines=self.env[DEFINES] if not defines: return False try: value=defines[key] except KeyError: return False else: return value!=UNDEFINED def get_define(self,define): try:return self.env[DEFINES][define] except KeyError:return None def have_define(self,name): return"HAVE_%s"%Utils.quote_define_name(name) def write_config_header(self,configfile='',env='',guard=''): if not configfile:configfile=WAF_CONFIG_H lst=Utils.split_path(configfile) base=lst[:-1] if not env:env=self.env base=[self.blddir,env.variant()]+base dir=os.path.join(*base) if not os.path.exists(dir): os.makedirs(dir) dir=os.path.join(dir,lst[-1]) self.env.append_value('waf_config_files',os.path.abspath(dir)) waf_guard=guard or'_%s_WAF'%Utils.quote_define_name(configfile) dest=open(dir,'w') dest.write('/* Configuration header created by Waf - do not edit */\n') dest.write('#ifndef %s\n#define %s\n\n'%(waf_guard,waf_guard)) dest.write(self.get_config_header()) if not configfile in self.env['dep_files']: self.env['dep_files']+=[configfile] dest.write('\n#endif /* %s */\n'%waf_guard) dest.close() def get_config_header(self): config_header=[] tbl=self.env[DEFINES]or Utils.ordered_dict() for key in tbl.allkeys: value=tbl[key] if value is None: config_header.append('#define %s'%key) elif value is UNDEFINED: config_header.append('/* #undef %s */'%key) else: config_header.append('#define %s %s'%(key,value)) return"\n".join(config_header) conf(validate_cfg) conf(cmd_and_log) conf(exec_cfg) conf(check_cfg) conf(validate_c) conf(post_check) conf(check) conf(run_c_code) conf(check_cxx) conf(check_cc) conf(define) conf(undefine) conf(define_cond) conf(is_defined) conf(get_define) conf(have_define) conf(write_config_header) conf(get_config_header) hotssh-0.2.6+dfsg1/wafadmin/Tools/compiler_cxx.py0000644000175000017500000000275611115036226020436 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,imp,types,ccroot import optparse import Utils,Configure,Options cxx_compiler={'win32':['msvc','g++'],'cygwin':['g++'],'darwin':['g++'],'aix5':['g++'],'linux':['g++','sunc++'],'sunos':['sunc++','g++'],'irix':['g++'],'hpux':['g++'],'default':['g++']} def __list_possible_compiler(platform): try: return(cxx_compiler[platform]) except KeyError: return(cxx_compiler["default"]) def detect(conf): try:test_for_compiler=Options.options.check_cxx_compiler except AttributeError:raise Configure.ConfigurationError("Add set_options(opt): opt.tool_options('compiler_cxx')") for cxx_compiler in test_for_compiler.split(): conf.check_tool(cxx_compiler) if conf.env['CXX']: conf.check_message("%s"%cxx_compiler,'',True) conf.env["COMPILER_CXX"]="%s"%cxx_compiler return conf.check_message("%s"%cxx_compiler,'',False) conf.env["COMPILER_CXX"]=None def set_options(opt): detected_platform=Options.platform possible_compiler_list=__list_possible_compiler(detected_platform) test_for_compiler=str(" ").join(possible_compiler_list) cxx_compiler_opts=opt.add_option_group("C++ Compiler Options") cxx_compiler_opts.add_option('--check-cxx-compiler',default="%s"%test_for_compiler,help='On this platform (%s) the following C++ Compiler will be checked by default: "%s"'%(detected_platform,test_for_compiler),dest="check_cxx_compiler") for cxx_compiler in test_for_compiler.split(): opt.tool_options('%s'%cxx_compiler,option_group=cxx_compiler_opts) hotssh-0.2.6+dfsg1/wafadmin/Tools/sunc++.py0000644000175000017500000000212111115036226017022 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,optparse import Utils,Options,Configure import ccroot,ar from Configure import conftest def find_sxx(conf): v=conf.env cc=None if v['CXX']:cc=v['CXX'] elif'CXX'in os.environ:cc=os.environ['CXX'] if not cc:cc=conf.find_program('c++',var='CXX') if not cc:conf.fatal('sunc++ was not found') v['CXX']=cc v['CXX_NAME']='sun' def sxx_common_flags(conf): v=conf.env v['CXX_SRC_F']='' v['CXX_TGT_F']='-c -o ' v['CPPPATH_ST']='-I%s' if not v['LINK_CXX']:v['LINK_CXX']=v['CXX'] v['CXXLNK_SRC_F']='' v['CXXLNK_TGT_F']='-o ' v['LIB_ST']='-l%s' v['LIBPATH_ST']='-L%s' v['STATICLIB_ST']='-l%s' v['STATICLIBPATH_ST']='-L%s' v['CXXDEFINES_ST']='-D%s' v['SHLIB_MARKER']='-Bdynamic' v['STATICLIB_MARKER']='-Bstatic' v['program_PATTERN']='%s' v['shlib_CXXFLAGS']=['-Kpic','-DPIC'] v['shlib_LINKFLAGS']=['-G'] v['shlib_PATTERN']='lib%s.so' v['staticlib_LINKFLAGS']=['-Bstatic'] v['staticlib_PATTERN']='lib%s.a' detect=''' find_sxx find_cpp find_ar sxx_common_flags cxx_load_tools cxx_add_flags ''' conftest(find_sxx) conftest(sxx_common_flags) hotssh-0.2.6+dfsg1/wafadmin/Tools/glib2.py0000644000175000017500000000740211105644247016741 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import Task,Utils from TaskGen import taskgen,before,after,feature def add_marshal_file(self,filename,prefix): if not hasattr(self,'marshal_list'): self.marshal_list=[] self.meths.append('process_marshal') self.marshal_list.append((filename,prefix)) def process_marshal(self): for filename,prefix in getattr(self,'marshal_list',[]): node=self.path.find_resource(filename) if not node: raise Utils.WafError('file not found '+filename) header_env=self.env.copy() header_env['GLIB_GENMARSHAL_PREFIX']=prefix header_env['GLIB_GENMARSHAL_MODE']='--header' task=self.create_task('glib_genmarshal',header_env) task.set_inputs(node) task.set_outputs(node.change_ext('.h')) body_env=self.env.copy() body_env['GLIB_GENMARSHAL_PREFIX']=prefix body_env['GLIB_GENMARSHAL_MODE']='--body' task=self.create_task('glib_genmarshal',body_env) task.set_inputs(node) task.set_outputs(node.change_ext('.c')) outnode=node.change_ext('.c') self.allnodes.append(outnode) def add_enums_from_template(self,source='',target='',template='',comments=''): if not hasattr(self,'enums_list'): self.enums_list=[] self.meths.append('process_enums') self.enums_list.append({'source':source,'target':target,'template':template,'file-head':'','file-prod':'','file-tail':'','enum-prod':'','value-head':'','value-prod':'','value-tail':'','comments':comments}) def add_enums(self,source='',target='',file_head='',file_prod='',file_tail='',enum_prod='',value_head='',value_prod='',value_tail='',comments=''): if not hasattr(self,'enums_list'): self.enums_list=[] self.meths.append('process_enums') self.enums_list.append({'source':source,'template':'','target':target,'file-head':file_head,'file-prod':file_prod,'file-tail':file_tail,'enum-prod':enum_prod,'value-head':value_head,'value-prod':value_prod,'value-tail':value_tail,'comments':comments}) def process_enums(self): for enum in getattr(self,'enums_list',[]): env=self.env.copy() task=self.create_task('glib_mkenums',env) inputs=[] source_list=self.to_list(enum['source']) if not source_list: raise Utils.WafError('missing source '+str(enum)) source_list=[self.path.find_resource(k)for k in source_list] inputs+=source_list env['GLIB_MKENUMS_SOURCE']=[k.abspath(env)for k in source_list] if not enum['target']: raise Utils.WafError('missing target '+str(enum)) tgt_node=self.path.find_or_declare(enum['target']) if tgt_node.name.endswith('.c'): self.allnodes.append(tgt_node) env['GLIB_MKENUMS_TARGET']=tgt_node.abspath(env) options=[] if enum['template']: template_node=self.path.find_resource(enum['template']) options.append('--template %s'%(template_node.abspath(env))) inputs.append(template_node) params={'file-head':'--fhead','file-prod':'--fprod','file-tail':'--ftail','enum-prod':'--eprod','value-head':'--vhead','value-prod':'--vprod','value-tail':'--vtail','comments':'--comments'} for param,option in params.iteritems(): if enum[param]: options.append('%s %r'%(option,enum[param])) env['GLIB_MKENUMS_OPTIONS']=' '.join(options) task.set_inputs(inputs) task.set_outputs(tgt_node) Task.simple_task_type('glib_genmarshal','${GLIB_GENMARSHAL} ${SRC} --prefix=${GLIB_GENMARSHAL_PREFIX} ${GLIB_GENMARSHAL_MODE} > ${TGT}',color='BLUE',before='cc') Task.simple_task_type('glib_mkenums','${GLIB_MKENUMS} ${GLIB_MKENUMS_OPTIONS} ${GLIB_MKENUMS_SOURCE} > ${GLIB_MKENUMS_TARGET}',color='PINK',before='cc') def detect(conf): glib_genmarshal=conf.find_program('glib-genmarshal',var='GLIB_GENMARSHAL') mk_enums_tool=conf.find_program('glib-mkenums',var='GLIB_MKENUMS') taskgen(add_marshal_file) taskgen(process_marshal) before('apply_core')(process_marshal) taskgen(add_enums_from_template) taskgen(add_enums) taskgen(process_enums) before('apply_core')(process_enums) hotssh-0.2.6+dfsg1/wafadmin/Tools/preproc.py0000644000175000017500000003317511115036226017413 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import re,sys,os,string,types if __name__=='__main__': sys.path=['.','..']+sys.path import Logs,Build,Utils from Logs import debug,error import traceback class PreprocError(Utils.WafError): pass POPFILE='-' go_absolute=0 standard_includes=['/usr/include'] if sys.platform=="win32": standard_includes=[] use_trigraphs=0 'apply the trigraph rules first' strict_quotes=0 g_optrans={'not':'!','and':'&&','bitand':'&','and_eq':'&=','or':'||','bitor':'|','or_eq':'|=','xor':'^','xor_eq':'^=','compl':'~',} re_lines=re.compile('^[ \t]*(#|%:)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef|pragma)[ \t]*(.*)\r*$',re.IGNORECASE|re.MULTILINE) re_mac=re.compile("^[a-zA-Z_]\w*") re_fun=re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]') re_pragma_once=re.compile('^\s*once\s*',re.IGNORECASE) re_nl=re.compile('\\\\\r*\n',re.MULTILINE) re_cpp=re.compile(r"""(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)""",re.MULTILINE) trig_def=[('??'+a,b)for a,b in zip("=-/!'()<>",r'#~\|^[]{}')] chr_esc={'0':0,'a':7,'b':8,'t':9,'n':10,'f':11,'v':12,'r':13,'\\':92,"'":39} NUM='i' OP='O' IDENT='T' STR='s' CHAR='c' tok_types=[NUM,STR,IDENT,OP] exp_types=[r"""0[xX](?P[a-fA-F0-9]+)(?P[uUlL]*)|L*?'(?P(\\.|[^\\'])+)'|(?P\d+)[Ee](?P[+-]*?\d+)(?P[fFlL]*)|(?P\d*\.\d+)([Ee](?P[+-]*?\d+))?(?P[fFlL]*)|(?P\d+\.\d*)([Ee](?P[+-]*?\d+))?(?P[fFlL]*)|(?P0*)(?P\d+)(?P[uUlL]*)""",r'L?"([^"\\]|\\.)*"',r'[a-zA-Z_]\w*',r'%:%:|<<=|>>=|\.\.\.|<<|<%|<:|<=|>>|>=|\+\+|\+=|--|->|-=|\*=|/=|%:|%=|%>|==|&&|&=|\|\||\|=|\^=|:>|!=|##|[\(\)\{\}\[\]<>\?\|\^\*\+&=:!#;,%/\-\?\~\.]',] re_clexer=re.compile('|'.join(["(?P<%s>%s)"%(name,part)for name,part in zip(tok_types,exp_types)]),re.M) accepted='a' ignored='i' undefined='u' skipped='s' def repl(m): s=m.group(1) if s is not None:return' ' s=m.group(3) if s is None:return'' return s def filter_comments(filename): f=open(filename,"r") code=f.read() f.close() if use_trigraphs: for(a,b)in trig_def:code=code.split(a).join(b) code=re_nl.sub('',code) code=re_cpp.sub(repl,code) return[(m.group(2),m.group(3))for m in re.finditer(re_lines,code)] prec={} ops=['* / %','+ -','<< >>','< <= >= >','== !=','& | ^','&& ||',','] for x in range(len(ops)): syms=ops[x] for u in syms.split(): prec[u]=x def reduce_nums(val_1,val_2,val_op): try:a=0+val_1 except TypeError:a=int(val_1) try:b=0+val_2 except TypeError:b=int(val_2) d=val_op if d=='%':c=a%b elif d=='+':c=a+b elif d=='-':c=a-b elif d=='*':c=a*b elif d=='/':c=a/b elif d=='^':c=a^b elif d=='|':c=a|b elif d=='||':c=int(a or b) elif d=='&':c=a&b elif d=='&&':c=int(a and b) elif d=='==':c=int(a==b) elif d=='!=':c=int(a!=b) elif d=='<=':c=int(a<=b) elif d=='<':c=int(a':c=int(a>b) elif d=='>=':c=int(a>=b) elif d=='^':c=int(a^b) elif d=='<<':c=a<>':c=a>>b else:c=0 return c def get_expr(lst,defs,ban): if not lst:return([],[],[]) (p,v)=lst[0] if p==NUM: return(p,v,lst[1:]) elif p==STR: try: (p2,v2)=lst[1] if p2==STR:return(p,v+v2,lst[2:]) except IndexError:pass return(p,v,lst[1:]) elif p==OP: if v in['+','-','!','~','#']: (p2,v2,lst2)=get_expr(lst[1:],defs,ban) if v=='#': if p2!=IDENT:raise PreprocError,"ident expected %s"%str(lst) return get_expr([(STR,v2)]+lst2,defs,ban) if p2!=NUM:raise PreprocError,"num expected %s"%str(lst) if v=='+':return(p2,v2,lst2) elif v=='-':return(p2,-int(v2),lst2) elif v=='!':return(p2,int(not int(v2)),lst2) elif v=='~':return(p2,~int(v2),lst2) return(p2,v2,lst2) elif v=='(': count_par=0 i=0 for _,v in lst: if v==')': count_par-=1 if count_par==0:break elif v=='(':count_par+=1 i+=1 else: raise PreprocError,"rparen expected %s"%str(lst) ret=process_tokens(lst[1:i],defs,ban) if len(ret)==1: (p,v)=ret[0] return(p,v,lst[i+1:]) else: raise PreprocError,"cannot reduce %s"%str(lst) elif p==IDENT: if len(lst)>1: (p2,v2)=lst[1] if v2=="##": (p3,v3)=lst[2] if p3!=IDENT and p3!=NUM and p3!=OP: raise PreprocError,"%s: ident expected after '##'"%str(lst) return get_expr([(p,v+v3)]+lst[3:],defs,ban) if v.lower()=='defined': (p2,v2)=lst[1] off=2 if v2=='(': (p2,v2)=lst[2] if p2!=IDENT:raise PreprocError,'expected an identifier after a "defined("' (p3,v3)=lst[3] if v3!=')':raise PreprocError,'expected a ")" after a "defined(x"' off=4 elif p2!=IDENT: raise PreprocError,'expected a "(" or an identifier after a defined' x=0 if v2 in defs:x=1 return(NUM,x,lst[off:]) elif not v in defs or v in ban: if"waf_include"in ban:return(p,v,lst[1:]) else:return(NUM,0,lst[1:]) if type(defs[v])is types.StringType: v,k=extract_macro(defs[v]) defs[v]=k macro_def=defs[v] if not macro_def[0]: lst=macro_def[1]+lst[3:] return get_expr(lst,defs,ban) else: params=[] i=1 p2,v2=lst[i] if p2!=OP or v2!='(':raise PreprocError,"invalid function call '%s'"%v one_param=[] count_paren=0 try: while 1: i+=1 p2,v2=lst[i] if p2==OP and count_paren==0: if v2=='(': one_param.append((p2,v2)) count_paren+=1 elif v2==')': if one_param:params.append(one_param) lst=lst[i+1:] break elif v2==',': if not one_param:raise PreprocError,"empty param in funcall %s"%p params.append(one_param) one_param=[] else: one_param.append((p2,v2)) else: one_param.append((p2,v2)) if v2=='(':count_paren+=1 elif v2==')':count_paren-=1 except IndexError,e: raise accu=[] table=macro_def[0] for p2,v2 in macro_def[1]: if p2==IDENT and v2 in table:accu+=params[table[v2]] else: if v2=='__VA_ARGS__': va_toks=[] st=len(macro_def[0]) pt=len(params) for x in params[pt-st+1:]: va_toks.extend(x) va_toks.append((OP,',')) if va_toks:va_toks.pop() if len(accu)>1: (p3,v3)=accu[-1] (p4,v4)=accu[-2] if v3=='##': accu.pop() if v4==','and pt30000:raise PreprocError,"recursion limit exceeded, bailing out" pc=self.parse_cache debug('preproc: reading file %r'%filepath) try: lns=pc[filepath] except KeyError: pass else: self.lines=lns+self.lines return try: lines=filter_comments(filepath) lines.append((POPFILE,'')) pc[filepath]=lines self.lines=lines+self.lines except IOError: raise PreprocError,"could not read the file %s"%filepath except Exception: if Logs.verbose>0: error("parsing %s failed"%filepath) traceback.print_exc() def start(self,node,env): debug('preproc: scanning %s (in %s)'%(node.name,node.parent.name)) self.env=env variant=node.variant(env) self.addlines(node) if env['DEFLINES']: self.lines=[('define',x)for x in env['DEFLINES']]+self.lines while self.lines: (type,line)=self.lines.pop(0) if type==POPFILE: self.currentnode_stack.pop() continue try: self.process_line(type,line) except Exception,ex: if Logs.verbose: error("line parsing failed (%s): %s"%(str(ex),line)) traceback.print_exc() def process_line(self,token,line): ve=Logs.verbose if ve:debug('preproc: line is %s - %s state is %s'%(token,line,self.state)) state=self.state if token in['ifdef','ifndef','if']: state.append(undefined) elif token=='endif': state.pop() if not token in['else','elif','endif']: if skipped in self.state or ignored in self.state: return if token=='if': ret=eval_macro(tokenize(line),self.defs) if ret:state[-1]=accepted else:state[-1]=ignored elif token=='ifdef': m=re_mac.search(line) if m and m.group(0)in self.defs:state[-1]=accepted else:state[-1]=ignored elif token=='ifndef': m=re_mac.search(line) if m and m.group(0)in self.defs:state[-1]=ignored else:state[-1]=accepted elif token=='include'or token=='import': (type,inc)=extract_include(line,self.defs) if inc in self.ban_includes:return if token=='import':self.ban_includes.append(inc) if ve:debug('preproc: include found %s (%s) '%(inc,type)) if type=='"'or not strict_quotes: if not inc in self.deps: self.deps.append(inc) self.tryfind(inc) elif token=='elif': if state[-1]==accepted: state[-1]=skipped elif state[-1]==ignored: if eval_macro(tokenize(line),self.defs): state[-1]=accepted elif token=='else': if state[-1]==accepted:state[-1]=skipped elif state[-1]==ignored:state[-1]=accepted elif token=='define': m=re_mac.search(line) if m: name=m.group(0) if ve:debug('preproc: define %s %s'%(name,line)) self.defs[name]=line else: raise PreprocError,"invalid define line %s"%line elif token=='undef': m=re_mac.search(line) if m and m.group(0)in self.defs: self.defs.__delitem__(m.group(0)) elif token=='pragma': if re_pragma_once.search(line.lower()): self.ban_includes.append(self.curfile) def extract_macro(txt): t=tokenize(txt) if re_fun.search(txt): p,name=t[0] p,v=t[1] if p!=OP:raise PreprocError,"expected open parenthesis" i=1 pindex=0 params={} prev='(' while 1: i+=1 p,v=t[i] if prev=='(': if p==IDENT: params[v]=pindex pindex+=1 prev=p elif p==OP and v==')': break else: raise PreprocError,"unexpected token" elif prev==IDENT: if p==OP and v==',': prev=v elif p==OP and v==')': break else: raise PreprocError,"comma or ... expected" elif prev==',': if p==IDENT: params[v]=pindex pindex+=1 prev=p elif p==OP and v=='...': raise PreprocError,"not implemented" else: raise PreprocError,"comma or ... expected" elif prev=='...': raise PreprocError,"not implemented" else: raise PreprocError,"unexpected else" return(name,[params,t[i+1:]]) else: (p,v)=t[0] return(v,[[],t[1:]]) re_include=re.compile('^\s*(<(?P.*)>|"(?P.*)")') def extract_include(txt,defs): m=re_include.search(txt) if m: if m.group('a'):return'<',m.group('a') if m.group('b'):return'"',m.group('b') tokens=tokenize(txt) tokens=process_tokens(tokens,defs,['waf_include']) p,v=tokens[0] if p!=STR:raise PreprocError,"could not parse include %s"%txt return('"',v) def parse_char(txt): if not txt:raise PreprocError,"attempted to parse a null char" if txt[0]!='\\': return ord(txt) c=txt[1] if c=='x': if len(txt)==4 and txt[3]in string.hexdigits:return int(txt[2:],16) return int(txt[2:],16) elif c.isdigit(): if c=='0'and len(txt)==2:return 0 for i in 3,2,1: if len(txt)>i and txt[1:1+i].isdigit(): return(1+i,int(txt[1:1+i],8)) else: try:return chr_esc[c] except KeyError:raise PreprocError,"could not parse char literal '%s'"%txt def tokenize(s): ret=[] for match in re_clexer.finditer(s): m=match.group for name in tok_types: v=m(name) if v: if name==IDENT: try:v=g_optrans[v];name=OP except KeyError: if v.lower()=="true": v=1 name=NUM elif v.lower()=="false": v=0 name=NUM elif name==NUM: if m('oct'):v=int(v,8) elif m('hex'):v=int(m('hex'),16) elif m('n0'):v=m('n0') else: v=m('char') if v:v=parse_char(v) else:v=m('n2')or m('n4') elif name==OP: if v=='%:':v='#' elif v=='%:%:':v='##' ret.append((name,v)) break return ret hotssh-0.2.6+dfsg1/wafadmin/Tools/lua.py0000644000175000017500000000066211075216572016526 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import TaskGen from TaskGen import taskgen,feature TaskGen.declare_chain(name='luac',action='${LUAC} -s -o ${TGT} ${SRC}',ext_in='.lua',ext_out='.luac',reentrant=0,install='LUADIR',) def init_lua(self): self.default_chmod=0755 def detect(conf): luac=conf.find_program('luac',var='LUAC') if not luac:conf.fatal('cannot find the compiler "luac"') taskgen(init_lua) feature('lua')(init_lua) hotssh-0.2.6+dfsg1/wafadmin/Tools/cc.pyc0000644000175000017500000001115411777064501016475 0ustar javijavi <4Ic @sHddlZejdkr.ddlmZnddlZddlZddlZddlZddl m Z ddl Z ddlm Z m Z mZmZdddd d d d d ddddg ZdgZejddgdd gZde jfdYZdZdZdZdZdZdZdZejdeddd d!dZe je_ej j!dejd"ed#d$d!d Zd%e_"ejd&ed#d$d!d Zd%e_"ej#d'd(dd)d*d+e dee d,eed-ee dee deeeedS(.iNi(tSet(tdebug(tfeaturetbeforet extensiontaftertCCDEPSt FRAMEWORKt FRAMEWORKPATHt STATICLIBtLIBtLIBPATHt LINKFLAGStRPATHtCCFLAGStCPPPATHtCPPFLAGSt CCDEFINESs.ctcct apply_coret cc_taskgencBseZRS((t__name__t __module__(((sp/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/cc.pyR scCsYt|jjt|_t|jjt|_|jdsUtjdndS(NtCC_NAMEs0At least one compiler (gcc, ..) must be selected( tsett p_flag_varstuniontg_cc_flag_varst p_type_varstg_cc_type_varstenvtUtilstWafError(tself((sp/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/cc.pytinit_ccs cCs|j}|j}|d}xF|dD]:}|d||j||d||j|q'Wx#|dD]}|d||qpW|d|d|d||j|j}|d||j||d||j|dS(Nt CPPPATH_STt INC_PATHSt _CCINCFLAGSRt.(Rt append_uniquetbldpathtsrcpathtvarianttpath(R!Rtappt cpppath_sttittmpnode((sp/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/cc.pytapply_obj_vars_ccs    c CsStj}t|dg|_|j|j|j|jd}g}x*|D]"}||krQ|j|qQqQW|j|j}x2|D]*}|jd|}|r||7}qqWgg|D]}|jd^qD]0} d| dt j dj | df^q|jd<|jd }g|D]} || ^q2|jd s@ 0 "*      !   hotssh-0.2.6+dfsg1/wafadmin/Tools/python.py0000644000175000017500000002436511115036226017263 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys import TaskGen,Utils,Utils,Runner,Options,Build from Logs import debug,warn from TaskGen import extension,taskgen,before,after,feature from Configure import conf import pproc EXT_PY=['.py'] def init_pyext(self): self.default_install_path='${PYTHONDIR}' self.uselib=self.to_list(getattr(self,'uselib','')) if not'PYEXT'in self.uselib: self.uselib.append('PYEXT') self.env['MACBUNDLE']=True def pyext_shlib_ext(self): self.env['shlib_PATTERN']=self.env['pyext_PATTERN'] def init_pyembed(self): self.uselib=self.to_list(getattr(self,'uselib','')) if not'PYEMBED'in self.uselib: self.uselib.append('PYEMBED') TaskGen.bind_feature('py',['apply_core']) def process_py(self,node): if Options.is_install and self.install_path: if not hasattr(self,'_py_installed_files'): self._py_installed_files=[] installed_files=Build.bld.install_files(self.install_path,node.abspath(self.env),self.env,self.chmod) self._py_installed_files.extend(installed_files) def byte_compile_py(self): if Options.is_install and self.install_path: installed_files=self._py_installed_files if not installed_files: return if Options.commands['uninstall']: print"* removing byte compiled python files" for fname in installed_files: try: os.remove(fname+'c') except OSError: pass try: os.remove(fname+'o') except OSError: pass if Options.commands['install']: if self.env['PYC']or self.env['PYO']: print"* byte compiling python files" if self.env['PYC']: program=(""" import sys, py_compile for pyfile in sys.argv[1:]: py_compile.compile(pyfile, pyfile + 'c') """) argv=[self.env['PYTHON'],"-c",program] argv.extend(installed_files) retval=pproc.Popen(argv).wait() if retval: raise Utils.WafError("bytecode compilation failed") if self.env['PYO']: program=(""" import sys, py_compile for pyfile in sys.argv[1:]: py_compile.compile(pyfile, pyfile + 'o') """) argv=[self.env['PYTHON'],self.env['PYFLAGS_OPT'],"-c",program] argv.extend(installed_files) retval=pproc.Popen(argv).wait() if retval: raise Utils.WafError("bytecode compilation failed") class py_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def init_py(self): self.default_install_path='${PYTHONDIR}' def _get_python_variables(python_exe,variables,imports=['import sys']): program=list(imports) program.append('') for v in variables: program.append("print repr(%s)"%v) proc=pproc.Popen([python_exe,"-c",'\n'.join(program)],stdout=pproc.PIPE) output=proc.communicate()[0].split("\n") if proc.returncode: if Logs.verbose: warn("Python program to extract python configuration variables failed:\n%s"%'\n'.join(["line %03i: %s"%(lineno+1,line)for lineno,line in enumerate(program)])) raise ValueError return_values=[] for s in output: s=s.strip() if not s: continue if s=='None': return_values.append(None) elif s[0]=="'"and s[-1]=="'": return_values.append(s[1:-1]) elif s[0].isdigit(): return_values.append(int(s)) else:break return return_values def check_python_headers(conf): env=conf.env python=env['PYTHON'] assert python,("python is %r !"%(python,)) if Options.platform=='darwin': conf.check_tool('osx') try: v='prefix SO SYSLIBS SHLIBS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED'.split() (python_prefix,python_SO,python_SYSLIBS,python_SHLIBS,python_LIBDIR,python_LIBPL,INCLUDEPY,Py_ENABLE_SHARED)=_get_python_variables(python,["get_config_var('%s')"%x for x in v],['from distutils.sysconfig import get_config_var']) except ValueError: conf.fatal("Python development headers not found (-v for details).") conf.log.write("""Configuration returned from %r: python_prefix = %r python_SO = %r python_SYSLIBS = %r python_SHLIBS = %r python_LIBDIR = %r python_LIBPL = %r INCLUDEPY = %r Py_ENABLE_SHARED = %r """%(python,python_prefix,python_SO,python_SYSLIBS,python_SHLIBS,python_LIBDIR,python_LIBPL,INCLUDEPY,Py_ENABLE_SHARED)) env['pyext_PATTERN']='%s'+python_SO if python_SYSLIBS is not None: for lib in python_SYSLIBS.split(): if lib.startswith('-l'): lib=lib[2:] env.append_value('LIB_PYEMBED',lib) if python_SHLIBS is not None: for lib in python_SHLIBS.split(): if lib.startswith('-l'): lib=lib[2:] env.append_value('LIB_PYEMBED',lib) code=''' #ifdef __cplusplus extern "C" { #endif void Py_Initialize(void); void Py_Finalize(void); #ifdef __cplusplus } #endif int main(int argc, char *argv[]) { Py_Initialize(); Py_Finalize(); return 0; } ''' result=1 name='python'+env['PYTHON_VERSION'] if python_LIBDIR is not None: path=[python_LIBDIR] result=conf.check(lib=name,uselib='PYEMBED',libpath=path) if result and python_LIBPL is not None: path=[python_LIBPL] result=conf.check(lib=name,uselib='PYEMBED',libpath=path) if result: path=[os.path.join(python_prefix,"libs")] name='python'+env['PYTHON_VERSION'].replace('.','') result=conf.check(lib=name,uselib='PYEMBED',libpath=path) if not result: env['LIBPATH_PYEMBED']=path env.append_value('LIB_PYEMBED',name) if(sys.platform=='win32'or sys.platform.startswith('os2')or sys.platform=='darwin'or Py_ENABLE_SHARED): env['LIBPATH_PYEXT']=env['LIBPATH_PYEMBED'] env['LIB_PYEXT']=env['LIB_PYEMBED'] python_config=conf.find_program('python%s-config'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') if not python_config: python_config=conf.find_program('python-config-%s'%('.'.join(env['PYTHON_VERSION'].split('.')[:2])),var='PYTHON_CONFIG') includes=[] if python_config: for incstr in os.popen("%s %s --includes"%(python,python_config)).readline().strip().split(): if(incstr.startswith('-I')or incstr.startswith('/I')): incstr=incstr[2:] if incstr not in includes: includes.append(incstr) conf.log.write("Include path for Python extensions ""(found via python-config --includes): %r\n"%(includes,)) env['CPPPATH_PYEXT']=includes env['CPPPATH_PYEMBED']=includes else: conf.log.write("Include path for Python extensions ""(found via distutils module): %r\n"%(INCLUDEPY,)) env['CPPPATH_PYEXT']=[INCLUDEPY] env['CPPPATH_PYEMBED']=[INCLUDEPY] if env['CC']: version=os.popen("%s --version"%env['CC']).readline() if'(GCC)'in version or'gcc'in version: env.append_value('CCFLAGS_PYEMBED','-fno-strict-aliasing') env.append_value('CCFLAGS_PYEXT','-fno-strict-aliasing') if env['CXX']: version=os.popen("%s --version"%env['CXX']).readline() if'(GCC)'in version or'g++'in version: env.append_value('CXXFLAGS_PYEMBED','-fno-strict-aliasing') env.append_value('CXXFLAGS_PYEXT','-fno-strict-aliasing') test_env=env.copy() test_env.append_value('CPPPATH',env['CPPPATH_PYEMBED']) test_env.append_value('LIBPATH',env['LIBPATH_PYEMBED']) test_env.append_value('LIB',env['LIB_PYEMBED']) test_env.append_value('CXXFLAGS',env['CXXFLAGS_PYEMBED']) test_env.append_value('CCFLAGS',env['CCFLAGS_PYEMBED']) conf.check(header_name='Python.h',define_name='HAVE_PYTHON_H',env=test_env,fragment='''#include \nint main(int argc, char *argv[]) { Py_Initialize(); Py_Finalize(); return 0; }\n''',errmsg='Could not find the python development headers',mandatory=1) def check_python_version(conf,minver=None): assert minver is None or isinstance(minver,tuple) python=conf.env['PYTHON'] assert python,("python is %r !"%(python,)) cmd=[python,"-c","import sys\nfor x in sys.version_info: print str(x)"] debug('python: Running python command %r'%cmd) proc=pproc.Popen(cmd,stdout=pproc.PIPE) lines=proc.communicate()[0].split() assert len(lines)==5,"found %i lines, expected 5: %r"%(len(lines),lines) pyver_tuple=(int(lines[0]),int(lines[1]),int(lines[2]),lines[3],int(lines[4])) result=(minver is None)or(pyver_tuple>=minver) if result: pyver='.'.join([str(x)for x in pyver_tuple[:2]]) conf.env['PYTHON_VERSION']=pyver if'PYTHONDIR'in os.environ: pydir=os.environ['PYTHONDIR'] else: if sys.platform=='win32': (python_LIBDEST,)=_get_python_variables(python,["get_config_var('LIBDEST')"],['from distutils.sysconfig import get_config_var']) else: python_LIBDEST=None if python_LIBDEST is None: if conf.env['LIBDIR']: python_LIBDEST=os.path.join(conf.env['LIBDIR'],"python"+pyver) else: python_LIBDEST=os.path.join(conf.env['PREFIX'],"lib","python"+pyver) pydir=os.path.join(python_LIBDEST,"site-packages") if hasattr(conf,'define'): conf.define('PYTHONDIR',pydir) conf.env['PYTHONDIR']=pydir pyver_full='.'.join(map(str,pyver_tuple[:3])) if minver is None: conf.check_message_custom('Python version','',pyver_full) else: minver_str='.'.join(map(str,minver)) conf.check_message('Python version',">= %s"%(minver_str,),result,option=pyver_full) if not result: conf.fatal("Python too old.") def check_python_module(conf,module_name): result=not pproc.Popen([conf.env['PYTHON'],"-c","import %s"%module_name],stderr=pproc.PIPE,stdout=pproc.PIPE).wait() conf.check_message('Python module',module_name,result) if not result: conf.fatal("Python module not found.") def detect(conf): python=conf.find_program('python',var='PYTHON') if not python:return v=conf.env v['PYCMD']='"import sys, py_compile;py_compile.compile(sys.argv[1], sys.argv[2])"' v['PYFLAGS']='' v['PYFLAGS_OPT']='-O' v['PYC']=getattr(Options.options,'pyc',1) v['PYO']=getattr(Options.options,'pyo',1) def set_options(opt): opt.add_option('--nopyc',action='store_false',default=1,help='Do not install bytecode compiled .pyc files (configuration) [Default:install]',dest='pyc') opt.add_option('--nopyo',action='store_false',default=1,help='Do not install optimised compiled .pyo files (configuration) [Default:install]',dest='pyo') taskgen(init_pyext) before('apply_incpaths')(init_pyext) feature('pyext')(init_pyext) before('apply_bundle')(init_pyext) taskgen(pyext_shlib_ext) before('apply_link')(pyext_shlib_ext) before('apply_lib_vars')(pyext_shlib_ext) after('apply_bundle')(pyext_shlib_ext) feature('pyext')(pyext_shlib_ext) taskgen(init_pyembed) before('apply_incpaths')(init_pyembed) feature('pyembed')(init_pyembed) extension(EXT_PY)(process_py) feature('py')(byte_compile_py) after('install')(byte_compile_py) taskgen(init_py) before('apply_core')(init_py) after('vars_target_cprogram')(init_py) after('vars_target_cstaticlib')(init_py) feature('py')(init_py) conf(check_python_headers) conf(check_python_version) conf(check_python_module) hotssh-0.2.6+dfsg1/wafadmin/Tools/bison.py0000644000175000017500000000110311075216572017046 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import TaskGen def decide_ext(self,node): c_ext='.tab.c' if node.name.endswith('.yc'):c_ext='.tab.cc' if'-d'in self.env['BISONFLAGS']: return[c_ext,c_ext.replace('c','h')] else: return c_ext TaskGen.declare_chain(name='bison',action='cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}',ext_in='.y .yc .yy',decider=decide_ext,before='cc cxx',) def detect(conf): bison=conf.find_program('bison',var='BISON') if not bison:conf.fatal("bison was not found") v=conf.env v['BISONFLAGS']='-d' hotssh-0.2.6+dfsg1/wafadmin/Tools/nasm.py0000644000175000017500000000236311115036226016672 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os import TaskGen,Task from TaskGen import taskgen,before,extension nasm_str='${NASM} ${NASM_FLAGS} ${NASM_INCLUDES} ${SRC} -o ${TGT}' EXT_NASM=['.s','.S','.asm','.ASM','.spp','.SPP'] def apply_nasm_vars(self): if hasattr(self,'nasm_flags'): for flag in self.to_list(self.nasm_flags): self.env.append_value('NASM_FLAGS',flag) if hasattr(self,'includes'): for inc in self.to_list(self.includes): node=self.path.find_dir(inc) if not node: raise ValueError,"cannot find the dir"+inc self.env.append_value('NASM_INCLUDES','-I %s'%node.srcpath(self.env)) self.env.append_value('NASM_INCLUDES','-I %s'%node.bldpath(self.env)) def nasm_file(self,node): o_node=node.change_ext('.o') task=self.create_task('nasm') task.set_inputs(node) task.set_outputs(o_node) self.compiled_tasks.append(task) self.meths.append('apply_nasm_vars') Task.simple_task_type('nasm',nasm_str,color='BLUE',ext_out='.o') def detect(conf): nasm=conf.find_program('nasm',var='NASM') if not nasm:nasm=conf.find_program('yasm',var='NASM') if not nasm:conf.fatal('could not find nasm (or yasm), install it or set PATH env var') taskgen(apply_nasm_vars) before('apply_link')(apply_nasm_vars) extension(EXT_NASM)(nasm_file) hotssh-0.2.6+dfsg1/wafadmin/Tools/tex.py0000644000175000017500000001317411105644247016545 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,re import Utils,TaskGen,Task,Runner,Build from TaskGen import taskgen,feature from Logs import error,warn,debug re_tex=re.compile(r'\\(?Pinclude|input|import|bringin){(?P[^{}]*)}',re.M) def scan(self): node=self.inputs[0] env=self.env nodes=[] names=[] if not node:return(nodes,names) fi=open(node.abspath(env),'r') code=fi.read() fi.close() curdirnode=self.curdirnode abs=curdirnode.abspath() for match in re_tex.finditer(code): path=match.group('file') if path: for k in['','.tex','.ltx']: debug('tex: trying %s%s'%(path,k)) try: os.stat(abs+os.sep+path+k) except OSError: continue found=path+k node=curdirnode.find_resource(found) if node: nodes.append(node) else: debug('tex: could not find %s'%path) names.append(path) debug("tex: found the following : %s and names %s"%(nodes,names)) return(nodes,names) g_bibtex_re=re.compile('bibdata',re.M) def tex_build(task,command='LATEX'): env=task.env bld=task.generator.bld com='%s %s'%(env[command],env.get_flat(command+'FLAGS')) if not env['PROMPT_LATEX']:com="%s %s"%(com,'-interaction=batchmode') node=task.inputs[0] reldir=node.bld_dir(env) srcfile=node.srcpath(env) lst=[] for c in Utils.split_path(reldir): if c:lst.append('..') sr=os.path.join(*(lst+[srcfile])) sr2=os.path.join(*(lst+[node.parent.srcpath(env)])) aux_node=node.change_ext('.aux') idx_node=node.change_ext('.idx') hash='' old_hash='' nm=aux_node.name docuname=nm[:len(nm)-4] latex_compile_cmd='cd %s && TEXINPUTS=%s:$TEXINPUTS %s %s'%(reldir,sr2,com,sr) warn('first pass on %s'%command) ret=bld.exec_command(latex_compile_cmd) if ret:return ret try: file=open(aux_node.abspath(env),'r') ct=file.read() file.close() except(OSError,IOError): error('error bibtex scan') else: fo=g_bibtex_re.findall(ct) if fo: bibtex_compile_cmd='cd %s && BIBINPUTS=%s:$BIBINPUTS %s %s'%(reldir,sr2,env['BIBTEX'],docuname) warn('calling bibtex') ret=bld.exec_command(bibtex_compile_cmd) if ret: error('error when calling bibtex %s'%bibtex_compile_cmd) return ret try: idx_path=idx_node.abspath(env) os.stat(idx_path) except OSError: error('error file.idx scan') else: makeindex_compile_cmd='cd %s && %s %s'%(reldir,env['MAKEINDEX'],idx_path) warn('calling makeindex') ret=bld.exec_command(makeindex_compile_cmd) if ret: error('error when calling makeindex %s'%makeindex_compile_cmd) return ret i=0 while i<10: i+=1 old_hash=hash try: hash=Utils.h_file(aux_node.abspath(env)) except KeyError: error('could not read aux.h -> %s'%aux_node.abspath(env)) pass if hash and hash==old_hash:break warn('calling %s'%command) ret=bld.exec_command(latex_compile_cmd) if ret: error('error when calling %s %s'%(command,latex_compile_cmd)) return ret return 0 latex_vardeps=['LATEX','LATEXFLAGS'] def latex_build(task): return tex_build(task,'LATEX') pdflatex_vardeps=['PDFLATEX','PDFLATEXFLAGS'] def pdflatex_build(task): return tex_build(task,'PDFLATEX') class tex_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) def apply_tex(self): if not self.type in['latex','pdflatex']: raise Utils.WafError('type %s not supported for texobj'%type) tree=Build.bld outs=Utils.to_list(getattr(self,'outs',[])) self.env['PROMPT_LATEX']=getattr(self,'prompt',1) deps_lst=[] if getattr(self,'deps',None): deps=self.to_list(self.deps) for filename in deps: n=self.path.find_resource(filename) if not n in deps_lst:deps_lst.append(n) for filename in self.source.split(): base,ext=os.path.splitext(filename) node=self.path.find_resource(filename) if not node:raise Utils.WafError('cannot find %s'%filename) if self.type=='latex': task=self.create_task('latex') task.set_inputs(node) task.set_outputs(node.change_ext('.dvi')) elif self.type=='pdflatex': task=self.create_task('pdflatex') task.set_inputs(node) task.set_outputs(node.change_ext('.pdf')) else: raise Utils.WafError('no type or invalid type given in tex object (should be latex or pdflatex)') task.env=self.env task.curdirnode=self.path if deps_lst: variant=node.variant(self.env) try: lst=tree.node_deps[task.unique_id()] for n in deps_lst: if not n in lst: lst.append(n) except KeyError: tree.node_deps[task.unique_id()]=deps_lst if self.type=='latex': if'ps'in outs: pstask=self.create_task('dvips') pstask.set_inputs(task.outputs) pstask.set_outputs(node.change_ext('.ps')) if'pdf'in outs: pdftask=self.create_task('dvipdf') pdftask.set_inputs(task.outputs) pdftask.set_outputs(node.change_ext('.pdf')) elif self.type=='pdflatex': if'ps'in outs: pstask=self.create_task('pdf2ps') pstask.set_inputs(task.outputs) pstask.set_outputs(node.change_ext('.ps')) def detect(conf): v=conf.env for p in'tex latex pdflatex bibtex dvips dvipdf ps2pdf makeindex pdf2ps'.split(): conf.find_program(p,var=p.upper()) v[p.upper()+'FLAGS']='' v['DVIPSFLAGS']='-Ppdf' b=Task.simple_task_type b('tex','${TEX} ${TEXFLAGS} ${SRC}',color='BLUE') b('bibtex','${BIBTEX} ${BIBTEXFLAGS} ${SRC}',color='BLUE') b('dvips','${DVIPS} ${DVIPSFLAGS} ${SRC} -o ${TGT}',color='BLUE',after="latex pdflatex tex bibtex") b('dvipdf','${DVIPDF} ${DVIPDFFLAGS} ${SRC} ${TGT}',color='BLUE',after="latex pdflatex tex bibtex") b('pdf2ps','${PDF2PS} ${PDF2PSFLAGS} ${SRC} ${TGT}',color='BLUE',after="dvipdf pdflatex") b=Task.task_type_from_func cls=b('latex',latex_build,vars=latex_vardeps) cls.scan=scan cls=b('pdflatex',pdflatex_build,vars=pdflatex_vardeps) cls.scan=scan taskgen(apply_tex) feature('tex')(apply_tex) hotssh-0.2.6+dfsg1/wafadmin/Tools/intltool.py0000644000175000017500000000613211115036226017576 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,re import TaskGen,Task,Utils,Runner,Options,Build import cc from Logs import error class intltool_in_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) self.source='' self.flags='' self.podir='po' self.intlcache='.intlcache' self.tasks=[] def apply(self): self.env=self.env.copy() tree=Build.bld for i in self.to_list(self.source): node=self.path.find_resource(i) podirnode=self.path.find_dir(self.podir) self.env['INTLCACHE']=os.path.join(self.path.bldpath(self.env),self.podir,self.intlcache) self.env['INTLPODIR']=podirnode.srcpath(self.env) self.env['INTLFLAGS']=self.flags task=self.create_task('intltool') task.set_inputs(node) task.set_outputs(node.change_ext('')) task.install_path=self.install_path class intltool_po_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) self.default_install_path='${LOCALEDIR}' self.appname=kw.get('appname','set_your_app_name') self.podir='' self.tasks=[] def apply(self): def install_translation(task): out=task.outputs[0] filename=out.name (langname,ext)=os.path.splitext(filename) inst_file=langname+os.sep+'LC_MESSAGES'+os.sep+self.appname+'.mo' Build.bld.install_as(os.path.join(self.install_path,inst_file),out.abspath(self.env),chmod=self.chmod) linguas=self.path.find_resource(os.path.join(self.podir,'LINGUAS')) if linguas: file=open(linguas.abspath()) langs=[] for line in file.readlines(): if not line.startswith('#'): langs+=line.split() file.close() re_linguas=re.compile('[-a-zA-Z_@.]+') for lang in langs: if re_linguas.match(lang): node=self.path.find_resource(os.path.join(self.podir,re_linguas.match(lang).group()+'.po')) task=self.create_task('po') task.set_inputs(node) task.set_outputs(node.change_ext('.mo')) if Options.is_install:task.install=install_translation else: Utils.pprint('RED',"Error no LINGUAS file found in po directory") Task.simple_task_type('po','${POCOM} -o ${TGT} ${SRC}',color='BLUE') Task.simple_task_type('intltool','${INTLTOOL} ${INTLFLAGS} -q -u -c ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}',color='BLUE',after="cc_link cxx_link") def detect(conf): pocom=conf.find_program('msgfmt') if not pocom: conf.fatal('The program msgfmt (gettext) is mandatory!') conf.env['POCOM']=pocom intltool=conf.find_program('intltool-merge') if not intltool: conf.fatal('The program intltool-merge (intltool, gettext-devel) is mandatory!') conf.env['INTLTOOL']=intltool def getstr(varname): return getattr(Options.options,varname,'') prefix=conf.env['PREFIX'] datadir=getstr('datadir') if not datadir:datadir=os.path.join(prefix,'share') conf.define('LOCALEDIR',os.path.join(datadir,'locale')) conf.define('DATADIR',datadir) conf.check(header_name='locale.h') def set_options(opt): opt.add_option('--want-rpath',type='int',default=1,dest='want_rpath',help='set rpath to 1 or 0 [Default 1]') opt.add_option('--datadir',type='string',default='',dest='datadir',help='read-only application data') hotssh-0.2.6+dfsg1/wafadmin/Tools/ocaml.py0000644000175000017500000002101411115036226017021 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,re import TaskGen,Utils,Task,Build from Logs import error from TaskGen import taskgen,feature,before,after,extension EXT_MLL=['.mll'] EXT_MLY=['.mly'] EXT_MLI=['.mli'] EXT_MLC=['.c'] EXT_ML=['.ml'] open_re=re.compile('^\s*open\s+([a-zA-Z]+)(;;){0,1}$',re.M) foo=re.compile(r"""(\(\*)|(\*\))|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^()*"'\\]*)""",re.M) def filter_comments(txt): meh=[0] def repl(m): if m.group(1):meh[0]+=1 elif m.group(2):meh[0]-=1 elif not meh[0]:return m.group(0) return'' return foo.sub(repl,txt) def scan(self): node=self.inputs[0] code=filter_comments(node.read(self.env)) global open_re names=[] import_iterator=open_re.finditer(code) if import_iterator: for import_match in import_iterator: names.append(import_match.group(1)) found_lst=[] raw_lst=[] for name in names: nd=None for x in self.incpaths: nd=x.find_resource(name.lower()+'.ml') if not nd:nd=x.find_resource(name+'.ml') if nd: found_lst.append(nd) break else: raw_lst.append(name) return(found_lst,raw_lst) native_lst=['native','all','c_object'] bytecode_lst=['bytecode','all'] class ocaml_taskgen(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) TaskGen.bind_feature('ocaml','apply_core') def init_ml(self): Utils.def_attrs(self,type='all',incpaths_lst=[],bld_incpaths_lst=[],mlltasks=[],mlytasks=[],mlitasks=[],native_tasks=[],bytecode_tasks=[],linktasks=[],bytecode_env=None,native_env=None,compiled_tasks=[],includes='',uselib='',out_nodes=[],are_deps_set=0) def init_envs_ml(self): self.islibrary=getattr(self,'islibrary',False) global native_lst,bytecode_lst self.native_env=None if self.type in native_lst: self.native_env=self.env.copy() if self.islibrary:self.native_env['OCALINKFLAGS']='-a' self.bytecode_env=None if self.type in bytecode_lst: self.bytecode_env=self.env.copy() if self.islibrary:self.bytecode_env['OCALINKFLAGS']='-a' if self.type=='c_object': self.native_env.append_unique('OCALINKFLAGS_OPT',' -output-obj') def apply_incpaths_ml(self): inc_lst=self.includes.split() lst=self.incpaths_lst tree=Build.bld for dir in inc_lst: node=self.path.find_dir(dir) if not node: error("node not found: "+str(dir)) continue Build.bld.rescan(node) if not node in lst:lst.append(node) self.bld_incpaths_lst.append(node) def apply_vars_ml(self): for i in self.incpaths_lst: if self.bytecode_env: self.bytecode_env.append_value('OCAMLPATH','-I %s'%i.srcpath(self.env)) self.bytecode_env.append_value('OCAMLPATH','-I %s'%i.bldpath(self.env)) if self.native_env: self.native_env.append_value('OCAMLPATH','-I %s'%i.bldpath(self.env)) self.native_env.append_value('OCAMLPATH','-I %s'%i.srcpath(self.env)) varnames=['INCLUDES','OCAMLFLAGS','OCALINKFLAGS','OCALINKFLAGS_OPT'] for name in self.uselib.split(): for vname in varnames: cnt=self.env[vname+'_'+name] if cnt: if self.bytecode_env:self.bytecode_env.append_value(vname,cnt) if self.native_env:self.native_env.append_value(vname,cnt) def apply_link_ml(self): if self.bytecode_env: ext=self.islibrary and'.cma'or'.run' linktask=self.create_task('ocalink') linktask.bytecode=1 linktask.set_outputs(self.path.find_or_declare(self.target+ext)) linktask.obj=self linktask.env=self.bytecode_env self.linktasks.append(linktask) if self.native_env: if self.type=='c_object':ext='.o' elif self.islibrary:ext='.cmxa' else:ext='' linktask=self.create_task('ocalinkx') linktask.set_outputs(self.path.find_or_declare(self.target+ext)) linktask.obj=self linktask.env=self.native_env self.linktasks.append(linktask) self.out_nodes+=linktask.outputs if self.type=='c_object':self.compiled_tasks.append(linktask) def mll_hook(self,node): mll_task=self.create_task('ocamllex',self.native_env) mll_task.set_inputs(node) mll_task.set_outputs(node.change_ext('.ml')) self.mlltasks.append(mll_task) self.allnodes.append(mll_task.outputs[0]) def mly_hook(self,node): mly_task=self.create_task('ocamlyacc',self.native_env) mly_task.set_inputs(node) mly_task.set_outputs([node.change_ext('.ml'),node.change_ext('.mli')]) self.mlytasks.append(mly_task) self.allnodes.append(mly_task.outputs[0]) task=self.create_task('ocamlcmi',self.native_env) task.set_inputs(mly_task.outputs[1]) task.set_outputs(mly_task.outputs[1].change_ext('.cmi')) def mli_hook(self,node): task=self.create_task('ocamlcmi',self.native_env) task.set_inputs(node) task.set_outputs(node.change_ext('.cmi')) self.mlitasks.append(task) def mlc_hook(self,node): task=self.create_task('ocamlcc',self.native_env) task.set_inputs(node) task.set_outputs(node.change_ext('.o')) self.out_nodes+=task.outputs def ml_hook(self,node): if self.native_env: task=self.create_task('ocamlx',self.native_env) task.set_inputs(node) task.set_outputs(node.change_ext('.cmx')) task.obj=self task.incpaths=self.bld_incpaths_lst self.native_tasks.append(task) if self.bytecode_env: task=self.create_task('ocaml',self.bytecode_env) task.set_inputs(node) task.obj=self task.bytecode=1 task.incpaths=self.bld_incpaths_lst task.set_outputs(node.change_ext('.cmo')) self.bytecode_tasks.append(task) def compile_may_start(self): if not getattr(self,'flag_deps',''): self.flag_deps=1 if getattr(self,'bytecode',''):alltasks=self.obj.bytecode_tasks else:alltasks=self.obj.native_tasks self.signature() tree=Build.bld env=self.env for node in self.inputs: lst=tree.node_deps[self.unique_id()] for depnode in lst: for t in alltasks: if t==self:continue if depnode in t.inputs: self.set_run_after(t) delattr(self,'cache_sig') self.signature() return Task.Task.runnable_status(self) b=Task.simple_task_type cls=b('ocamlx','${OCAMLOPT} ${OCAMLPATH} ${OCAMLFLAGS} ${INCLUDES} -c -o ${TGT} ${SRC}',color='GREEN') cls.runnable_status=compile_may_start cls.scan=scan b=Task.simple_task_type cls=b('ocaml','${OCAMLC} ${OCAMLPATH} ${OCAMLFLAGS} ${INCLUDES} -c -o ${TGT} ${SRC}',color='GREEN') cls.runnable_status=compile_may_start cls.scan=scan b('ocamlcmi','${OCAMLC} ${OCAMLPATH} ${INCLUDES} -o ${TGT} -c ${SRC}',color='BLUE',before="ocaml ocamlcc ocamlx") b('ocamlcc','cd ${TGT[0].bld_dir(env)} && ${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLPATH} ${INCLUDES} -c ${SRC[0].abspath(env)}',color='GREEN') b('ocamllex','${OCAMLLEX} ${SRC} -o ${TGT}',color='BLUE',before="ocamlcmi ocaml ocamlcc") b('ocamlyacc','${OCAMLYACC} -b ${TGT[0].bld_base(env)} ${SRC}',color='BLUE',before="ocamlcmi ocaml ocamlcc") def link_may_start(self): if not getattr(self,'order',''): if getattr(self,'bytecode',0):alltasks=self.obj.bytecode_tasks else:alltasks=self.obj.native_tasks seen=[] pendant=[]+alltasks while pendant: task=pendant.pop(0) if task in seen:continue for x in task.run_after: if not x in seen: pendant.append(task) break else: seen.append(task) self.inputs=[x.outputs[0]for x in seen] self.order=1 return Task.Task.runnable_status(self) act=b('ocalink','${OCAMLC} -o ${TGT} ${INCLUDES} ${OCALINKFLAGS} ${SRC}',color='YELLOW',after="ocaml ocamlcc") act.runnable_status=link_may_start act=b('ocalinkx','${OCAMLOPT} -o ${TGT} ${INCLUDES} ${OCALINKFLAGS_OPT} ${SRC}',color='YELLOW',after="ocamlx ocamlcc") act.runnable_status=link_may_start def detect(conf): opt=conf.find_program('ocamlopt',var='OCAMLOPT') occ=conf.find_program('ocamlc',var='OCAMLC') if(not opt)or(not occ): conf.fatal('The objective caml compiler was not found:\ninstall it or make it available in your PATH') conf.env['OCAMLC']=occ conf.env['OCAMLOPT']=opt conf.env['OCAMLLEX']=conf.find_program('ocamllex',var='OCAMLLEX') conf.env['OCAMLYACC']=conf.find_program('ocamlyacc',var='OCAMLYACC') conf.env['OCAMLFLAGS']='' conf.env['OCAMLLIB']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep conf.env['LIBPATH_OCAML']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep conf.env['CPPPATH_OCAML']=Utils.cmd_output(conf.env['OCAMLC']+' -where').strip()+os.sep conf.env['LIB_OCAML']='camlrun' taskgen(init_ml) feature('ocaml')(init_ml) taskgen(init_envs_ml) feature('ocaml')(init_envs_ml) after('init_ml')(init_envs_ml) taskgen(apply_incpaths_ml) feature('ocaml')(apply_incpaths_ml) before('apply_vars_ml')(apply_incpaths_ml) after('init_envs_ml')(apply_incpaths_ml) taskgen(apply_vars_ml) feature('ocaml')(apply_vars_ml) before('apply_core')(apply_vars_ml) taskgen(apply_link_ml) feature('ocaml')(apply_link_ml) after('apply_core')(apply_link_ml) extension(EXT_MLL)(mll_hook) extension(EXT_MLY)(mly_hook) extension(EXT_MLI)(mli_hook) extension(EXT_MLC)(mlc_hook) extension(EXT_ML)(ml_hook) hotssh-0.2.6+dfsg1/wafadmin/Tools/ccroot.py0000644000175000017500000002362611115036226017232 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,re import TaskGen,Utils,preproc,Logs,Build,Options from Logs import error,debug,warn from Utils import md5 from TaskGen import taskgen,after,before,feature from Constants import* import config_c get_version_re=re.compile('\d+\.\d+(\.?\d+)*') def get_cc_version(conf,cc,version_var): v=conf.env output=Utils.cmd_output('%s -dumpversion'%cc) if output: match=get_version_re.search(output) if match: v[version_var]=match.group(0) conf.check_message('compiler','version',1,v[version_var]) return v[version_var] warn('could not determine the compiler version') class DEBUG_LEVELS: ULTRADEBUG="ultradebug" DEBUG="debug" RELEASE="release" OPTIMIZED="optimized" CUSTOM="custom" ALL=[ULTRADEBUG,DEBUG,RELEASE,OPTIMIZED,CUSTOM] def scan(self): debug('ccroot: _scan_preprocessor(self, node, env, path_lst)') all_nodes=[] all_names=[] seen=[] for node in self.inputs: gruik=preproc.c_parser(nodepaths=self.env['INC_PATHS'],defines=self.defines) gruik.start(node,self.env) if Logs.verbose: debug('deps: nodes found for %s: %s %s'%(str(node),str(gruik.nodes),str(gruik.names))) debug('deps: deps found for %s: %s'%(str(node),str(gruik.deps))) for x in gruik.nodes: if id(x)in seen:continue seen.append(id(x)) all_nodes.append(x) for x in gruik.names: if not x in all_names: all_names.append(x) return(all_nodes,gruik.names) class ccroot_abstract(TaskGen.task_gen): def __init__(self,*k,**kw): TaskGen.task_gen.__init__(self,*k,**kw) if len(k)>1: self.features.append('c'+k[1]) def default_cc(self): Utils.def_attrs(self,includes='',defines='',rpaths='',uselib='',uselib_local='',add_objects='',p_flag_vars=[],p_type_vars=[],scanner_defines={},compiled_tasks=[],link_task=None) def get_target_name(self): tp='program' for x in self.features: if x in['cshlib','cstaticlib']: tp=x.lstrip('c') pattern=self.env[tp+'_PATTERN'] if not pattern:pattern='%s' name=self.target k=name.rfind('/') return name[0:k+1]+pattern%name[k+1:] def apply_verif(self): if not'objects'in self.features: if not self.source: raise Utils.WafError('no source files specified for %s'%self) if not self.target: raise Utils.WafError('no target for %s'%self) def install_shlib(self): nums=self.vnum.split('.') path=self.install_path if not path:return libname=self.outputs[0].name name3=libname+'.'+self.vnum name2=libname+'.'+nums[0] name1=libname filename=self.outputs[0].abspath(self.env) bld=Build.bld bld.install_as(os.path.join(path,name3),filename,env=self.env) bld.symlink_as(os.path.join(path,name2),name3) bld.symlink_as(os.path.join(path,name1),name3) def vars_target_cprogram(self): self.default_install_path='${PREFIX}/bin' self.default_chmod=0755 def vars_target_cstaticlib(self): self.default_install_path='${PREFIX}/lib' def install_target_cstaticlib(self): if not Options.is_install:return self.link_task.install_path=self.install_path def install_target_cshlib(self): if getattr(self,'vnum','')and sys.platform!='win32': tsk=self.link_task tsk.vnum=self.vnum tsk.install=install_shlib def apply_incpaths(self): lst=[] for lib in self.to_list(self.uselib): for path in self.env['CPPPATH_'+lib]: if not path in lst: lst.append(path) if preproc.go_absolute: for path in preproc.standard_includes: if not path in lst: lst.append(path) for path in self.to_list(self.includes): if not path in lst: self.env.prepend_value('CPPPATH',path) if preproc.go_absolute or not os.path.isabs(path): lst.append(path) tree=Build.bld inc_lst=[] for path in lst: node=None if os.path.isabs(path): if preproc.go_absolute: node=Build.bld.root.find_dir(path) else: node=self.path.find_dir(path) if node: inc_lst.append(node) self.env['INC_PATHS']+=inc_lst def apply_type_vars(self): for x in self.features: if not x in['cprogram','cstaticlib','cshlib']: continue x=x.lstrip('c') st=self.env[x+'_USELIB'] if st:self.uselib=self.uselib+' '+st for var in self.p_type_vars: compvar='%s_%s'%(x,var) value=self.env[compvar] if value:self.env.append_value(var,value) def apply_link(self): link=getattr(self,'link',None) if not link: if'cstaticlib'in self.features:link='ar_link_static' elif'cxx'in self.features:link='cxx_link' else:link='cc_link' if getattr(self,'vnum',None):link='vnum_'+link linktask=self.create_task(link) outputs=[t.outputs[0]for t in self.compiled_tasks] linktask.set_inputs(outputs) linktask.set_outputs(self.path.find_or_declare(get_target_name(self))) linktask.chmod=self.chmod self.link_task=linktask def apply_lib_vars(self): env=self.env uselib=self.to_list(self.uselib) seen=[] names=self.to_list(self.uselib_local)[:] while names: x=names.pop(0) if x in seen: continue y=self.name_to_obj(x) if not y: raise Utils.WafError("object '%s' was not found in uselib_local (required by '%s')"%(x,self.name)) if getattr(y,'uselib_local',None): lst=y.to_list(y.uselib_local) for u in lst: if not u in seen: names.append(u) y.post() seen.append(x) if'cshlib'in y.features or'cprogram'in y.features: env.append_value('LIB',y.target) elif'cstaticlib'in y.features: env.append_value('STATICLIB',y.target) tmp_path=y.path.bldpath(self.env) if not tmp_path in env['LIBPATH']:env.prepend_value('LIBPATH',tmp_path) if y.link_task is not None: self.link_task.set_run_after(y.link_task) dep_nodes=getattr(self.link_task,'dep_nodes',[]) self.link_task.dep_nodes=dep_nodes+y.link_task.outputs morelibs=y.to_list(y.uselib) for v in morelibs: if v in uselib:continue uselib=[v]+uselib if getattr(y,'export_incdirs',None): cpppath_st=self.env['CPPPATH_ST'] for x in self.to_list(y.export_incdirs): node=y.path.find_dir(x) if not node:raise Utils.WafError('object %s: invalid folder %s in export_incdirs'%(y.target,x)) self.env.append_unique('INC_PATHS',node) for x in uselib: for v in self.p_flag_vars: val=self.env[v+'_'+x] if val:self.env.append_value(v,val) def apply_objdeps(self): seen=[] names=self.to_list(self.add_objects) while names: x=names[0] if x in seen: names=names[1:] continue y=self.name_to_obj(x) if not y: raise Utils.WafError("object '%s' was not found in uselib_local (required by add_objects '%s')"%(x,self.name)) if y.add_objects: added=0 lst=y.to_list(y.add_objects) lst.reverse() for u in lst: if u in seen:continue added=1 names=[u]+names if added:continue y.post() seen.append(x) self.link_task.inputs+=y.out_nodes def apply_obj_vars(self): v=self.env lib_st=v['LIB_ST'] staticlib_st=v['STATICLIB_ST'] libpath_st=v['LIBPATH_ST'] staticlibpath_st=v['STATICLIBPATH_ST'] rpath_st=v['RPATH_ST'] app=v.append_unique if v['FULLSTATIC']: v.append_value('LINKFLAGS',v['FULLSTATIC_MARKER']) for i in v['RPATH']: if i and rpath_st: app('LINKFLAGS',rpath_st%i) for i in v['LIBPATH']: app('LINKFLAGS',libpath_st%i) app('LINKFLAGS',staticlibpath_st%i) if v['STATICLIB']: v.append_value('LINKFLAGS',v['STATICLIB_MARKER']) k=[(staticlib_st%i)for i in v['STATICLIB']] app('LINKFLAGS',k) if not v['FULLSTATIC']: if v['STATICLIB']or v['LIB']: v.append_value('LINKFLAGS',v['SHLIB_MARKER']) app('LINKFLAGS',[lib_st%i for i in v['LIB']]) def apply_vnum(self): if sys.platform!='darwin'and sys.platform!='win32': try: nums=self.vnum.split('.') except AttributeError: pass else: try:name3=self.soname except AttributeError:name3=self.link_task.outputs[0].name+'.'+nums[0] self.link_task.outputs.append(self.link_task.outputs[0].parent.find_or_declare(name3)) self.env.append_value('LINKFLAGS','-Wl,-h,'+name3) def process_obj_files(self): if not hasattr(self,'obj_files'):return for x in self.obj_files: node=self.path.find_resource(x) self.link_task.inputs.append(node) def add_obj_file(self,file): if not hasattr(self,'obj_files'):self.obj_files=[] if not'process_obj_files'in self.meths:self.meths.append('process_obj_files') self.obj_files.append(file) def make_objects_available(self): self.out_nodes=[] app=self.out_nodes.append for t in self.compiled_tasks:app(t.outputs[0]) c_attrs={'cxxflag':'CXXFLAGS','cflag':'CCFLAGS','ccflag':'CCFLAGS','linkflag':'LINKFLAGS','ldflag':'LINKFLAGS','lib':'LIB','libpath':'LIBPATH','staticlib':'STATICLIB','staticlibpath':'STATICLIBPATH','rpath':'RPATH',} def add_extra_flags(self): for x in self.__dict__.keys(): y=x.lower() if y[-1]=='s': y=y[:-1] if c_attrs.get(y,None): self.env.append_unique(c_attrs[y],getattr(self,x)) feature('cc','cxx')(default_cc) before('init_cc','init_cxx')(default_cc) feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(apply_verif) feature('cprogram','dprogram')(vars_target_cprogram) before('apply_core')(vars_target_cprogram) feature('cstaticlib','dstaticlib','cshlib','dshlib')(vars_target_cstaticlib) before('apply_core')(vars_target_cstaticlib) feature('cprogram','dprogram','cstaticlib','dstaticlib','cshlib','dshlib')(install_target_cstaticlib) after('apply_objdeps','apply_link')(install_target_cstaticlib) feature('cshlib','dshlib')(install_target_cshlib) after('apply_objdeps','apply_link')(install_target_cshlib) feature('cc','cxx')(apply_incpaths) after('apply_type_vars')(apply_incpaths) feature('cc','cxx')(apply_type_vars) taskgen(apply_link) feature('cprogram','cshlib','cstaticlib')(apply_link) after('apply_core')(apply_link) feature('cc','cxx')(apply_lib_vars) after('apply_vnum')(apply_lib_vars) feature('objects')(apply_objdeps) after('apply_obj_vars','apply_vnum')(apply_objdeps) feature('cprogram','cshlib','cstaticlib')(apply_obj_vars) after('apply_lib_vars')(apply_obj_vars) feature('cprogram','cshlib','cstaticlib')(apply_vnum) after('apply_link')(apply_vnum) taskgen(process_obj_files) after('apply_link')(process_obj_files) taskgen(add_obj_file) feature('objects')(make_objects_available) after('apply_core')(make_objects_available) taskgen(add_extra_flags) feature('cc','cxx')(add_extra_flags) before('init_cxx','init_cc')(add_extra_flags) hotssh-0.2.6+dfsg1/wafadmin/Tools/ccroot.pyc0000644000175000017500000003623311777064501017406 0ustar javijavi <4Ic@smddlZddlZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z ddlm Z ddlm Z mZmZmZddlTddlZejdZdZddDd YZd Zd ejfd YZd ZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+i dd 6d!d"6d!d#6d$d%6d$d&6d'd(6d)d*6d+d,6d-d.6d/d06Z,d1Z-ed2d3eed4d5eed6d7d8d9d:d;eed6d7eed<eed8d9d:d;eed<eed6d7d8d9d:d;e ed=d>e ed:d;e!ed=d>e!ed2d3e"ed?e"ed2d3e#e e$ed6d:d8e$ed<e$ed2d3e%ed@e%edAe&edBd@e&ed6d:d8e'edCe'ed6d:d8e(ed>e(e e)ed>e)e e*edAe+ed<e+e e-ed2d3e-ed5d4e-dS(EiN(terrortdebugtwarn(tmd5(ttaskgentaftertbeforetfeature(t*s\d+\.\d+(\.?\d+)*cCs}|j}tjd|}|rotj|}|ro|jd||<|jddd||||SntddS(Ns%s -dumpversionitcompilertversionis(could not determine the compiler version(tenvtUtilst cmd_outputtget_version_retsearchtgroupt check_messageR(tconftcct version_vartvtoutputtmatch((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytget_cc_version s  t DEBUG_LEVELScBs;eZdZdZdZdZdZeeeeegZRS(t ultradebugRtreleaset optimizedtcustom(t__name__t __module__t ULTRADEBUGtDEBUGtRELEASEt OPTIMIZEDtCUSTOMtALL(((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyRs cCsLtdg}g}g}x |jD]}tjd|jdd|j}|j||jtjrtdt |t |j t |j ftdt |t |j fnxI|j D]>}t ||krqn|jt ||j|qWx-|j D]"}||kr|j|qqWq&W||j fS(Ns5ccroot: _scan_preprocessor(self, node, env, path_lst)t nodepathst INC_PATHStdefinessdeps: nodes found for %s: %s %ssdeps: deps found for %s: %s(Rtinputstpreproctc_parserR R(tstarttLogstverbosetstrtnodestnamestdepstidtappend(tselft all_nodest all_namestseentnodetgruiktx((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytscans& " /& tccroot_abstractcBseZdZRS(cOsGtjj|||t|dkrC|jjd|dndS(Nitc(tTaskGenttask_gent__init__tlentfeaturesR4(R5tktkw((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyRA1s(RRRA(((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyR=0scCsStj|dddddddddddddgd gd id gd d dS( NtincludestR(trpathstuselibt uselib_localt add_objectst p_flag_varst p_type_varstscanner_definestcompiled_taskst link_task(R t def_attrstNone(R5((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt default_cc5scCsd}x/|jD]$}|d kr|jd}qqW|j|d}|sXd}n|j}|jd}|d|d !|||d S( Ntprogramtcshlibt cstaticlibR>t_PATTERNs%st/ii(RURV(RCtlstripR ttargettrfind(R5ttpR;tpatterntnameRD((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytget_target_name7s   cCsTd|jkrP|js.tjd|n|jsPtjd|qPndS(Ntobjectss no source files specified for %ssno target for %s(RCtsourceR tWafErrorRZ(R5((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt apply_verifAs   c Cs|jjd}|j}|s%dS|jdj}|d|j}|d|d}|}|jdj|j}tj}|j t j j |||d|j|j t j j ||||j t j j |||dS(Nt.iR (tvnumtsplitt install_pathtoutputsR^tabspathR tBuildtbldt install_astostpathtjoint symlink_as( R5tnumsRntlibnametname3tname2tname1tfilenameRk((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt install_shlibGs  (cCsd|_d|_dS(Ns ${PREFIX}/bini(tdefault_install_patht default_chmod(R5((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytvars_target_cprogramTs cCs d|_dS(Ns ${PREFIX}/lib(Rx(R5((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytvars_target_cstaticlibWscCs tjs dS|j|j_dS(N(tOptionst is_installRgRP(R5((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytinstall_target_cstaticlibYs cCsFt|ddrBtjdkrB|j}|j|_t|_ndS(NReRGtwin32(tgetattrtsystplatformRPReRwtinstall(R5ttsk((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytinstall_target_cshlib\s!  cCsg}xR|j|jD]>}x5|jd|D]"}||kr1|j|q1q1WqWtjrx0tjD]"}||krn|j|qnqnWnxh|j|jD]T}||kr|jjd|tjst j j | r|j|qqqWt j }g}xr|D]j}d}t j j |rZtjrlt j jj|}qln|j j|}|r|j|qqW|jdc|7t_USELIBt s%s_%s(Rs cstaticlibscshlib(RCRYR RIRMt append_value(R5R;tsttvartcompvartvalue((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytapply_type_vars|s  cCst|dd}|spd|jkr0d}nd|jkrHd}nd}t|ddrpd|}qpn|j|}g|jD]}|jd ^q}|j||j|jj t ||j |_ ||_ dS( NtlinkRVtar_link_statictcxxtcxx_linktcc_linkRetvnum_i( RRRRCt create_taskRORht set_inputst set_outputsRntfind_or_declareR_tchmodRP(R5RtlinktaskttRh((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt apply_links  #  cCs|j}|j|j}g}|j|j}xv|r|jd}||kr^q7n|j|}|stjd||jfnt |ddr|j|j}x-|D]"}||kr|j |qqWn|j |j |d|j ksd|j kr1|jd|jn%d|j krV|jd|jn|jj|j} | |d kr|jd | n|jdk r|jj|jt |jd g} | |jj|j_n|j|j} x-| D]%} | |krqn| g|}qWt |d dr7|jd } xg|j|jD]P}|jj|}|stjd |j|fn|jjd|qRWq7q7WxS|D]K}xB|jD]7} |j| d|}|r|jj| |qqWqWdS(Nis<object '%s' was not found in uselib_local (required by '%s')RJRURtLIBRVt STATICLIBtLIBPATHt dep_nodestexport_incdirst CPPPATH_STs.object %s: invalid folder %s in export_incdirsR't_(R RRIRJtpopt name_to_objR RbR^RRRR4tpostRCRRZRntbldpathRRPt set_run_afterRhRRRt append_uniqueRL(R5R RIR8R1R;tyRtuttmp_pathRtmorelibsRt cpppath_stR9tval((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytapply_lib_varss\           cCsg}|j|j}x|r|d}||krG|d}qn|j|}|s{tjd||jfn|jrd}|j|j}|jx3|D]+}||krqnd}|g|}qW|rqqn|j|j||j j |j 7_ qWdS(NiisHobject '%s' was not found in uselib_local (required by add_objects '%s')( RRKRR RbR^treverseRR4RPR)t out_nodes(R5R8R1R;RtaddedRR((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt apply_objdepss0           c Cs|j}|d}|d}|d}|d}|d}|j}|dre|jd|dnx2|d D]&}|rp|rp|d||qpqpWx4|d D](}|d|||d||qW|d r |jd|d g|d D]}||^q} |d| n|dsX|d s>|d rX|jd|dqXn|dg|d D]}||^qidS(NtLIB_STt STATICLIB_STt LIBPATH_STtSTATICLIBPATH_STtRPATH_STt FULLSTATICt LINKFLAGStFULLSTATIC_MARKERtRPATHRRtSTATICLIB_MARKERRt SHLIB_MARKER(R RR( R5Rtlib_stt staticlib_stt libpath_sttstaticlibpath_sttrpath_sttapptiRD((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytapply_obj_varss.          ! cCstjdkrtjdkry|jjd}Wntk rGqXy |j}Wn0tk r|jjdjd|d}nX|jjj |jjdj j ||j j dd|ndS(NtdarwinRRdiRs-Wl,-h,(RRReRftAttributeErrortsonameRPRhR^R4tparentRR R(R5RqRs((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt apply_vnums   #)cCsPt|dsdSx6|jD]+}|jj|}|jjj|qWdS(Nt obj_files(thasattrRRnt find_resourceRPR)R4(R5R;R9((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytprocess_obj_filess cCsQt|dsg|_nd|jkr=|jjdn|jj|dS(NRR(RRtmethsR4(R5tfile((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyt add_obj_files  cCs>g|_|jj}x"|jD]}||jdqWdS(Ni(RR4RORh(R5RR((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytmake_objects_availables  tCXXFLAGStcxxflagtCCFLAGStcflagtccflagRtlinkflagtldflagRRRtlibpathRt staticlibt STATICLIBPATHt staticlibpathRtrpathcCs|xu|jjD]d}|j}|ddkr?|d }ntj|dr|jjt|t||qqWdS(Nits( t__dict__tkeystlowertc_attrstgetRRR RR(R5R;R((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pytadd_extra_flagss   RRtinit_cctinit_cxxRtdprogramRVt dstaticlibRUtdshlibt apply_coreRRRRR`RR((.RmRtreR?R R*R-RjR|RRRRRRRRt Constantstconfig_ctcompileRRRR<R@R=RSR_RcRwRzR{R~RRRRRRRRRRRRR(((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/ccroot.pyts$H"            +     L     hotssh-0.2.6+dfsg1/wafadmin/Tools/libtool.py0000644000175000017500000001757211075216572017421 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys,re,os,optparse import TaskGen,Task,Utils,preproc from Logs import error,debug,warn from TaskGen import taskgen,after,before,feature REVISION="0.1.3" fakelibtool_vardeps=['CXX','PREFIX'] def fakelibtool_build(task): env=task.env dest=open(task.outputs[0].abspath(env),'w') sname=task.inputs[0].name fu=dest.write fu("# Generated by ltmain.sh - GNU libtool 1.5.18 - (pwn3d by BKsys II code name WAF)\n") if env['vnum']: nums=env['vnum'].split('.') libname=task.inputs[0].name name3=libname+'.'+env['vnum'] name2=libname+'.'+nums[0] name1=libname fu("dlname='%s'\n"%name2) strn=" ".join([name3,name2,name1]) fu("library_names='%s'\n"%(strn)) else: fu("dlname='%s'\n"%sname) fu("library_names='%s %s %s'\n"%(sname,sname,sname)) fu("old_library=''\n") vars=' '.join(env['libtoolvars']+env['LINKFLAGS']) fu("dependency_libs='%s'\n"%vars) fu("current=0\n") fu("age=0\nrevision=0\ninstalled=yes\nshouldnotlink=no\n") fu("dlopen=''\ndlpreopen=''\n") fu("libdir='%s/lib'\n"%env['PREFIX']) dest.close() return 0 def read_la_file(path): sp=re.compile(r'^([^=]+)=\'(.*)\'$') dc={} file=open(path,"r") for line in file.readlines(): try: _,left,right,_=sp.split(line.strip()) dc[left]=right except ValueError: pass file.close() return dc def apply_link_libtool(self): if self.type!='program': linktask=self.link_task latask=self.create_task('fakelibtool') latask.set_inputs(linktask.outputs) latask.set_outputs(linktask.outputs[0].change_ext('.la')) self.latask=latask if Options.commands['install']or Options.commands['uninstall']: Build.bld.install_files('PREFIX','lib',linktask.outputs[0].abspath(self.env),self.env) def apply_libtool(self): self.env['vnum']=self.vnum paths=[] libs=[] libtool_files=[] libtool_vars=[] for l in self.env['LINKFLAGS']: if l[:2]=='-L': paths.append(l[2:]) elif l[:2]=='-l': libs.append(l[2:]) for l in libs: for p in paths: dict=read_la_file(p+'/lib'+l+'.la') linkflags2=dict.get('dependency_libs','') for v in linkflags2.split(): if v.endswith('.la'): libtool_files.append(v) libtool_vars.append(v) continue self.env.append_unique('LINKFLAGS',v) break self.env['libtoolvars']=libtool_vars while libtool_files: file=libtool_files.pop() dict=read_la_file(file) for v in dict['dependency_libs'].split(): if v[-3:]=='.la': libtool_files.append(v) continue self.env.append_unique('LINKFLAGS',v) Task.task_type_from_func('fakelibtool',vars=fakelibtool_vardeps,func=fakelibtool_build,color='BLUE',after="cc_link cxx_link ar_link_static") class libtool_la_file: def __init__(self,la_filename): self.__la_filename=la_filename self.linkname=str(os.path.split(la_filename)[-1])[:-3] if self.linkname.startswith("lib"): self.linkname=self.linkname[3:] self.dlname=None self.library_names=None self.old_library=None self.dependency_libs=None self.current=None self.age=None self.revision=None self.installed=None self.shouldnotlink=None self.dlopen=None self.dlpreopen=None self.libdir='/usr/lib' if not self.__parse(): raise"file %s not found!!"%(la_filename) def __parse(self): if not os.path.isfile(self.__la_filename):return 0 la_file=open(self.__la_filename,'r') for line in la_file: ln=line.strip() if not ln:continue if ln[0]=='#':continue (key,value)=str(ln).split('=',1) key=key.strip() value=value.strip() if value=="no":value=False elif value=="yes":value=True else: try:value=int(value) except ValueError:value=value.strip("'") setattr(self,key,value) la_file.close() return 1 def get_libs(self): libs=[] if self.dependency_libs: libs=str(self.dependency_libs).strip().split() if libs==None: libs=[] libs.insert(0,"-l%s"%self.linkname.strip()) libs.insert(0,"-L%s"%self.libdir.strip()) return libs def __str__(self): return'''\ dlname = "%(dlname)s" library_names = "%(library_names)s" old_library = "%(old_library)s" dependency_libs = "%(dependency_libs)s" version = %(current)s.%(age)s.%(revision)s installed = "%(installed)s" shouldnotlink = "%(shouldnotlink)s" dlopen = "%(dlopen)s" dlpreopen = "%(dlpreopen)s" libdir = "%(libdir)s"'''%self.__dict__ class libtool_config: def __init__(self,la_filename): self.__libtool_la_file=libtool_la_file(la_filename) tmp=self.__libtool_la_file self.__version=[int(tmp.current),int(tmp.age),int(tmp.revision)] self.__sub_la_files=[] self.__sub_la_files.append(la_filename) self.__libs=None def __cmp__(self,other): if not other: return 1 othervers=[int(s)for s in str(other).split(".")] selfvers=self.__version return cmp(selfvers,othervers) def __str__(self): return"\n".join([str(self.__libtool_la_file),' '.join(self.__libtool_la_file.get_libs()),'* New getlibs:',' '.join(self.get_libs())]) def __get_la_libs(self,la_filename): return libtool_la_file(la_filename).get_libs() def get_libs(self): libs_list=list(self.__libtool_la_file.get_libs()) libs_map={} while len(libs_list)>0: entry=libs_list.pop(0) if entry: if str(entry).endswith(".la"): if entry not in self.__sub_la_files: self.__sub_la_files.append(entry) libs_list.extend(self.__get_la_libs(entry)) else: libs_map[entry]=1 self.__libs=libs_map.keys() return self.__libs def get_libs_only_L(self): if not self.__libs:self.get_libs() libs=self.__libs libs=filter(lambda s:str(s).startswith('-L'),libs) return libs def get_libs_only_l(self): if not self.__libs:self.get_libs() libs=self.__libs libs=filter(lambda s:str(s).startswith('-l'),libs) return libs def get_libs_only_other(self): if not self.__libs:self.get_libs() libs=self.__libs libs=filter(lambda s:not(str(s).startswith('-L')or str(s).startswith('-l')),libs) return libs def useCmdLine(): usage='''Usage: %prog [options] PathToFile.la example: %prog --atleast-version=2.0.0 /usr/lib/libIlmImf.la nor: %prog --libs /usr/lib/libamarok.la''' parser=optparse.OptionParser(usage) a=parser.add_option a("--version",dest="versionNumber",action="store_true",default=False,help="output version of libtool-config") a("--debug",dest="debug",action="store_true",default=False,help="enable debug") a("--libs",dest="libs",action="store_true",default=False,help="output all linker flags") a("--libs-only-l",dest="libs_only_l",action="store_true",default=False,help="output -l flags") a("--libs-only-L",dest="libs_only_L",action="store_true",default=False,help="output -L flags") a("--libs-only-other",dest="libs_only_other",action="store_true",default=False,help="output other libs (e.g. -pthread)") a("--atleast-version",dest="atleast_version",default=None,help="return 0 if the module is at least version ATLEAST_VERSION") a("--exact-version",dest="exact_version",default=None,help="return 0 if the module is exactly version EXACT_VERSION") a("--max-version",dest="max_version",default=None,help="return 0 if the module is at no newer than version MAX_VERSION") (options,args)=parser.parse_args() if len(args)!=1 and not options.versionNumber: parser.error("incorrect number of arguments") if options.versionNumber: print"libtool-config version %s"%REVISION return 0 ltf=libtool_config(args[0]) if options.debug: print(ltf) if options.atleast_version: if ltf>=options.atleast_version:return 0 sys.exit(1) if options.exact_version: if ltf==options.exact_version:return 0 sys.exit(1) if options.max_version: if ltf<=options.max_version:return 0 sys.exit(1) def p(x): print" ".join(x) if options.libs:p(ltf.get_libs()) elif options.libs_only_l:p(ltf.get_libs_only_l()) elif options.libs_only_L:p(ltf.get_libs_only_L()) elif options.libs_only_other:p(ltf.get_libs_only_other()) return 0 if __name__=='__main__': useCmdLine() taskgen(apply_link_libtool) feature("libtool")(apply_link_libtool) after('apply_link')(apply_link_libtool) taskgen(apply_libtool) feature("libtool")(apply_libtool) before('apply_core')(apply_libtool) hotssh-0.2.6+dfsg1/wafadmin/Tools/gdc.py0000644000175000017500000000217511075216572016503 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys import ar def find_gdc(conf): v=conf.env d_compiler=None if v['D_COMPILER']: d_compiler=v['D_COMPILER'] if not d_compiler:d_compiler=conf.find_program('gdc',var='D_COMPILER') if not d_compiler:return 0 v['D_COMPILER']=d_compiler def common_flags(conf): v=conf.env v['DFLAGS']={'gdc':[],'dmd':[]} v['D_SRC_F']='' v['D_TGT_F']='-c -o ' v['DPATH_ST']='-I%s' v['D_LINKER']=v['D_COMPILER'] v['DLNK_SRC_F']='' v['DLNK_TGT_F']='-o ' v['DLIB_ST']='-l%s' v['DLIBPATH_ST']='-L%s' v['DLINKFLAGS']=[] v['DFLAGS_OPTIMIZED']=['-O3'] v['DFLAGS_DEBUG']=['-O0'] v['DFLAGS_ULTRADEBUG']=['-O0'] v['D_shlib_DFLAGS']=[] v['D_shlib_LINKFLAGS']=['-shared'] v['DHEADER_ext']='.di' v['D_HDR_F']='-fintfc -fintfc-file=' if sys.platform=="win32": v['D_program_PATTERN']='%s.exe' v['D_shlib_PATTERN']='lib%s.dll' v['D_staticlib_PATTERN']='lib%s.a' else: v['D_program_PATTERN']='%s' v['D_shlib_PATTERN']='lib%s.so' v['D_staticlib_PATTERN']='lib%s.a' def detect(conf): v=conf.env find_gdc(conf) ar.find_ar(conf) conf.check_tool('d') common_flags(conf) def set_options(opt): pass hotssh-0.2.6+dfsg1/wafadmin/Tools/gnome.pyc0000644000175000017500000003251711777064501017223 0ustar javijavi HIc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddlm Z ddlm Z m Z m Z mZejdejZejdejZdZdZdZd d d d d Zd ejfd YZdZdZdejfdYZdZdZdZdZdejfdYZ dZ!ej"ddddZ#ee#_$ee#_ejj%Z&dZ%e%e#_%d e#_'ej"ddej"d d!ddd"Z(ej"d#e(ddd$Z)d%Z*e eed&ee eed'ee d(ee eed)ee eed)ee d*ee e!ed+e!dS(,iN(terror(ttaskgentbeforetaftertfeatures#(.*)s(.*)cCstjdrtjjd|}tjjs[tjddd|}tj |}qtjddtjdd|ndS(Ntinstalls&${PREFIX}/etc/gconf/schemas/%s.schemastYELLOWsInstalling GConf schemas1gconftool-2 --install-schema-file=%s 1> /dev/nulls4GConf schema not installed. After install, run this:s$gconftool-2 --install-schema-file=%s( tOptionstcommandstBuildtbldtget_install_pathtoptionstdestdirtUtilstpprintt exec_command(t prog_nametdirtcommandtret((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytpostinstall_schemas s   cCstjjd}tjdr~tjjsWtjddd|}tj |}q~tjddtjdd|ndS(Ns${DATADIR}/icons/hicolorRRsUpdating Gtk icon cache.s!gtk-update-icon-cache -q -f -t %ss0Icon cache not updated. After install, run this:( R R R RRR R RRR(RRR((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytpostinstall_iconss   cCsptjdrltjjdrltjjd}tjjd|}d||f}tj |}qlndS(NRs/var/log/scrollkeeper.logs${PREFIX}/var/scrollkeepers${DATADIR}/omf/%ss"scrollkeeper-update -q -p %s -o %s( RRtostpatht iswriteableR R R RR(Rtdir1tdir2RR((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytpostinstall_scrollkeepers  tmyappicCs:|rt|n|r#tn|r6t|ndS(N(RRR(Rtschemasticonst scrollkeeper((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyt postinstall&s   tgnome_doc_taskgencBseZdZRS(cOstjj|||dS(N(tTaskGenttask_gent__init__(tselftktkw((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyR%+s(t__name__t __module__R%(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyR"*scCs d|_dS(Ns${PREFIX}/share(tdefault_install_path(R&((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytinit_gnome_doc-sc CsP|j|jd<|j|j}x'|D]}|jd}|jj|d|d}|jjd|j}|jjd||jf}|j||g|j ||jd}|jjd||j|f}|j ||jj|jd }||g|_ |j j |t jr)|jd |j|f} tjj|jd |j|jx|j|jD]} y[tj|jjd|d| tj| d| |jjd|d| Wqtj| d| |jjd | qXqWtj| d |j|j|jq)q)WdS(NtAPPNAMEtxml2pot/s.posC/%s.xmls %s/%s.xmlt xsltproc2pos %s/%s-%s.omfs.omf.insgnome/help/%s/%stomfs/C/s/%s.xml(t doc_moduletenvtto_listt doc_linguast create_taskRt find_resourcetfind_or_declaret set_inputst set_outputstinputst run_aftertappendRt is_installt install_pathR R t install_filestabspatht doc_figuresRtstattCommont install_as( R&tlsttxttsktnodetsrctoutttsk2tout2Rty((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytapply_gnome_doc/s2  "  &&51txml_to_taskgencBseZdZRS(cOstjj|||dS(N(R#R$R%(R&R'R(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyR%Js(R)R*R%(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyRPIsc Cs/tj|ddddddddd ddS( Ntsourcetxmlfiletxsltt xlsltfilettargettheyR+s ${PREFIX}t task_created(Rt def_attrstNone(R&((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyt init_xml_toLscCs{tj}|jj|j}|jj|j}|jd}|j||g|j|j d|j |_ dS(Ntxmltothtml( R R RR7RQRSR6R9R:t change_extR?(R&ttreeRRtxsltfileRH((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyt apply_xml_toNs c Cs|jd}|j}|j|}t|j|d}|j}|jtj|d}t j|d}|d|}g|gfS(Nitrt.( R;R3tvarianttopenRAtreadtcloset n1_regexptfindallt n2_regexp( R&RIR3Rctfitcontenttnametnumtdoc_name((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyt sgml_scanVs    csfd}tj}j}|jj|d}|rd|djkrd||dSj\}}tjrtj rt dt t |t |fntj}||j j<||j j<|j}|S(Ncs@tjjj}|d}jjjj|dS(Ni(R R traw_depst unique_idR:ttask_generatorRR8(tdpsRl(R&(ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyt sgml_outputsbs is#deps: scanner for %s returned %s %s((R R Rqt task_sigstgettcompute_sig_implicit_depstscantLogstverbosetzonestdebugtstrt node_depsRp(R&RtR^tkeyt prev_sigstnodestnamestsig((R&ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytsig_implicit_depsas   ,  tgnome_sgml2man_taskgencBseZdZRS(cOstjj|||dS(N(R#R$R%(R&R'R(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyR%vs(R)R*R%(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pyRuscCst|ddstd}tj}|j|jxtjj|jjD]}t jj |\}}|dkrqQn|j d}|j |jj |||_tjr||_n|jqQWdS(NtappnamecSsS|jd}|j}|d}|j}tjjdd||j||dS(NiitDATADIRs man/man%s/(toutputsRlR3R R R@RA(ttaskRKRltextR3((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytinstall_resultzs     s.sgmltsgml2man(tgetattrRYtAssertionErrorR R trescanRtcache_dir_contentstidRtsplitextR6R9R7RrRR>RRx(R&RR^RltbaseRR((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytapply_gnome_sgml2manxs     Rs9${SGML2MAN} -o ${TGT[0].bld_dir(env)} ${SRC} > /dev/nulltcolortBLUEcCst|t|S(N(told_runnable_status(R&((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/gnome.pytrunnable_statuss R[s>${XMLTO} html -m ${SRC[1].abspath(env)} ${SRC[0].abspath(env)}R.s(${XML2PO} ${XML2POFLAGS} ${SRC} > ${TGT}s${XSLTPROC2PO} -o ${TGT[0].abspath(env)} --stringparam db2omf.basename ${APPNAME} --stringparam db2omf.format docbook --stringparam db2omf.lang C --stringparam db2omf.dtd '-//OASIS//DTD DocBook XML V4.3//EN' --stringparam db2omf.omf_dir ${PREFIX}/share/omf --stringparam db2omf.help_dir ${PREFIX}/share/gnome/help --stringparam db2omf.omf_in ${SRC[0].abspath(env)} --stringparam db2omf.scrollkeeper_cl ${SCROLLKEEPER_DATADIR}/Templates/C/scrollkeeper_cl.xml ${DB2OMF} ${SRC[1].abspath(env)}R0cCs|jd|jddd}d}|jdtjj|jdd|jd dd }|jd dd }d |jdsZT "                     hotssh-0.2.6+dfsg1/wafadmin/Tools/python.pyc0000644000175000017500000003214611777064501017435 0ustar javijavi <4Ic@sddlZddlZddlZddlZddlZddlZddlZddlZddlmZm Z ddlm Z m Z m Z m Z mZddlmZddlZdgZdZdZdZejd d gd Zd Zd ejfdYZdZdgdZdZddZdZ dZ!dZ"e ee deedee dee ee dee dee deedee ee deedee eeed ee dee ee d ee dee deed eeeeeee dS( iN(tdebugtwarn(t extensionttaskgentbeforetaftertfeature(tconfs.pycCsZd|_|jt|dd|_d|jkrI|jjdnt|jdtk rq>Xq>Wntjdr|jds|jdrdGHn|jdr2d }|jd d |g}|j |t j |j }|r2t jd q2n|jdrd }|jd |jdd |g}|j |t j |j }|rt jd qqqndS(Nt uninstalls%* removing byte compiled python filestctotinstalltPYCtPYOs* byte compiling python filess^ import sys, py_compile for pyfile in sys.argv[1:]: py_compile.compile(pyfile, pyfile + 'c') tPYTHONs-csbytecode compilation faileds^ import sys, py_compile for pyfile in sys.argv[1:]: py_compile.compile(pyfile, pyfile + 'o') t PYFLAGS_OPT(RRRRtcommandstostremovetOSErrorRR%tpproctPopentwaittUtilstWafError(RR'tfnametprogramtargvtretval((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytbyte_compile_pys@            t py_taskgencBseZdZRS(cOstjj|||dS(N(tTaskGenttask_gent__init__(Rtktkw((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pyRBHs(t__name__t __module__RB(((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pyR?GscCs d|_dS(Ns ${PYTHONDIR}(R (R((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytinit_pyJss import sysc Cst|}|jdx|D]}|jd|q Wtj|ddj|gdtj}|jdjd}|jrt j rt ddjgt |D] \}}d|d |f^qnt ng} x|D]} | j} | s qn| d kr'| jdq| dd kr^| d d kr^| j| d d !q| djr| jt| qPqW| S( NR sprint repr(%s)s-cs tstdoutisCPython program to extract python configuration variables failed: %ss line %03i: %sitNonet'i(tlistRR5R6tjointPIPEt communicatetsplitt returncodetLogstverboseRt enumeratet ValueErrortstripRItisdigittint( t python_exet variablestimportsR;tvtproctoutputtlinenotlinet return_valuests((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pyt_get_python_variablesLs.   *  G     cCs|j}|d}|s,td|ftjdkrK|jdnyTdj}t|g|D]}d|^qgdg\}}}}} } } } Wntk r|jdnX|j j d |||||| | | | f d ||d <|dk rOxC|jD]2} | j d r8| d } n|j d| qWn|dk rxC|jD]2} | j d r| d } n|j d| qhWnd}d}d|d}| dk r| g}|jd|ddd|}n|r-| dk r-| g}|jd|ddd|}n|rtjj|dg}d|djdd}|jd|ddd|}n|s||d<|j d|ntjdkstjj dstjdks| r|d|d<|d|d|d?d@dAdBdCddS(DNR/spython is %r !tdarwintosxs@prefix SO SYSLIBS SHLIBS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHAREDsget_config_var('%s')s.from distutils.sysconfig import get_config_vars6Python development headers not found (-v for details).sConfiguration returned from %r: python_prefix = %r python_SO = %r python_SYSLIBS = %r python_SHLIBS = %r python_LIBDIR = %r python_LIBPL = %r INCLUDEPY = %r Py_ENABLE_SHARED = %r s%sRs-lit LIB_PYEMBEDs #ifdef __cplusplus extern "C" { #endif void Py_Initialize(void); void Py_Finalize(void); #ifdef __cplusplus } #endif int main(int argc, char *argv[]) { Py_Initialize(); Py_Finalize(); return 0; } itpythontPYTHON_VERSIONtlibRRtlibpathtlibst.R tLIBPATH_PYEMBEDtwin32tos2t LIBPATH_PYEXTt LIB_PYEXTspython%s-configtvart PYTHON_CONFIGspython-config-%ss%s %s --includess-Is/IsLInclude path for Python extensions (found via python-config --includes): %r t CPPPATH_PYEXTtCPPPATH_PYEMBEDsDInclude path for Python extensions (found via distutils module): %r tCCs %s --versions(GCC)tgcctCCFLAGS_PYEMBEDs-fno-strict-aliasingt CCFLAGS_PYEXTtCXXsg++tCXXFLAGS_PYEMBEDtCXXFLAGS_PYEXTtCPPPATHtLIBPATHtLIBtCXXFLAGStCCFLAGSt header_namesPython.ht define_namet HAVE_PYTHON_HRtfragmentsc#include int main(int argc, char *argv[]) { Py_Initialize(); Py_Finalize(); return 0; } terrmsgs-Could not find the python development headerst mandatory(RtAssertionErrorRtplatformt check_toolRORbRTtfataltlogtwriteRIt startswitht append_valuetcheckR2tpathRLtreplacetsyst find_programtpopentreadlineRURtcopy(RRRfR[txt python_prefixt python_SOtpython_SYSLIBSt python_SHLIBSt python_LIBDIRt python_LIBPLt INCLUDEPYtPy_ENABLE_SHAREDRhtcodetresulttnameRt python_configtincludestincstrtversionttest_env((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytcheck_python_headersds   H  &       ! !! 6362         cCs|dks!t|ts!t|jd}|sGtd|f|ddg}td|tj|dtj}|j dj }t |dkstd t ||ft |dt |d t |d |d t |d f}|dkp||k}|rSdj g|d D]}t|^q0} | |jd= %stoptionsPython too old.(RIt isinstancettupleRRRR5R6RMRNROtlenRWRLtstrR2tenvironRRRbRRRtmaptcheck_message_customt check_messageR(RtminverRftcmdR\tlinest pyver_tupleRRtpyvertpydirtpython_LIBDESTt pyver_fullt minver_str((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytcheck_python_versionsB! .A,   #&  cCsitj|jddd|gdtjdtjj }|jd|||se|jdndS(NR/s-cs import %ststderrRHs Python modulesPython module not found.(R5R6RRMR7RR(Rt module_nameR((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytcheck_python_modules<cCs||jddd}|sdS|j}d|dRAR?RGRbRRIRRRR(((st/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Tools/python.pytsVH(       )  _ &        hotssh-0.2.6+dfsg1/wafadmin/Tools/compiler_cc.py0000644000175000017500000000270511115036226020213 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,imp,types,ccroot import optparse import Utils,Configure,Options c_compiler={'win32':['msvc','gcc'],'cygwin':['gcc'],'darwin':['gcc'],'aix5':['gcc'],'linux':['gcc','suncc'],'sunos':['suncc','gcc'],'irix':['gcc'],'hpux':['gcc'],'default':['gcc']} def __list_possible_compiler(platform): try: return c_compiler[platform] except KeyError: return c_compiler["default"] def detect(conf): try:test_for_compiler=Options.options.check_c_compiler except AttributeError:raise Configure.ConfigurationError("Add set_options(opt): opt.tool_options('compiler_cc')") for c_compiler in test_for_compiler.split(): conf.check_tool(c_compiler) if conf.env['CC']: conf.check_message("%s"%c_compiler,'',True) conf.env["COMPILER_CC"]="%s"%c_compiler return conf.check_message("%s"%c_compiler,'',False) conf.env["COMPILER_CC"]=None def set_options(opt): detected_platform=Options.platform possible_compiler_list=__list_possible_compiler(detected_platform) test_for_compiler=str(" ").join(possible_compiler_list) cc_compiler_opts=opt.add_option_group("C Compiler Options") cc_compiler_opts.add_option('--check-c-compiler',default="%s"%test_for_compiler,help='On this platform (%s) the following C-Compiler will be checked by default: "%s"'%(detected_platform,test_for_compiler),dest="check_c_compiler") for c_compiler in test_for_compiler.split(): opt.tool_options('%s'%c_compiler,option_group=cc_compiler_opts) hotssh-0.2.6+dfsg1/wafadmin/Tools/ar.py0000644000175000017500000000257511075216572016354 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys import Task from Configure import conftest ar_str='${AR} ${ARFLAGS} ${TGT} ${SRC} && ${RANLIB} ${RANLIBFLAGS} ${TGT}' if sys.platform=="win32": ar_str='${AR} s${ARFLAGS} ${TGT} ${SRC}' cls=Task.simple_task_type('ar_link_static',ar_str,color='YELLOW',ext_in='.o') cls.maxjobs=1 def detect(conf): comp=conf.find_program('ar',var='AR') if not comp:return ranlib=conf.find_program('ranlib',var='RANLIB') if not ranlib:return v=conf.env v['AR']=comp v['ARFLAGS']='rc' v['RANLIB']=ranlib v['RANLIBFLAGS']='' def find_ar(conf): v=conf.env conf.check_tool('ar') if not v['AR']:conf.fatal('ar is required for static libraries - not found') def find_cpp(conf): v=conf.env cpp=None if v['CPP']:cpp=v['CPP'] elif'CPP'in os.environ:cpp=os.environ['CPP'] if not cpp:cpp=conf.find_program('cpp',var='CPP') if not cpp:cpp=v['CC'] if not cpp:cpp=v['CXX'] v['CPP']=cpp def cc_add_flags(conf): conf.add_os_flags('CFLAGS','CCFLAGS') conf.add_os_flags('CPPFLAGS') conf.add_os_flags('LINKFLAGS') def cxx_add_flags(conf): conf.add_os_flags('CXXFLAGS') conf.add_os_flags('CPPFLAGS') conf.add_os_flags('LINKFLAGS') def cc_load_tools(conf): conf.check_tool('cc') def cxx_load_tools(conf): conf.check_tool('cxx') conftest(find_ar) conftest(find_cpp) conftest(cc_add_flags) conftest(cxx_add_flags) conftest(cc_load_tools) conftest(cxx_load_tools) hotssh-0.2.6+dfsg1/wafadmin/Tools/winres.py0000644000175000017500000000235311105644247017251 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,re import TaskGen,Task from Utils import quote_whitespace from TaskGen import extension EXT_WINRC=['.rc'] winrc_str='${WINRC} ${_CPPDEFFLAGS} ${_CXXDEFFLAGS} ${_CCDEFFLAGS} ${WINRCFLAGS} ${_CPPINCFLAGS} ${_CXXINCFLAGS} ${_CCINCFLAGS} ${WINRC_TGT_F}${TGT} ${WINRC_SRC_F}${SRC}' def rc_file(self,node): obj_ext='.rc.o' if self.env['WINRC_TGT_F']=='/fo ':obj_ext='.res' rctask=self.create_task('winrc') rctask.set_inputs(node) rctask.set_outputs(node.change_ext(obj_ext)) self.compiled_tasks.append(rctask) Task.simple_task_type('winrc',winrc_str,color='BLUE',before='cc cxx') def detect(conf): v=conf.env cc=os.path.basename(''.join(v['CC']).lower()) cxx=os.path.basename(''.join(v['CXX']).lower()) cc=re.sub('"','',cc) cxx=re.sub('"','',cxx) if cc in['gcc','cc','g++','c++']: winrc=conf.find_program('windres',var='WINRC') v['WINRC_TGT_F']='-o ' v['WINRC_SRC_F']='-i ' elif cc.startswith('cl.exe')or cxx.startswith('cl.exe'): winrc=conf.find_program('RC',var='WINRC') v['WINRC_TGT_F']='/fo ' v['WINRC_SRC_F']=' ' else: return 0 if not winrc: conf.fatal('winrc was not found!!') else: v['WINRC']=quote_whitespace(winrc) v['WINRCFLAGS']='' extension(EXT_WINRC)(rc_file) hotssh-0.2.6+dfsg1/wafadmin/Tools/icc.py0000644000175000017500000000316111105644247016476 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys import Configure,Options,Utils import ccroot,ar from Configure import conftest def find_icc(conf): if sys.platform=='win32': conf.find_icc_win32() else: conf.find_icc_other() def find_icc_win32(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in os.environ:cc=os.environ['CC'] if not cc:cc=conf.find_program('ICL',var='CC') if not cc:conf.fatal('Intel C Compiler (icl.exe) was not found') v['CC']=Utils.quote_whitespace(cc) v['CC_NAME']='icc' v['CXX']=v['CC'] def find_icc_other(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] elif'CC'in os.environ:cc=os.environ['CC'] if not cc:cc=conf.find_program('icc',var='CC') if not cc:conf.fatal('Intel C Compiler (icc) was not found') try: if Utils.cmd_output('%s --version'%cc).find('icc')<0: conf.fatal('icc was not found, see the result of icc --version') except ValueError: conf.fatal('icc --version could not be executed') v['CC']=cc v['CC_NAME']='icc' ccroot.get_cc_version(conf,cc,'CC_VERSION') def icc_modifier_win32(conf): if sys.platform!='win32':return v=conf.env try: v['CC_NAME']='icc' v['CPPFLAGS'].remove('/errorReport:prompt') except ValueError: pass if sys.platform=='win32': detect=''' find_icc find_msvc msvc_common_flags icc_modifier_win32 cc_load_tools cc_add_flags ''' elif sys.platform=='cygwin': conf.fatal("ICC module is not supported for cygwin. Try under native Win32") else: detect=''' find_icc find_ar gcc_common_flags gcc_modifier_darwin cc_load_tools cc_add_flags ''' conftest(find_icc) conftest(find_icc_win32) conftest(find_icc_other) conftest(icc_modifier_win32) hotssh-0.2.6+dfsg1/wafadmin/Task.pyc0000644000175000017500000006722211777064501015721 0ustar javijavi <4Ic@sddlZejdkr.ddlmZnddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlZddlZddl Z ddlZddlZddlZddlmZmZmZddlTeadefdYZd efd YZd efd YZd efdYZdefdYZdZ ej!dej"Z#dZ$dgggggdZ%gdggggdZ&dS(iNi(tSet(tmd5(tdebugterrortwarn(t*t TaskManagercBs>eZdZdZdZdZdZdZRS(cCsg|_g|_d|_dS(Ni(tgroupst tasks_donet current_group(tself((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt__init__ s  cCs_d}xR| rZ|jt|jkrZ|j|jj}|rH|S|jd7_q WdS(Ni(NN(tNoneR tlenRt get_next_set(R tret((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs"cCs>|jr'|jdj r'tdn|jjtdS(Nis,add_group: an empty group is already present(RttasksRtappendt TaskGroup(R ((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt add_groups cCs.|js|jn|jdj|dS(Ni(RRtadd_task(R ttask((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs cCs>d}|jsdSx$|jD]}|t|j7}qW|S(Ni(RR R(R ttotaltgroup((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs  cCse|jj||jj}tjrad}d|jkrT|jd}||qa|jndS(Ntinstall( RRt generatortbldtOptionst is_installR t__dict__R(R ttskRtf((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt add_finished$s    (t__name__t __module__R RRRRR (((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR s      RcBs}eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d ZRS( cCs1g|_i|_i|_g|_d|_dS(Ni(Rt cstr_groupst cstr_ordert temp_taskstready(R ((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR /s     cCsex'|jD]}|j|j|7_q W|j|j|_g|_g|_i|_d|_dS(Ni(R#RR%R$R&(R tx((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytreset5s   cCs!d|_|j|jdS(Ni(R&tmake_cstr_groupstextract_constraints(R ((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytprepare=s  cCsttkr$|j}tj}nXttkrE|j\}}n7ttkri|j}tj}nt j dt|sdS||fS(Nsunknown algorithm type %s(( talgotypetNORMALttasks_in_paralleltsystmaxintt JOBCONTROLttasks_by_max_jobst MAXPARALLELttasks_with_inner_constraintstUtilstWafError(R Rtmaxj((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRAs       cCsii|_xY|jD]N}|j}y|j|j|Wqtk r`|g|j|}y|jj|Wnt k rnX|jj|qW| r|rt j d|n|S(Ns%circular order constraint detected %r( R&R+R#RQR$tvaluesRtextendt __delitem__R9R5R6(R RQt unconnectedt remaindertuRHttoreturnRE((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR.s.        cCs|js|jn|js1|j|_n|js>dStj}g}g}x|jD]{}t|dt|jdtj}||kr|j |q]||kr||7}|g}|}q]|j |q]W||_||fS(Ntmaxjobs(NN( R&R+R%R.R R/R0tgetattrRLR(R R^Rt remainingttRM((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR2s(    $      cCs|js|jnt|ddr,dSxf|jD][}xR|j|D]C}x:|j|D]+}x"|j|D]}|j|qrWq^WqJWq6Wi|_i|_d|_|jS(Ntdonei( R&R+R_R R$R#t set_run_afterRbR(R tptvRMRN((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR4s    (R!R"R R(R+RR)RR?RIRPR*R.R2R4(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR.s          tstore_task_typecBseZdZRS(cCsZtt|j||||j}|jdrV|jdd}|tj| task failed (err #%d): %rs -> task failed: %rs -> missing files: %rRh( R_R RRttCRASHEDterr_codeRt EXCEPTIONterr_msgtMISSING(R ((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt format_errors  cCs |jj}|jd}|jdr g|jD]}|j|j^q4}|jdd}|jdr|g|jD]}|j|j^q7}n|jdr|j|jd}|j|j|d|j |q |j |j||j |ndS(NRt install_pathtchmoditsrctfilenamei( RRRBRt relpath_gentsrcnodeRRt install_astenvt install_files(R RtdR=tlsttpermtdir((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs (/#N(R!R"Rft __metaclass__RR/R0R^RmR tstatR R{R}RRRRRRRBR8RR(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRls$            tTaskcBseZgZdZdZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZdZRS(cKsAtj||||_g|_g|_g|_g|_dS(N(RlR RRRt deps_nodest run_after(R RRx((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR s     cCs|j}djg|jD]}|j|^q}djg|jD]}|j|^qG}|jrwd}nd}d|jj|||fS(Nt s -> Rhs %s: %s%s%s (RRRt nice_pathRRLR!(R RR=tsrc_strttgt_strtsep((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR}s .. c Csldjd|jjddjg|jD]}|j^q%ddjg|jD]}|j^qMdgS(NRhs {task: RRs -> t}(RRLR!RROR(R R'((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR{#scCsy |jSWntk rt}|j}||jjx(|j|jD]}||jqQW||j j |t j |j |j|_|jSXdS(N(tuidRRtupdateRtvariantRRtabspathRLR!R5th_funRtdigest(R RMtupR'((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt unique_id%s    cCs;t|tjkr'|j|7_n|jj|dS(N(ttypettypestListTypeRR(R tinp((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt set_inputs2scCs;t|tjkr'|j|7_n|jj|dS(N(RRRRR(R tout((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt set_outputs5scCs)t|tst|jj|dS(N(t isinstanceRltAssertionErrorRR(R R((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRc8scCs,|jjjj|}|jj|dS(N(RRtcurrentt find_resourceRR(R Rtnode((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytadd_file_dependency;scCsy|jdSWntk r"nXt}|j}|j||jrZ|jp]t}|j||j}|j||j }||||f|_|S(Ni( t cache_sigRRtsig_explicit_depsRtscantsig_implicit_depstSIG_NILtsig_varsR(R RMtexp_sigtimp_sigtvar_sigR((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt signature>s        c Cs|jr<|j r<t|jdds<td|q<nx|jD]}|jsFtSqFW|j }|j j }d}xa|jD]V}|j |}y|j ||j}Wqtk rtd|d}PqXqW|dkr$|jr$y|j}Wntk rtdtSXtS|j}y|j|d} Wn tk rgtd|tSX|j}tjr|j|j|n|| krtStS(NtquietsHtask is invalid : no inputs or outputs (override in a Task subclass?) %rs7task: task %r must run as the first node does not exists=task: something is wrong, computing the task signature failedisJtask: task %r must run as it was never run before or the task code changed(RRR_RLR RRRtt ASK_LATERRRRRt node_sigstidR9RRR~Rt task_sigsRtverboset debug_whytSKIP_ME( R RaRRRRRtnew_sigtkeytprev_sig((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRKsH            c Cs|jj}|j}|j}d}x|jD]}|j|}tj|j|||j ||j %s: %s %s(RRRRR (R told_sigstnew_sigsRetmsgsttmpR'((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs  cCs|jj}t}x>|jD]3}|j|j}|j|j||jqWxMt |dgD]9}|j|j}|j||j}|j|qiWy |j }Wnt k rnXx|j|j D]}y||j}Wnt k rqnXt|r|}nx|D]|}t|tjr|j|j|j|j}y|j||j}Wqt k rd}qXn|j|q%WqW|jS(Nt dep_nodesRh(RRRRRRRRRR_tdeps_manRRR9tcallableRtNodetrescantparentR(R RRMR'RRetadditional_depsR((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs<          c Cst}|jj}|j}|j||jj}|j|t}t |dd}|r|j||}|j|nx[t |jddD]D}||}|r|jt |t |t |f} qqW|j S(Ntdep_varstvars((RRRRt hash_env_varsRLR RRR_R RzRR( R RMRRtact_sigRR R'RHtvars_sig((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs      cCs|jj}|j}|jj|d}|rly"|d|jkrT|dSWqltk rhqlXn|j\}}tj rtj rt dt |t |t |fn||j |j<||j|j<|j}|S(Nis#deps: scanner for %s returned %s %s((RRRRRvtcompute_sig_implicit_depsR9RRRtzonesRRzt node_depstraw_deps(R RRt prev_sigstnodesRR((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs     , cCst}|j}|jj}|j}|j}x|jj|jg|j D]w}|j j |j kr|j |j n|j d@tjkr||d|j qS|||j|j qSW|jS(Nii(RRRRRRRRvRRRRtcache_scanned_foldersRRtFILERR(R RMtupdRttstampRRH((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs     )N(R!R"R R R}R{RRRRcRRRRRRRRR RRR(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyRs&        $    cBs |dUeS(N(R(tc((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytfunexss;(?P\$\$)|(?P\$\{(?P\w+)(?P.*?)\})c s-gfd}tj||}g}g}|j}xD]\}}|dkr|rr|d|q|dqC|dkr|r|d|q|dqC||kr|j|n|d|qCW|rd d j|}nd }d ||f}td |t||fS(NcsL|j}|drdS|drHj|d|dfdSdS(Ntdollart$tsubsttvartcodes%s(RRR (tmatchtg(textr(sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytrepls   tSRCs task.inputs%ss/" ".join([a.srcpath(env) for a in task.inputs])tTGTstask.outputs%ss0" ".join([a.bldpath(env) for a in task.outputs])sp('%s')s%% (%s) s, Rhsl def f(task): env = task.env p = env.get_flat cmd = "%s" %s return task.generator.bld.exec_command(cmd) s action: %s(treg_acttsubRRRR( ROtlineR"tparmtdvarstappRtmethR((R!sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyt compile_funs0      Rqc CsCt||\}} ||_t|||p0| |||||S(N(R,Rttask_type_from_func( ROR'RR R@RARKRJRyR)((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pytsimple_task_types c Csi|d6|d6|d6|d6tj|d6tj|d6tj|d6tj|d6}tj|tf|} | tj|<| S( NRR RROR@RARKRJ(R5tto_listtnewtclassobjRRlRm( ROtfuncR RR@RARKRJtparamsRn((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyR-sb ('R/t hexversiontsetsRR<RRRtreR0trandomRR5RRutRunnerRRRRRRt ConstantsR-R,tobjectRRRRfRlRRtcompiletMR%R,R.R-(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Task.pyts$ `H #X  hotssh-0.2.6+dfsg1/wafadmin/Options.pyc0000644000175000017500000001661411777064501016451 0ustar javijavi HIc@sddlZddlZddlZddlZddlZddlmZddlZddlZddl Tdj Z ia ia dZdZejjddZyejjejdZWnek rdZnXejZd eefZeaejjd Zes<ed kr3ejZq<d Znejjd dZedkryej dZWqe!ejjddZqXnejjddZ"dZ#ddZ%de&fdYZ'dS(iN(t OptionParser(t*sFdist configure clean distclean build install uninstall check distcheckttWAFLOCKs .lock-wscripttWAFCACHEsconf-runs-%s-%d.pickletPREFIXtwin32s /usr/local/tJOBSitSC_NPROCESSORS_ONLNtNUMBER_OF_PROCESSORStDESTDIRc Cs tjdtddddddt}tj|j_|j}|dd d d d t d dt dd|ddddd t d ddd|ddddd t d ddd|ddddd dd ddd |d!d"ddd dd d#dd$|d%d d&t d t dd'|d(ddd t d d)dd*d+t j kr|d,d-dd.d d/d d0dd1|d2d3dd.d d/d d4dd5|d6d d7td tdd8n|d9dd.d d/d d:dd;|d<dd.d d/d d=dd>|S(?Ns options: create_parser is calledtconflict_handlertresolvetusageswaf [options] [commands ...] * Main commands: configure build install clean dist distclean uninstall distcheck * Example: ./waf build -j4tversionswaf %ss-js--jobsttypetinttdefaultthelps%amount of parallel jobs [Default: %s]tdesttjobss-fs--forcetactiont store_truesforce file installationtforces-ks--keeps/keep running happily on independent task groupstkeeps-ps --progresstcountis!-p: progress bar; -pp: ide outputt progress_bars-vs --verboses+verbosity level -v -vv or -vvv [Default: 0]tverboses --destdirs!installation root [Default: '%s']tdestdirs --nocaches+compile everything, even if WAFCACHE is settnocachet configures-bs--blddirtstoreRs)build dir for the project (configuration)tblddirs-ss--srcdirs'src dir for the project (configuration)tsrcdirs--prefixs8installation prefix (configuration only) [Default: '%s']tprefixs--zoness,debugging zones (task_gen, deps, tasks, etc)tzoness --targetssNcompile the targets given only [targets in CSV format, e.g. "target1,target2"]tcompile_targets(tLogstdebugRt WAFVERSIONtUtilst get_term_colst formattertwidtht add_optiont default_jobstFalsetdefault_destdirtsystargvtdefault_prefix(tparsertp((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Options.pyt create_parsers&   )%%%% "%%#""cCs|jd|\a}iaxtD]}dt|R?t launch_dirRjtenvirontgettlockfileRYtabspatht cache_globaltKeyErrortdetect_platformtplatformtABIt conf_fileR.RFR2t gettempdirR-tsysconfRR/R5RyRLtobjectRM(((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Options.pyts><       "  hotssh-0.2.6+dfsg1/wafadmin/Logs.pyc0000644000175000017500000001261611777064501015720 0ustar javijavi {Hc@sddlZddlZddlZddlZddlZddlZddlTdZdZi e d6dd6dd 6d d 6d d 6dd6dd6dd6dd6dd6dd6Z ej dksdej ksej j ddd*ksejj ree dd|j|j|jfStjj||S(Ns%s%s%s( R%R&tWARNINGR'R"R,R#R7tformat(RR2((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pyR;/s$(RRRR;(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pyR6,s cCs,|jdd}tr(tj|ndS(Ns t (treplaceR0R&tdebug(R,((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pyR>3scCstj|trt|tjr1|j}n tj}|r|d }g}xT|D]L\}}}}|j d|||f|rZ|j d|j qZqZW|rtjdj |qqndS(Nis File "%s", line %d, in %ss %ss ( R&terrorR0t isinstancetUtilstWafErrortstackt tracebackt extract_stacktappendtstriptjoin(R,tsttbuftfilenametlinenoRtline((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pyR?7s    cCsbtj}g|_tj}|jt|j||jt|j tj dS(N( R&t getLoggerthandlerst StreamHandlert setFormatterR6t addHandlert addFilterRtsetLeveltDEBUG(tlogthdlr((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pytinit_logHs    (RR(!tostreR&RDtsysRAt ConstantsR.R0R)RtplatformtenvironRtstdouttisattyR1RtobjectRR!tcompiletMR*tFilterRR7R6R>R?twarntinfoRX(((sl/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Logs.pyts"H SI       hotssh-0.2.6+dfsg1/wafadmin/Options.py0000644000175000017500000001145511105644247016300 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,imp,types,tempfile from optparse import OptionParser import Logs,Utils from Constants import* cmds='dist configure clean distclean build install uninstall check distcheck'.split() options={} commands={} launch_dir='' tooldir='' lockfile=os.environ.get('WAFLOCK','.lock-wscript') try:cache_global=os.path.abspath(os.environ['WAFCACHE']) except KeyError:cache_global='' platform=Utils.detect_platform() conf_file='conf-runs-%s-%d.pickle'%(platform,ABI) is_install=False default_prefix=os.environ.get('PREFIX') if not default_prefix: if platform=='win32':default_prefix=tempfile.gettempdir() else:default_prefix='/usr/local/' default_jobs=os.environ.get('JOBS',-1) if default_jobs<1: try: default_jobs=os.sysconf('SC_NPROCESSORS_ONLN') except: default_jobs=int(os.environ.get('NUMBER_OF_PROCESSORS',1)) default_destdir=os.environ.get('DESTDIR','') def create_parser(): Logs.debug('options: create_parser is called') parser=OptionParser(conflict_handler="resolve",usage="""waf [options] [commands ...] * Main commands: configure build install clean dist distclean uninstall distcheck * Example: ./waf build -j4""",version='waf %s'%WAFVERSION) parser.formatter.width=Utils.get_term_cols() p=parser.add_option p('-j','--jobs',type='int',default=default_jobs,help="amount of parallel jobs [Default: %s]"%default_jobs,dest='jobs') p('-f','--force',action='store_true',default=False,help='force file installation',dest='force') p('-k','--keep',action='store_true',default=False,help='keep running happily on independent task groups',dest='keep') p('-p','--progress',action='count',default=0,help='-p: progress bar; -pp: ide output',dest='progress_bar') p('-v','--verbose',action='count',default=0,help='verbosity level -v -vv or -vvv [Default: 0]',dest='verbose') p('--destdir',help="installation root [Default: '%s']"%default_destdir,default=default_destdir,dest='destdir') p('--nocache',action='store_true',default=False,help='compile everything, even if WAFCACHE is set',dest='nocache') if'configure'in sys.argv: p('-b','--blddir',action='store',default='',help='build dir for the project (configuration)',dest='blddir') p('-s','--srcdir',action='store',default='',help='src dir for the project (configuration)',dest='srcdir') p('--prefix',help="installation prefix (configuration only) [Default: '%s']"%default_prefix,default=default_prefix,dest='prefix') p('--zones',action='store',default='',help='debugging zones (task_gen, deps, tasks, etc)',dest='zones') p('--targets',action='store',default='',help='compile the targets given only [targets in CSV format, e.g. "target1,target2"]',dest='compile_targets') return parser def parse_args_impl(parser,_args=None): global options,commands (options,args)=parser.parse_args(args=_args) commands={} for var in cmds:commands[var]=0 if len(args)==0:commands['build']=1 for arg in args: arg=arg.strip() if arg in cmds: commands[arg]=True else: print'Error: Invalid command specified ',arg parser.print_help() sys.exit(1) if commands['check']: commands['build']=True if commands['install']or commands['uninstall']: global is_install is_install=True if options.keep:options.jobs=1 if options.jobs<1:options.jobs=1 Logs.verbose=options.verbose Logs.init_log() if options.zones: Logs.zones=options.zones.split(',') if not Logs.verbose:Logs.verbose=1 elif Logs.verbose==1: Logs.zones=['runner'] class Handler(object): parser=None def __init__(self): self.parser=create_parser() self.cwd=os.getcwd() Handler.parser=self def add_option(self,*kw,**kwargs): self.parser.add_option(*kw,**kwargs) def add_option_group(self,*args,**kwargs): return self.parser.add_option_group(*args,**kwargs) def get_option_group(self,opt_str): return self.parser.get_option_group(opt_str) def sub_options(self,dir,option_group=None): try: current=self.cwd self.cwd=os.path.join(self.cwd,dir) cur=os.path.join(self.cwd,WSCRIPT_FILE) mod=Utils.load_module(cur) if not hasattr(mod,'set_options'): msg="the module %s has no set_options function;\n* make sure such a function is defined\n* run configure from the root of the project"%cur raise Utils.WscriptError(msg) else: fun=mod.set_options fun(option_group or self) finally: self.cwd=current def tool_options(self,tool,tdir=None,option_group=None): if type(tool)is types.ListType: for i in tool:self.tool_options(i,tdir,option_group) return if not tdir:tdir=tooldir tdir=Utils.to_list(tdir) try: file,name,desc=imp.find_module(tool,tdir) except ImportError: raise Utils.WscriptError("no tool named '%s' found"%tool) module=imp.load_module(tool,file,name,desc) try: fun=module.set_options except AttributeError: pass else: fun(option_group or self) def parse_args(self,args=None): parse_args_impl(self.parser,args) hotssh-0.2.6+dfsg1/wafadmin/Constants.py0000644000175000017500000000136111115036226016605 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 HEXVERSION=0x10501 WAFVERSION="1.5.1" ABI=6 CACHE_DIR='c4che' CACHE_SUFFIX='.cache.py' DBFILE='.wafpickle-%d'%ABI WSCRIPT_FILE='wscript' WSCRIPT_BUILD_FILE='wscript_build' WAF_CONFIG_LOG='config.log' WAF_CONFIG_H='config.h' SIG_NIL='iluvcuteoverload' VARIANT='_VARIANT_' DEFAULT='default' SRCDIR='srcdir' BLDDIR='blddir' APPNAME='APPNAME' VERSION='VERSION' DEFINES='defines' UNDEFINED='#undefined#variable#for#defines#' BREAK="break" CONTINUE="continue" JOBCONTROL="JOBCONTROL" MAXPARALLEL="MAXPARALLEL" NORMAL="NORMAL" NOT_RUN=0 MISSING=1 CRASHED=2 EXCEPTION=3 SKIPPED=8 SUCCESS=9 ASK_LATER=-1 SKIP_ME=-2 RUN_ME=-3 LOG_FORMAT="%(asctime)s %(c1)s%(zone)s%(c2)s %(message)s" HOUR_FORMAT="%H:%M:%S" TEST_OK=True hotssh-0.2.6+dfsg1/wafadmin/Configure.py0000644000175000017500000001227711115036226016562 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,types,imp,cPickle import Environment,Utils,Options from Logs import warn from Constants import* class ConfigurationError(Utils.WscriptError): pass autoconfig=False def find_file(filename,path_list): if type(path_list)is types.StringType: lst=path_list.split() else: lst=path_list for directory in lst: if os.path.exists(os.path.join(directory,filename)): return directory return'' def find_program_impl(env,filename,path_list=[],var=None): try:path_list=path_list.split() except AttributeError:pass if var: if var in os.environ:env[var]=os.environ[var] if env[var]:return env[var] if not path_list:path_list=os.environ['PATH'].split(os.pathsep) ext=(Options.platform=='win32')and'.exe,.com,.bat,.cmd'or'' for y in[filename+x for x in ext.split(',')]: for directory in path_list: x=os.path.join(directory,y) if os.path.isfile(x): x=Utils.quote_whitespace(x) if var:env[var]=x return x return'' class ConfigurationContext(object): tests={} error_handlers=[] def __init__(self,env=None,blddir='',srcdir=''): self.env=None self.envname='' self.line_just=40 self.blddir=blddir self.srcdir=srcdir self.cachedir=os.path.join(blddir,CACHE_DIR) self.all_envs={} self.defines={} self.cwd=os.getcwd() self.tools=[] self.setenv(DEFAULT) self.lastprog='' self.hash=0 self.files=[] path=os.path.join(self.blddir,WAF_CONFIG_LOG) try:os.unlink(path) except(OSError,IOError):pass self.log=open(path,'wb') def __del__(self): if hasattr(self,'log')and self.log: self.log.close() def fatal(self,msg): raise ConfigurationError(msg) def check_tool(self,input,tooldir=None,funs=None): tools=Utils.to_list(input) if tooldir:tooldir=Utils.to_list(tooldir) for tool in tools: try: file,name,desc=imp.find_module(tool,tooldir) except ImportError: self.fatal("no tool named '%s' found."%tool) module=imp.load_module(tool,file,name,desc) func=getattr(module,'detect',None) if func: if type(func)is types.FunctionType:func(self) else:self.eval_rules(funs or func) self.tools.append({'tool':tool,'tooldir':tooldir,'funs':funs}) def sub_config(self,dir): current=self.cwd self.cwd=os.path.join(self.cwd,dir) cur=os.path.join(self.cwd,WSCRIPT_FILE) mod=Utils.load_module(cur) if not hasattr(mod,'configure'): self.fatal('the module %s has no configure function; make sure such a function is defined'%cur) ret=mod.configure(self) global autoconfig if autoconfig: self.hash=Utils.hash_function_with_globals(self.hash,mod.configure) self.files.append(os.path.abspath(cur)) self.cwd=current return ret def store(self,file=''): if not os.path.isdir(self.cachedir): os.makedirs(self.cachedir) if not file: file=open(os.path.join(self.cachedir,'build.config.py'),'w') file.write('version = 0x%x\n'%HEXVERSION) file.write('tools = %r\n'%self.tools) file.close() if not self.all_envs: self.fatal('nothing to store in the configuration context!') for key in self.all_envs: tmpenv=self.all_envs[key] tmpenv.store(os.path.join(self.cachedir,key+CACHE_SUFFIX)) def set_env_name(self,name,env): self.all_envs[name]=env return env def retrieve(self,name,fromenv=None): try: env=self.all_envs[name] except KeyError: env=Environment.Environment() self.all_envs[name]=env else: if fromenv:warn("The environment %s may have been configured already"%name) return env def setenv(self,name): self.env=self.retrieve(name) self.envname=name def add_os_flags(self,var,dest=None): if not dest:dest=var try:self.env[dest]=os.environ[var] except KeyError:pass def check_message_1(self,sr): self.line_just=max(self.line_just,len(sr)) self.log.write(sr+'\n\n') print"%s :"%sr.ljust(self.line_just), def check_message_2(self,sr,color='GREEN'): Utils.pprint(color,sr) def check_message(self,th,msg,state,option=''): sr='Checking for %s %s'%(th,msg) self.check_message_1(sr) p=self.check_message_2 if state:p('ok '+option) else:p('not found','YELLOW') def check_message_custom(self,th,msg,custom,option='',color='PINK'): sr='Checking for %s %s'%(th,msg) self.check_message_1(sr) self.check_message_2(custom,color) def find_program(self,filename,path_list=[],var=None): ret=find_program_impl(self.env,filename,path_list,var) self.check_message('program',filename,ret,ret) return ret def __getattr__(self,name): r=self.__class__.__dict__.get(name,None) if r:return r if name and name.startswith('require_'): for k in['check_','find_']: n=name.replace('require_',k) ret=self.__class__.__dict__.get(n,None) if ret: def run(*k,**kw): r=ret(self,*k,**kw) if not r: self.fatal('requirement failure') return r return run self.fatal('No such method %r'%name) def eval_rules(self,rules): self.rules=Utils.to_list(rules) for x in self.rules: f=getattr(self,x) try: f() except Exception,e: ret=self.err_handler(x,e) if ret==BREAK: break elif ret==CONTINUE: continue else: raise def err_handler(self,fun,error): pass def conf(f): setattr(ConfigurationContext,f.__name__,f) return f def conftest(f): ConfigurationContext.tests[f.__name__]=f return conf(f) hotssh-0.2.6+dfsg1/wafadmin/TaskGen.pyc0000644000175000017500000003734411777064501016355 0ustar javijavi HIc @sddlZejdkr.ddlmZnddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddl mZmZmZddlTi dd6dd 6d d 6d d 6dd6dd6dd6dd6dd6ZdefdYZdefdYZdZdZdddddddggdd Zd Zd!Zd"Zd#Zd$Zd%Z dS(&iNi(tSet(tdebugterrortwarn(t*tsourcetsourcesttargetttargetstincludestincludetdefinestdefinet importpathst importpatht install_patht install_vartinstall_subdirtinst_vartinst_dirt register_objcBseZdZRS(cCsZtt|j||||j}d}|j|rV|tj|j|d(RRt __class__RtstrR6(R=((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt__str__.scCshtj||}||krQtd||ftjdkrQtjqQntj|||dS(Ns typo %s -> %si( ttyposR2RtLogstverboset tracebackt print_stacktobjectt __setattr__(R=Rtattrtreal((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyRK0s  cCs't|tjkr|jS|SdS(N(ttypettypest StringTypetsplit(R=tvalue((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytto_list7s cCs.|jj}x|j|jD]r}|j|}|rJ|||q||}|stjd|t|jfn|jj |qWx|jD]}|j }t d|j d}|j||}|stjdt|t|j t|j jfn|||qWdS(Nssource not found: '%s' in '%s'it.s4Do not know how to process %s in %s, mappings are %s(R6t find_resourceRSRtget_hooktUtilstWafErrorRCR1R8RtmaxtrfindRBR'(R=RUtfilenametxtnodetk((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt apply_core:s   % :c Csnt|j}tj|j|_x4|jdgD]"}|jtjj|dq5Wi}|j pptj }x+|D]#}||krz|||| %s (%d)((tsetR&RWRSR)tupdateRttraitsR2R%tvaluesR8tpoptKeyErrorRXRCtreverseR_RRR:tgetattrtAttributeError( R=tkeysR\R%tprec_tblttmptatouttetnlsttytv((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytapplyKsX               cCsV|js|j|_nt|ddr.dS|jtd|jt|_dS(Ntpostedstask_gen: posted %s(RRRgR,RrRtTrueRs(R=((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytpostws  cCsKy|j|SWn5tk rFytj|SWqGtk rBdSXnXdS(N(R'ReRR,(R=text((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyRV~s  cCs9tjj||p|jd|}|jj||S(Nt generator(tTasktTaskBaseRR4R*R8(R=RR4ttask((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt create_tasks%cCs|jj||jS(N(R$t name_to_objR4(R=R((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyR|sc Csg}d}d}||r7tj|dn||rYtj|dn|j|}|p|jjtjj}x|D]}|jj|} | s| j|j j  rtjd||j j fn|j j | x|j j | j D]r}tjj|\} } | |kr ||kr ||kr |j| j|jpidtjj|q q WqW|j|j|j|_|js||_n|j|7_dS(Nsp'%s' attribute must be a list. Directories should be given either as a string separated by spaces, or as a list.cSs|ot|tjk S(N(RNROtListType(R\((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytstexcludestextssXUnable to use '%s' - either because it's not a relative path, or it's not child of '%s'.RT(RWt WscriptErrorRSR'RiRR6tfind_dirt is_child_ofR$tsrcnodetrescantcache_dir_contentsR:tostsplitextR8t relpath_gentseptsortR( R=tdirnamesRRtlstterr_msgt not_a_listtext_lstRtanodetbaseRv((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytfind_sources_in_dirss.   " "$8  cCstd|j}xm|jD]b}|dkr4qq|dkr\t||t||qt||tjt||qW|j|_t|tj kr|jj |j|_ n|j|_ |jj j ||S(NR$R4R6R)(senv(spathsfeatures(RR$t__dict__R<RgR5RBRNRORPtall_envsR4R7R8(R=R4tnewobjR\((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pytclones  & cCst|dt|ddS(Nt _install_pathR-R(Rg(R=((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt get_inst_pathscCs ||_dS(N(R(R=RA((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt set_inst_pathscCst|dt|ddS(Nt_chmodR+i(Rg(R=((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt get_chmodscCs ||_dS(N(R(R=RA((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyt set_chmodsN(RR#Rt __metaclass__R'tmappedR%RbRR9RRDRKRSR_RrRuRVR,R{R|RRRRtpropertyRRRtchmod(((so/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/TaskGen.pyRs2      ,         cCsYy"x|D]}|tj|s$ 0< E  '   hotssh-0.2.6+dfsg1/wafadmin/Utils.pyc0000644000175000017500000004075111777064501016115 0ustar javijavi <4Ic@sddlZejdkr.ddlmZnddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl m Z ddlZddlZddlTejdkZdefdYZd efd YZerd pd Zy2dd lmZddlZde_dZWnRek ryddlmZWn!ek rddlmZnXdZnXde fdYZdddZ ere Z!dddZ nej"Z"erdZ#e#Z"ndddZ$dZ%dZ&dZ'iZ(da)e*dZ+dZ,d Z-d!Z.y(ddl/Z/ddl0Z0ddl1Z1Wnek rnAXej2j3rd"Z4y e4Wne5k rqXe4Z.nd#Z6d$d%d&d'gZ7d(Z8erd)Z8d*Z9ne:d+Z;d,Z<da=d-Z>d.Z?d/Z@d0ZAd1ZBejCejDejEejFejGejHfZId2ZJd3d4ZKd5ZLde:d6ZMe jNd7ZOd8ZPd9ZQdS(:iNi(tSet(tUserDict(t*twin32tWafErrorcBseZdZdZRS(cGs,||_tj|_tj||dS(N(targst tracebackt extract_stacktstackt Exceptiont__init__(tselfR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR s cCs/tt|jdkr%|jdp+|jS(Nii(tstrtlenR(R ((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt__str__s(t__name__t __module__R R(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR s t WscriptErrorcBseZddZdZRS(cCs|r||_d|_n|j\|_|_d}|jrod|j}|jro|d|j7}qond||f}tj||dS(Nts%s:s %s error: %s(t wscript_filetNonet wscript_linet locate_errorRR (R tmessageRt msg_file_linet err_message((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR s     cCsqtj}|jxT|D]L}tjj|d}|tkpN|tk}|r|d|dfSqWdS(Nii(NN( RRtreversetostpathtbasenamet WSCRIPT_FILEtWSCRIPT_BUILD_FILER(R Rtframet file_namet is_wscript((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyRs   N(RRRR R(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyRs s %s%s%s s %s%s%s (tnewtsignofnvcCsgt}y9|j||j}|dkr=tdn|SWntk rbtd|nXdS(Ns not a file(tmd5thfiletdigestRtOSErrort SystemError(tfilenametmtx((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyth_file-s     (R%cCsgt|d}t}d}x2|rR|j|}|j|t|}q!W|j|jS(Ntrbi(tfileR%treadtupdateR tcloseR'(R*tfR+t readBytest readString((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR-;s    t ordered_dictcBs&eZddZdZdZRS(cCsg|_tj||dS(N(tallkeysRR (R tdict((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR Fs cCs$|jj|tj||dS(N(R7tremoveRt __delitem__(R tkey((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR:IscCs9||jkr"|jj|ntj|||dS(N(R7tappendRt __setitem__(R R;titem((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR=LsN(RRRR R:R=(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyR6Es  icCs+tj|d|d|d|}|jS(Ntshelltstdouttstderr(tpproctPopentwait(tsR?tlogtproc((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt exec_commandOs!cCskt|dkr(t|d|d|Stj}|jtjO_tj|dtd|}|jS(NiR?RFt startupinfo( R told_logRBt STARTUPINFOtdwFlagstSTARTF_USESHOWWINDOWRCtFalseRD(RER?RFRIRG((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyRHTs  cCs_tjd|r"|tj7}ntjj|sRt}tj|_|ntj |S(Ns^[A-Z]:$( tretmatchRtsepRtisdirR(terrnotENOENTtlistdir(REte((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt listdir_win32\s   iicCst}y|d}Wn,tk rBt|jddd}nX||krvtjd||ftjdny|d}Wn,tk rt|jddd}nX||krtjd||ftjdndS(Nit.t0is,waf version should be at least %s (%s found)s+waf version should be at most %s (%s found)(t HEXVERSIONt TypeErrortinttreplacetLogsterrortsystexit(tminitmaxitvertmin_valtmax_val((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt waf_versiones    cCstjdkrtdndS(NisAWaf requires Python >= 2.3 but the raw source requires Python 2.4(R`t hexversiont ImportError(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytpython_24_guardqscCs7tj\}}}tj|||}dj|S(NR(R`texc_infoRtformat_exceptiontjoin(texc_typet exc_valuettbt exc_lines((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytex_stacktscCs't|tjkr|S|jSdS(N(ttypettypestListTypetsplit(tsth((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytto_listxscBsy e|SWnek rnXej|}ye|d}Wn'eefk rked|nXej j |}e j j d|||j Ue j j||r|jn|e|<|S(Ntrs The file %s could not be opened!i(tg_loaded_modulestKeyErrortimpt new_moduletopentIOErrorR(RRRtdirnameR`tinsertt__dict__R9R2(t file_pathtnametmoduleR/t module_dir((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt load_modules"     cCst|dadS(Nt wscript_main(Rtg_module(R((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytset_main_modulescCsWi}|jd}x;|D]3}|s.qn|jd}|d||d %rR(RBRCtPIPEtTruet communicatet returncodeR t ValueError(tcmdRVtsilenttptoutputtmsg((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt cmd_outputs$   s(\\\\)|(\\\$)|\$\{([^}]+)\}csfd}tj||S(Ncs7|jdrdS|jdr&dS|jdS(Nis\it$i(tgroup(R+(tparams(sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytrepl_vars (t reg_substtsub(texprRR((Rsm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyt subst_varsscCsYtj}x-djD]}|j|dkr|SqWtjdjkrUtjS|S(Ns'cygwin linux irix sunos hpux aix darwinisposix java os2(R`tplatformRvRRR(RER,((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pytdetect_platform s (RR`RhtsetsRRRR|RtRRSRRRORR^RBt ConstantsRtis_win32R RRt indicatortfnvR#R%tSIG_NILR-RithashlibR6RRHRJRURWRgRjRrRxRzRRRRRRRRRR@tisattyRRtrot_idxtrot_chrRRRNRRRRRRRRtBuiltinFunctionTypet ModuleTypeRt ClassTypetTypeTypetNoneTypeRRRRRtcompileRRR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Utils.pyts l                 (               *    hotssh-0.2.6+dfsg1/wafadmin/Constants.pyc0000644000175000017500000000253711777064501016771 0ustar javijavi <4Ic@sdZdZdZdZdZdeZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"e#Z$d#S($is1.5.1itc4ches .cache.pys .wafpickle-%dtwscriptt wscript_builds config.logsconfig.htiluvcuteoverloadt _VARIANT_tdefaulttsrcdirtblddirtAPPNAMEtVERSIONtdefiness #undefined#variable#for#defines#tbreaktcontinuet JOBCONTROLt MAXPARALLELtNORMALiiiiii iiis,%(asctime)s %(c1)s%(zone)s%(c2)s %(message)ss%H:%M:%SN(%t HEXVERSIONt WAFVERSIONtABIt CACHE_DIRt CACHE_SUFFIXtDBFILEt WSCRIPT_FILEtWSCRIPT_BUILD_FILEtWAF_CONFIG_LOGt WAF_CONFIG_HtSIG_NILtVARIANTtDEFAULTtSRCDIRtBLDDIRRR tDEFINESt UNDEFINEDtBREAKtCONTINUER RRtNOT_RUNtMISSINGtCRASHEDt EXCEPTIONtSKIPPEDtSUCCESSt ASK_LATERtSKIP_MEtRUN_MEt LOG_FORMATt HOUR_FORMATtTruetTEST_OK(((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Constants.pytsF hotssh-0.2.6+dfsg1/wafadmin/Scripting.py0000644000175000017500000002230111115036226016570 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,shutil,traceback,time import Utils,Configure,Build,Logs,Options,Environment from Logs import error,warn,info from Constants import* g_gz='bz2' def add_subdir(dir,bld): try:bld.rescan(bld.path) except OSError:raise Utils.WscriptError("No such directory "+bld.path.abspath()) old=bld.path new=bld.path.find_dir(dir) if new is None: raise Utils.WscriptError('subdir not found (%s), restore is %s'%(dir,bld.path)) bld.path=new try: file_path=os.path.join(new.abspath(),WSCRIPT_BUILD_FILE) file=open(file_path,'r') exec file if file:file.close() except IOError: file_path=os.path.join(new.abspath(),WSCRIPT_FILE) module=Utils.load_module(file_path) module.build(bld) bld.path=old def configure(): err='The %s is not given in %s:\n * define a top level attribute named "%s"\n * run waf configure --%s=xxx' src=getattr(Options.options,SRCDIR,None) if not src:src=getattr(Utils.g_module,SRCDIR,None) if not src:raise Utils.WscriptError(err%(SRCDIR,os.path.abspath('.'),SRCDIR,SRCDIR)) src=os.path.abspath(src) bld=getattr(Options.options,BLDDIR,None) if not bld:bld=getattr(Utils.g_module,BLDDIR,None) if not bld:raise Utils.WscriptError(err%(BLDDIR,os.path.abspath('.'),BLDDIR,BLDDIR)) bld=os.path.abspath(bld) try:os.makedirs(bld) except OSError:pass conf=Configure.ConfigurationContext(srcdir=src,blddir=bld) conf.sub_config('') conf.store() env=Environment.Environment() env[BLDDIR]=bld env[SRCDIR]=src env['argv']=sys.argv env['hash']=conf.hash env['files']=conf.files env['commands']=Options.commands env['options']=Options.options.__dict__ env.store(Options.lockfile) def prepare_impl(t,cwd,ver,wafdir): Options.tooldir=[t] Options.launch_dir=cwd if'--version'in sys.argv: opt_obj=Options.Handler() opt_obj.parse_args() sys.exit(0) msg1='Waf: *** Nothing to do! Please run waf from a directory containing a file named "%s"'%WSCRIPT_FILE build_dir_override=None candidate=None cwd=Options.launch_dir lst=os.listdir(cwd) search_for_candidate=True if WSCRIPT_FILE in lst: candidate=cwd elif'configure'in sys.argv and not WSCRIPT_BUILD_FILE in lst: calldir=os.path.abspath(os.path.dirname(sys.argv[0])) if WSCRIPT_FILE in os.listdir(calldir): candidate=calldir search_for_candidate=False else: error('arg[0] directory does not contain a wscript file') sys.exit(1) build_dir_override=cwd while search_for_candidate: if len(cwd)<=3: break dirlst=os.listdir(cwd) if WSCRIPT_FILE in dirlst: candidate=cwd if'configure'in sys.argv and candidate: break if Options.lockfile in dirlst: break cwd=cwd[:cwd.rfind(os.sep)] if not candidate: if'-h'in sys.argv or'--help'in sys.argv: warn('No wscript file found: the help message may be incomplete') opt_obj=Options.Handler() opt_obj.parse_args() else: error(msg1) sys.exit(0) os.chdir(candidate) Utils.set_main_module(os.path.join(candidate,WSCRIPT_FILE)) if build_dir_override: d=getattr(Utils.g_module,BLDDIR,None) if d: msg=' Overriding build directory %s with %s'%(d,build_dir_override) warn(msg) Utils.g_module.blddir=build_dir_override opt_obj=Options.Handler() opt_obj.sub_options('') opt_obj.parse_args() fun=getattr(Utils.g_module,'init',None) if fun:fun() for x in['dist','distclean','distcheck']: if Options.commands[x]: fun=getattr(Utils.g_module,x,None) if fun: fun() else: eval(x+'()') sys.exit(0) main() def prepare(t,cwd,ver,wafdir): if WAFVERSION!=ver: msg='Version mismatch: waf %s <> wafadmin %s (wafdir %s)'%(ver,WAFVERSION,wafdir) print'\033[91mError: %s\033[0m'%msg sys.exit(1) try: prepare_impl(t,cwd,ver,wafdir) except Utils.WafError,e: error(e) sys.exit(1) def main(): if Options.commands['configure']: ini=time.time() configure() ela='' if not Options.options.progress_bar:ela=time.strftime(' (%H:%M:%S)',time.gmtime(time.time()-ini)) info('Configuration finished successfully%s; project is now ready to build.'%ela) sys.exit(0) bld=Build.BuildContext() try: proj=Environment.Environment(Options.lockfile) except IOError: if Options.commands['clean']: raise Utils.WafError("Nothing to clean (project not configured)") else: if Configure.autoconfig: warn("Reconfiguring the project") configure() bld=Build.BuildContext() proj=Environment.Environment(Options.lockfile) else: raise Utils.WafError("Project not configured (run 'waf configure' first)") if Configure.autoconfig: if not Options.commands['clean']and not Options.commands['uninstall']: reconf=0 h=0 try: for file in proj['files']: mod=Utils.load_module(file) h=Utils.hash_function_with_globals(h,mod.configure) reconf=(h!=proj['hash']) except Exception,ex: warn("Reconfiguring the project (an exception occurred: %s)"%(str(ex),)) reconf=1 if reconf: warn("Reconfiguring the project (the configuration has changed)") back=(Options.commands,Options.options,Logs.zones,Logs.verbose) Options.commands=proj['commands'] Options.options.__dict__=proj['options'] configure() (Options.commands,Options.options,Logs.zones,Logs.verbose)=back bld=Build.BuildContext() proj=Environment.Environment(Options.lockfile) bld.load_dirs(proj[SRCDIR],proj[BLDDIR]) bld.load_envs() f=getattr(Utils.g_module,'build',None) if f: f(bld) else: main_wscript=None for(file_path,module)in Utils.g_loaded_modules.items(): if module.__name__=='wscript_main': main_wscript=file_path break raise Utils.WscriptError("Could not find the function 'def build(bld).'",main_wscript) pre_build=getattr(Utils.g_module,'pre_build',None) if pre_build:pre_build() if Options.commands['build']or Options.is_install: if Options.commands['uninstall']: import Task def runnable_status(self): return SKIP_ME setattr(Task.Task,'runnable_status',runnable_status) ini=time.time() bld.compile() if Options.options.progress_bar:print'' if Options.is_install: bld.install() ela='' if not Options.options.progress_bar: ela=time.strftime(' (%H:%M:%S)',time.gmtime(time.time()-ini)) if Options.commands['install']:msg='Compilation and installation finished successfully%s'%ela elif Options.commands['uninstall']:msg='Uninstallation finished successfully%s'%ela else:msg='Compilation finished successfully%s'%ela info(msg) if Options.commands['clean']: try: bld.clean() info('Cleaning finished successfully') finally: bld.save() fun=getattr(Utils.g_module,'shutdown',None) if fun:fun() excludes='.bzr .bzrignore .git .gitignore .svn CVS .cvsignore .arch-ids {arch} SCCS BitKeeper .hg Makefile Makefile.in config.log'.split() dist_exts='~ .rej .orig .pyc .pyo .bak .tar.bz2 tar.gz .zip .swp'.split() def dont_dist(name,src,build_dir): global excludes,dist_exts if(name.startswith(',,')or name.startswith('++')or name.startswith('.waf-1.')or(src=='.'and name==Options.lockfile)or name in excludes or name==build_dir): return True for ext in dist_exts: if name.endswith(ext): return True return False def copytree(src,dst,build_dir): names=os.listdir(src) os.makedirs(dst) for name in names: srcname=os.path.join(src,name) dstname=os.path.join(dst,name) if dont_dist(name,src,build_dir): continue if os.path.isdir(srcname): copytree(srcname,dstname,build_dir) else: shutil.copy2(srcname,dstname) def distclean(): lst=os.listdir('.') for f in lst: if f==Options.lockfile: try: proj=Environment.Environment(f) shutil.rmtree(proj[BLDDIR]) except(OSError,IOError): pass try: os.remove(f) except(OSError,IOError): pass if f.startswith('.waf-'): shutil.rmtree(f,ignore_errors=True) info('distclean finished successfully') def dist(appname='',version=''): import tarfile if not appname:appname=getattr(Utils.g_module,APPNAME,'noname') if not version:version=getattr(Utils.g_module,VERSION,'1.0') tmp_folder=appname+'-'+version arch_name=tmp_folder+'.tar.'+g_gz try: shutil.rmtree(tmp_folder) except(OSError,IOError): pass try: os.remove(arch_name) except(OSError,IOError): pass copytree('.',tmp_folder,getattr(Utils.g_module,BLDDIR,None)) dist_hook=getattr(Utils.g_module,'dist_hook',None) if dist_hook: os.chdir(tmp_folder) try: dist_hook() finally: os.chdir('..') tar=tarfile.open(arch_name,'w:'+g_gz) tar.add(tmp_folder) tar.close() info('Your archive is ready -> %s'%arch_name) if os.path.exists(tmp_folder):shutil.rmtree(tmp_folder) return arch_name def distcheck(appname='',version=''): import tempfile,tarfile import pproc if not appname:appname=getattr(Utils.g_module,APPNAME,'noname') if not version:version=getattr(Utils.g_module,VERSION,'1.0') waf=os.path.abspath(sys.argv[0]) tarball=dist(appname,version) t=tarfile.open(tarball) for x in t:t.extract(x) t.close() instdir=tempfile.mkdtemp('.inst','%s-%s'%(appname,version)) cwd_before=os.getcwd() retval=pproc.Popen('%(waf)s configure && %(waf)s'' && %(waf)s check && %(waf)s install --destdir=%(instdir)s'' && %(waf)s uninstall --destdir=%(instdir)s'%vars(),shell=True).wait() if retval: raise Utils.WafError('distcheck failed with code %i'%(retval)) if os.path.exists(instdir): raise Utils.WafError('distcheck succeeded, but files were left in %s'%(instdir)) else: info('distcheck finished successfully') hotssh-0.2.6+dfsg1/wafadmin/Build.pyc0000644000175000017500000006073711777064501016062 0ustar javijavi <4Ic@sddlZejdkr.ddlmZnddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZmZddlTdjZiZda dej!fdYZ"d e#fd YZ$dS( iNi(tSet(tdebugterrortinfo(t*sDroot srcnode bldnode node_sigs node_deps raw_deps task_sigs id_nodest BuildErrorcBs eZdgdZdZRS(cCs8||_||_d|_tjj||jdS(Ni(tbldttaskstrettUtilstWafErrort__init__t format_error(tselftbtt((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyR s   cCsLdg}x3|jD](}|j}|r|j|qqWdj|S(Ns Build faileds (RR tappendtjoin(R tlstttskttxt((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyR s   N(t__name__t __module__tNoneR R (((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyR st BuildContextcBsjeZdZdZdZdZdZdZdZdZ dZ d#d#d Z d Z d d Zd ZdZdZdZdZeeeZdZdZedZdZdZdZd dZdZdZddZ d#dZ!d#de"dZ#d#ddZ$d#d Z%d d!Z&d"Z'RS($cCs|atj|_d|_i|_d|_d|_i|_ i|_ g|_ x*dj D]}i}t |||qaWi|_g|_i|_i|_d|_d|_d|_d|_dtjfdY}||_d|j_d|j_||j_dS(Nits9cache_node_abspath task_sigs node_deps raw_deps node_sigst node_classcBseZRS((RR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyR/stNodetNodu(RtTaskt TaskManagert task_managertid_nodestall_envstbdirRtpathtcache_node_abspathtcache_scanned_folderst uninstalltsplittsetattrtcache_dir_contentst all_task_genttask_gen_cache_namestcache_sig_varstlogtroottsrcnodetbldnodeRRRR(R tvtvarR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyR s2                  cCsy%tjtjj|jd}Wnttfk r>nEX|dtkratj dnx|dD]}|j |qlWzt j d}}|jt_y%ttjj|jtd}Wnttfk rnXy|rtj|}nWn&tk r)tjdkr*q*nX|rXx/tD]}t||||q7Wn tdWd|ry|jnt jXdS(Nsbuild.config.pytversions)Version mismatch! reconfigure the projectttoolstrbis!build: Build cache loading failed(t EnvironmenttosR#RtcachedirtIOErrortOSErrort HEXVERSIONR R tsetuptgctdisableRRRRtopenR"tDBFILEtEOFErrortcPickletloadtAttributeErrortLogstverboset SAVED_ATTRSR(Rtclosetenable(R tenvRtftdatatx((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyRC5s:%   %    cCstjd|jj_|jt_t t j j |j td}i}x!tD]}t||||RR.t __class__RRRRR?R7R#RR"R@RGtgetattrRBtdumpRHRI(R tfileRLRM((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytsaveRs  !  csrtdfdj}||jkrnx-djD]}i}t||qKWndS(Nsbuild: clean calledcsx|jjD]}|j|}|jd@}|tjkrL|q|tjkrxajjD]P}|j|}||dkrqknyt j |Wqkt k rqkXqkW|jj |qqWdS(Nitwaf_config_files( tchildstkeystidRtDIRtBUILDR!tvaluestabspathR7tremoveR:t __delitem__(tnodeRMtndttpRJtpt(t clean_recR (sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyRb_s    s9node_sigs node_deps task_sigs raw_deps cache_node_abspath(RR/R'R((R R^R1R2((RbR sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytclean]s   cCs_tdtj|j|jtj|tjj |_ t d}tdy|dt |j j Wntk r|tj|jj|jtjddtjdkrq tjdn,tk r|nX||j|j jrEtj|jjt||jjntj|jjdS( Nsbuild: compile calledcSsHtjjrD|r+tjjtjjqDtjjtjj ndS(N( tOptionstoptionst progress_bartsyststdouttwriteREtcolorst cursor_ont cursor_off(ton((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytdwws sbuild: executor startingRmtREDsBuild interruptediiD(RR7tchdirR"tflushtRunnertParallelRdRetjobst generatortTruetFalsetstarttKeyboardInterruptR/R[RSR tpprintRERFRgtexitt ExceptionRRRt tasks_done(R Rn((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytcompilers4          cCs2td|jtjdr.g}x?|jD]4}tjj|}||kr1|j|q1q1W|j |j g}x[|D]S}|}xDt |dkr||kr|j|ntjj|}qWqW|j |j x6|D]+}ytj |Wqt k r&qXqWndS(Nsbuild: install calledR&i(RRqRdtcommandsR&R7R#tdirnameRtsorttreversetlentrmdirR:(R RRMtdirtnlstty((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytinstalls0            cCs7x0tj|D]}|rtj||qqWdS(N(R tto_listt Scriptingt add_subdir(R tdirsR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt add_subdirsscOs||d %s(RtTaskGenttask_gentclassestKeyErrorR t WscriptError(R tktkwtcls_nametclsRM((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt new_task_gens   6c Csytj|j}Wn:tk rR}|jtjkrLtjdqSnX|sktjdnxa|D]Y}|jtrrt j t j j |j|}|j dd}||j| %s Rs"build: srcnode is %s and srcdir %s(R7R#tisabstAssertionErrorRt CACHE_DIRR8R R R"RCR.RRRRRXR/tensure_dir_node_from_pathRRRtmakedirsR:R0R(R tsrcdirtblddirt load_cache((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt load_dirss*          c Cs|jj|jdrdSd|j|jnXg|D]}|j|^qF}tj|}td|jdt|f||j|<|S(Nsenvhash: %s %sthex( RRWR,Rtget_flatR th_listRtencode(R RJtvars_lsttidxtaRR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt hash_env_varsUs "# cCs|j}|sxp|jD]b}|jjd}|jrO||||j( RRR trot_idxtrot_chrRRtstrftimetgmtimet get_term_colstinttljustt indicator(R tstatettotaltcol1tcol2tntindRtpctetatfstlefttrighttcolstratiotbartmsg((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt progress_lines  %< icCstjdrNtjjshy(tj|j}tj|j}Wntk rTqhX||krhtSn|j |j j dtj d}td||fytj|Wntk rnXy$tj||tj||Wn]tk rIytj|Wn%ttfk r2td|nXtjd|nXtStjdrtd||jj|ytj|Wntk rnXtSdS(NRRs* installing %s as %ssFile %r does not existsCould not install the file %rR&s* uninstalling %s(RdRRetforceR7tstattst_mtimeR:RwtreplaceR/R[RRRR\tshutiltcopy2tchmodR9RR R RvR&R(R tsrcttgtR/tt1tt2tsrclbl((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt do_installsB    %    cCs^|s|j}n|j}tj||}|rZtjj||jtj}n|S(N( RJt get_destdirR t subst_varsR7R#RtlstripR(R R#RJtdestdirtdestpath((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytget_install_paths  $cCstjs gS|sgS|j}t|tjkrjd|krj|jtj|}t j |}nt j |}|p|j }|j ||} t j| g} x|D]} tjj| s^|j| } | st jd| |fn|r4tjj| | } t jtjj| ntjj| | j} | j|} n(t j| }tjj| |d} |j| | |r| j| qqW| S(NRs0Unable to install the file `%s': not found in %si(Rdt is_installR#RRt StringTypeR[R7RRR RRJR;t check_dirRRR RRRt split_pathR5R(R R#RRJR/trelative_trickR^tglRR:tinstalled_filestfilenameR_tdestfiletalst((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt install_filess8  !  c Cstjs tS|stS|s)|j}n|j}|j||}tjj|\}}tj |tjj |s|j |} | j |} n|} |j | ||S(N(RdR<RwRJR#R;R7R'R R>RRR[R5( R R#tsrcfileRJR/R^R:RRtfilenodeR0((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt install_ass    cCstjs dS|sdS|j||}tjj|\}}tj|tjdryWtjj | stj ||krt d||ftj ||ndSWqt k rdSXnHtjdry#t d|tj|dSWqt k rdSXndS(NRs* symlink %s (-> %s)iiR&s * removing %s(RdR<R;R7R#R'R R>RtislinktreadlinkRtsymlinkR:R\(R R#R0RJR1RR((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyt symlink_ass,   (    cCsJtd||jr.|jjd|ntj|d|d|jS(Nsrunner: system command -> %ss%s tshellR-(RR-RiR t exec_command(R tcmdRN((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyROs cCs-|jptj}|j||jdS(N(R-RgRhRiRq(R tsRK((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pytprintout s N((RRR RCRSRcR~RRRRRR<RRRRRRRtpropertyRJRRRvRRRRRqRR(R5R;RwRFRIRMRORR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyRsD                      (%Rgt hexversiontsetsRRR7RBRRRtreRR=RR-RrRRRR R6RRERdRRRt ConstantsR'RGRRRR RtobjectR(((sm/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Build.pyts l   hotssh-0.2.6+dfsg1/wafadmin/Node.py0000644000175000017500000002133011115036226015514 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import os,sys,types import Utils,Build UNDEFINED=0 DIR=1 FILE=2 BUILD=3 type_to_string={UNDEFINED:"unk",DIR:"dir",FILE:"src",BUILD:"bld"} class Node(object): __slots__=("name","parent","id","childs") def __init__(self,name,parent,node_type=UNDEFINED): self.name=name self.parent=parent self.__class__.bld.id_nodes+=4 self.id=self.__class__.bld.id_nodes+node_type if node_type==DIR:self.childs={} if Utils.split_path(name)[0]!=name: raise Utils.WafError('name forbidden '+name) if parent and name in parent.childs: raise Utils.WafError('node %s exists in the parent files %s already'%(name,str(parent))) if parent:parent.childs[name]=self def __str__(self): if not self.parent:return'' return"%s://%s"%(type_to_string[self.id&3],self.abspath()) def __repr__(self): return self.__str__() def __hash__(self): raise Utils.WafError('nodes, you are doing it wrong') def get_type(self): return self.id&3 def set_type(self,t): self.id=self.id+t-self.id&3 def dirs(self): return[x for x in self.childs.values()if x.id&3==DIR] def files(self): return[x for x in self.childs.values()if x.id&3==FILE] def get_dir(self,name,default=None): node=self.childs.get(name,None) if not node or node.id&3!=DIR:return default return node def get_file(self,name,default=None): node=self.childs.get(name,None) if not node or node.id&3!=FILE:return default return node def get_build(self,name,default=None): node=self.childs.get(name,None) if not node or node.id&3!=BUILD:return default return node def find_resource(self,lst): if type(lst)is types.StringType: lst=Utils.split_path(lst) if not lst[:-1]: parent=self else: parent=self.find_dir(lst[:-1]) if not parent:return None self.__class__.bld.rescan(parent) name=lst[-1] node=parent.childs.get(name,None) if node: tp=node.id&3 if tp==FILE or tp==BUILD: return node tree=self.__class__.bld if not name in tree.cache_dir_contents[parent.id]: return None path=parent.abspath()+os.sep+name try: st=Utils.h_file(path) except IOError: return None child=self.__class__(name,parent,FILE) tree.node_sigs[0][child.id]=st return child def find_or_declare(self,lst): if type(lst)is types.StringType: lst=Utils.split_path(lst) if not lst[:-1]: parent=self else: parent=self.find_dir(lst[:-1]) if not parent:return None self.__class__.bld.rescan(parent) name=lst[-1] node=parent.childs.get(name,None) if node: tp=node.id&3 if tp!=BUILD: raise Utils.WafError("find_or_declare returns a build node, not a source nor a directory"+str(lst)) return node node=self.__class__(name,parent,BUILD) return node def find_dir(self,lst): if type(lst)is types.StringType: lst=Utils.split_path(lst) current=self for name in lst: self.__class__.bld.rescan(current) prev=current if not current.parent and name==current.name: continue elif not name: continue elif name=='.': continue elif name=='..': current=current.parent or current else: current=prev.childs.get(name,None) if current is None: dir_cont=self.__class__.bld.cache_dir_contents if prev.id in dir_cont and name in dir_cont[prev.id]: current=self.__class__(name,prev,DIR) else: return None return current def ensure_dir_node_from_path(self,lst): if type(lst)is types.StringType: lst=Utils.split_path(lst) current=self for name in lst: if not name: continue elif name=='.': continue elif name=='..': current=current.parent or current else: prev=current current=prev.childs.get(name,None) if current is None: current=self.__class__(name,prev,DIR) return current def exclusive_build_node(self,path): lst=Utils.split_path(path) name=lst[-1] if len(lst)>1: parent=None try: parent=self.find_dir(lst[:-1]) except OSError: pass if not parent: parent=self.ensure_dir_node_from_path(lst[:-1]) self.__class__.bld.cache_scanned_folders[parent.id]=1 else: try: self.__class__.bld.rescan(parent) except OSError: pass else: parent=self node=parent.childs.get(name,None) if not node: node=self.__class__(name,parent,BUILD) return node def path_to_parent(self,parent): lst=[] p=self h1=parent.height() h2=p.height() while h2>h1: h2-=1 lst.append(p.name) p=p.parent if lst: lst.reverse() ret=os.path.join(*lst) else: ret='' return ret def find_ancestor(self,node): dist=self.height()-node.height() if dist<0:return node.find_ancestor(self) cand=self while dist>0: cand=cand.parent dist-=1 if cand==node:return cand cursor=node while cand.parent: cand=cand.parent cursor=cursor.parent if cand==cursor:return cand def relpath_gen(self,going_to): if self==going_to:return'.' if going_to.parent==self:return'..' ancestor=self.find_ancestor(going_to) lst=[] cand=self while not cand.id==ancestor.id: lst.append(cand.name) cand=cand.parent cand=going_to while not cand.id==ancestor.id: lst.append('..') cand=cand.parent lst.reverse() return os.sep.join(lst) def nice_path(self,env=None): tree=self.__class__.bld ln=tree.launch_node() name=self.name if self.id&3==FILE:return self.relpath_gen(ln) else:return os.path.join(tree.bldnode.relpath_gen(ln),env.variant(),self.relpath_gen(tree.srcnode)) def is_child_of(self,node): p=self diff=self.height()-node.height() while diff>0: diff-=1 p=p.parent return p.id==node.id def variant(self,env): if not env:return 0 elif self.id&3==FILE:return 0 else:return env.variant() def height(self): d=self val=-1 while d: d=d.parent val+=1 return val def abspath(self,env=None): if not self.name: return'/' variant=self.variant(env) ret=self.__class__.bld.cache_node_abspath[variant].get(self.id,None) if ret:return ret if not variant: if not self.parent: val=os.sep elif not self.parent.name: val=os.sep+self.name else: val=self.parent.abspath()+os.sep+self.name else: val=os.sep.join((self.__class__.bld.bldnode.abspath(),env.variant(),self.path_to_parent(self.__class__.bld.srcnode))) self.__class__.bld.cache_node_abspath[variant][self.id]=val return val def change_ext(self,ext): name=self.name k=name.rfind('.') if k>=0: name=name[:k]+ext else: name=name+ext node=self.parent.childs.get(name,None) if not node: node=self.__class__(name,self.parent,BUILD) return node def src_dir(self,env): return self.parent.srcpath(env) def bld_dir(self,env): return self.parent.bldpath(env) def bld_base(self,env): s=self.name s=s[:s.rfind('.')] return os.path.join(self.bld_dir(env),s) def bldpath(self,env=None): if self.id&3==FILE: return self.relpath_gen(self.__class__.bld.bldnode) if self.path_to_parent(self.__class__.bld.srcnode)is not'': return os.path.join(env.variant(),self.path_to_parent(self.__class__.bld.srcnode)) return env.variant() def srcpath(self,env=None): if self.id&3==BUILD: return self.bldpath(env) return self.relpath_gen(self.__class__.bld.bldnode) def read(self,env): try: file=open(self.abspath(env),'rb') return file.read() finally: if file:file.close() def dir(self,env): return self.parent.abspath(env) def file(self): return self.name def file_base(self): s=self.name if s.rfind('.')<0: return s return s[:s.rfind('.')] def suffix(self): s=self.name if s.rfind('.')<0: return s return s[s.rfind('.'):] if sys.platform=="win32": def find_dir_win32(self,lst): if type(lst)is types.StringType: lst=Utils.split_path(lst) current=self for name in lst: self.__class__.bld.rescan(current) prev=current if not current.parent and name==current.name: continue if not name: continue elif name=='.': continue elif name=='..': current=current.parent or current else: current=prev.childs.get(name,None) if current is None: if(name in self.__class__.bld.cache_dir_contents[prev.id]or(not prev.parent and name[1]==":")): current=self.__class__(name,prev,DIR) else: return None return current Node.find_dir=find_dir_win32 def abspath_win32(self,env=None): variant=self.variant(env) ret=self.__class__.bld.cache_node_abspath[variant].get(self.id,None) if ret:return ret if not variant: cur=self lst=[] while cur: lst.append(cur.name) cur=cur.parent lst.reverse() val=os.sep.join(lst) else: val=os.sep.join((self.__class__.bld.bldnode.abspath(),env.variant(),self.path_to_parent(self.__class__.bld.srcnode))) if val.startswith("\\"):val=val[1:] if val.startswith("\\"):val=val[1:] self.__class__.bld.cache_node_abspath[variant][self.id]=val return val Node.abspath=abspath_win32 class Nodu(Node): pass hotssh-0.2.6+dfsg1/wafadmin/Runner.pyc0000644000175000017500000001470711777064501016270 0ustar javijavi <4Ic@s,ddlZejdkr.ddlmZnddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddl mZmZddlTdZejjZdZeej_dejfd YZd efd YZdS( iNi(tSet(tdebugterror(t*icOsKyt||Wn3ttfk r-ntjtjnXdS(N(trun_oldtKeyboardInterruptt SystemExittsyst excepthooktexc_info(targstkwargs((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pytrun s t TaskConsumercBs#eZdZdZdZRS(cCs4tjj||jd||_|jdS(Ni(t threadingtThreadt__init__t setDaemontmastertstart(tselftm((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyRs  cCsy|jWnnXdS(N(tloop(R((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyR scCsu|j}xe|jj}|jr:|jj|q nyJ|jjj|j |j j rw|j j |}n |j }WnKt k r}tj|_t|_|j||jj|q nX|r||_t|_nRy|jWn8tk rt|_n(tj|_t|_n Xt|_|jtkr^|j|n|jj|q dS(N(Rtreadytgettstoptouttputt generatortbldtprintouttdisplayt __class__tstattcall_runt ExceptiontUtilstex_stackterr_msgt EXCEPTIONthasrunt error_handlerterr_codetCRASHEDtpost_runtOSErrortMISSINGtSUCCESS(RRttsktrette((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyRs>           (t__name__t __module__RR R(((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyR s  tParallelcBsJeZddZdZdZdZdZdZdZRS(icCs||_|j|_|jj|_g|_tj|_g|_t j d|_ t j d|_ d|_ d|_ d|_d|_t|_t|_dS(Nii(tnumjobst task_managertmanagerttotalt outstandingRtmaxinttmaxjobstfrozentQueueRRtcounttstuckt processedtNonet consumerstFalseRR(RRtj((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyRAs          cCs|js dS|jjdS(Ni(R:RBtpop(R((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pytget_nextPs cCs<tjddr(|jjd|n|jj|dS(Nii(trandomtrandintR=tinserttappend(RR0((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pytpostponeTscCsx6|j|jtks+|j|jkr8|jqWx|js|jr[|jn|jr|j|j7_g|_q<|js<|jj\|_}|r|j|7_nPq<q<WdS(N( R?R6tGAPR<tget_outR:R=R8t get_next_set(Rttmp((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pytrefill_task_listYs+      cCs{|jj}|jj||j rht|ddrh|j|j7_|j t |j7_ n|j d8_ dS(Nt more_tasksi( RRR8t add_finishedRtgetattrRBR:RRR9tlenR?(RR1((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyRNfs cCs%tjjst|_nt|_dS(N(tOptionstoptionstkeeptTrueRR(RR0((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyR)ms  cCsx|js|j|j}|s;|jr7qq;Pn|jrf|jd7_|jj|ny|j}WnZt k r}t j |_ t |_|jd7_|j||jj|qnX|tkr|j|q|tkr&|jd7_t|_|jj|q|j|jf|_|jd7_|jj||jd7_|jsgt|jD]}t|^q|_qqWx |jr|jr|jqW|jdks|jstdS(Nii(RRQRGR?R(RAR8RStrunnable_statusR#R$R%R&R'R)t ASK_LATERRLtSKIP_MEtSKIPPEDR9tpositionRRRCtxrangeR6R RRNtAssertionError(RR0tstR2ti((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyRqsD           2( R3R4RRGRLRQRNR)R(((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyR5@s     (Rt hexversiontsetsRtsetRHttimeRR>t tracebacktBuildR$tLogsRVtpprocRRt ConstantsRMRR RR tobjectR5(((sn/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Runner.pyts H0     ,hotssh-0.2.6+dfsg1/wafadmin/Scripting.pyc0000644000175000017500000002752311777064500016760 0ustar javijavi <4Ic@s2ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlm Z m Z m Z ddlTdZdZdZdZdZd Zd jad jad Zd ZdZdddZdddZdS(iN(terrortwarntinfo(t*tbz2cBs4y|j|jWn-ek rCejd|jjnX|j}|jj|}|dkrejd||jfn||_yIejj |je }e |d}|dU|r|j nWnHe k r&ejj |je}ej|}|j|nX||_dS(NsNo such directory s$subdir not found (%s), restore is %str(trescantpathtOSErrortUtilst WscriptErrortabspathtfind_dirtNonetostjointWSCRIPT_BUILD_FILEtopentclosetIOErrort WSCRIPT_FILEt load_moduletbuild(tdirtbldtoldtnewt file_pathtfiletmodule((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyt add_subdir s(     cCsd}ttjtd}|s9ttjtd}n|smtj|ttj j dttfntj j |}ttjt d}|sttjt d}n|stj|t tj j dt t fntj j |}ytj |Wnt k rnXtjd|d|}|jd|jtj}||t <||t wafadmin %s (wafdir %s)sError: %si(t WAFVERSIONR3RCR`R tWafErrorR(RPRQRRRSR]te((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pytpreparets   cCstjdrxtj}td}tjjsZtjdtjtj|}ntd|t j dnt j }yt j tj}Wnztk rtjdrtjdqtjrtdtt j }t j tj}qtjd nXtjr_tjd r_tjd  r_d}d}yMx6|d D]*}tj|}tj||j}qVW||d k}Wn0tk r}td t|fd}nX|r\tdtjtjtjtjf} |dt_|dtj_t| \t_t_t_t_t j }t j tj}q\q_n|j|t|t|j t!tj"dd} | r| |nQd} x6tj$j%D]%\} } | j&dkr| } PqqWtj'd| t!tj"dd}|r|ntjds5tj(r2tjd rmddl)}d}t*|j)d|ntj}|j+tjjrdGHntj(r|j,nd}tjjstjdtjtj|}ntjdrd|}n$tjd rd|}n d|}t|ntjdrhz|j-tdWd|j.Xnt!tj"dd}|r|ndS(NR:R"s (%H:%M:%S)sEConfiguration finished successfully%s; project is now ready to build.itcleans)Nothing to clean (project not configured)sReconfiguring the projects2Project not configured (run 'waf configure' first)t uninstallR%R$s5Reconfiguring the project (an exception occurred: %s)is9Reconfiguring the project (the configuration has changed)R&R'Rt wscript_mains-Could not find the function 'def build(bld).'t pre_buildicSstS(N(tSKIP_ME(tself((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pytrunnable_statussRktinstalls4Compilation and installation finished successfully%ss&Uninstallation finished successfully%ss#Compilation finished successfully%ssCleaning finished successfullytshutdown(/R)R&ttimeR:R't progress_bartstrftimetgmtimeRR3RCtBuildt BuildContextR2R5RR RbR.t autoconfigRRthash_function_with_globalst ExceptiontstrtLogstzonestverboseR4t load_dirsR*R,t load_envsR(R+R tg_loaded_modulestitemst__name__R t is_installtTasktsetattrtcompileRlRetsave(tinitelaRtprojtreconfthRtmodtextbacktft main_wscriptRRRhRRkR]R^((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyRO~s   (                       (      sw.bzr .bzrignore .git .gitignore .svn CVS .cvsignore .arch-ids {arch} SCCS BitKeeper .hg Makefile Makefile.in config.logs5~ .rej .orig .pyc .pyo .bak .tar.bz2 tar.gz .zip .swpc Cs|jds`|jds`|jds`|dkrH|tjks`|tks`||krdtSx!tD]}|j|rktSqkWtS(Ns,,s++s.waf-1.R(t startswithR)R5texcludesREt dist_extstendswithRG(tnameR7t build_dirtext((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyt dont_dists ` cCstj|}tj|x|D]}}tjj||}tjj||}t|||rkq#ntjj|rt|||q#tj ||q#WdS(N( RRDR-RRRtisdirtcopytreetshutiltcopy2(R7tdstRtnamesRtsrcnametdstname((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyRs  cCstjd}x|D]}|tjkry$tj|}tj|tWntt fk rhnXytj |Wqtt fk rqXn|j drtj|dt qqWt ddS(NRs.waf-t ignore_errorssdistclean finished successfully(RRDR)R5R2RtrmtreeR,RRtremoveRRER(RXRR((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyR=s R"cCsddl}|s*ttjtd}n|sHttjtd}n|d|}|dt}ytj|Wnt t fk rnXyt j |Wnt t fk rnXt d|ttjtdttjdd}|r t j|z |Wdt jdXn|j|d t}|j||jtd |t jj|r}tj|n|S( Nitnonames1.0t-s.tar.Rt dist_hooks..sw:sYour archive is ready -> %s(ttarfileR(R R+tAPPNAMEtVERSIONtg_gzRRRRRRRR,R RKRtaddRRRtexists(tappnametversionRt tmp_foldert arch_nameRttar((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyR<s:     c Cs[ddl}ddl}ddl}|sBttjtd}n|s`ttjtd}ntj j t j d}t ||}|j|}x|D]}|j|qW|j|jdd||f} tj} |jdtdtj} | r%tjd | ntj j| rMtjd | n td dS( NiRs1.0is.insts%s-%ss%(waf)s configure && %(waf)s && %(waf)s check && %(waf)s install --destdir=%(instdir)s && %(waf)s uninstall --destdir=%(instdir)stshellsdistcheck failed with code %is.distcheck succeeded, but files were left in %ssdistcheck finished successfully(ttempfileRtpprocR(R R+RRRRR R3R#R<RtextractRtmkdtemptgetcwdtPopentvarsREtwaitRbRR( RRRRRtwafttarballRPR_tinstdirt cwd_beforetretval((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyR>s(    "(RR3Rt tracebackRnR R.RrRxR)R2RRRt ConstantsRRR:R`RdROtsplitRRRRR=R<R>(((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Scripting.pyts <H    A S    hotssh-0.2.6+dfsg1/wafadmin/Task.py0000644000175000017500000003660411115036226015543 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,types,shutil,sys,re,new,random,time from Utils import md5 import Build,Runner,Utils,Node,Logs,Options from Logs import debug,error,warn from Constants import* algotype=NORMAL class TaskManager(object): def __init__(self): self.groups=[] self.tasks_done=[] self.current_group=0 def get_next_set(self): ret=None while not ret and self.current_group0: self.set_order(keys[i],keys[j]) elif val<0: self.set_order(keys[j],keys[i]) def tasks_in_parallel(self): if not self.ready:self.prepare() keys=self.cstr_groups.keys() unconnected=[] remainder=[] for u in keys: for k in self.cstr_order.values(): if u in k: remainder.append(u) break else: unconnected.append(u) toreturn=[] for y in unconnected: toreturn.extend(self.cstr_groups[y]) for y in unconnected: try:self.cstr_order.__delitem__(y) except KeyError:pass self.cstr_groups.__delitem__(y) if not toreturn and remainder: raise Utils.WafError("circular order constraint detected %r"%remainder) return toreturn def tasks_by_max_jobs(self): if not self.ready:self.prepare() if not self.temp_tasks:self.temp_tasks=self.tasks_in_parallel() if not self.temp_tasks:return(None,None) maxjobs=sys.maxint ret=[] remaining=[] for t in self.temp_tasks: m=getattr(t,"maxjobs",getattr(self.__class__,"maxjobs",sys.maxint)) if m>maxjobs: remaining.append(t) elif m task failed (err #%d): %r"%(self.err_code,self) except AttributeError: return" -> task failed: %r"%self elif self.hasrun==EXCEPTION: return self.err_msg elif self.hasrun==MISSING: return" -> missing files: %r"%self else: return'' def install(self): bld=self.generator.bld d=self.attr('install') if self.attr('install_path'): lst=[a.relpath_gen(bld.srcnode)for a in self.outputs] perm=self.attr('chmod',0644) if self.attr('src'): lst+=[a.relpath_gen(bld.srcnode)for a in self.inputs] if self.attr('filename'): dir=self.install_path+self.attr('filename') bld.install_as(self.install_path,lst[0],self.env,perm) else: bld.install_files(self.install_path,lst,self.env,perm) class Task(TaskBase): vars=[] def __init__(self,env,**kw): TaskBase.__init__(self,**kw) self.env=env self.inputs=[] self.outputs=[] self.deps_nodes=[] self.run_after=[] def __str__(self): env=self.env src_str=' '.join([a.nice_path(env)for a in self.inputs]) tgt_str=' '.join([a.nice_path(env)for a in self.outputs]) if self.outputs:sep=' -> ' else:sep='' return'%s: %s%s%s\n'%(self.__class__.__name__,src_str,sep,tgt_str) def __repr__(self): return"".join(['\n\t{task: ',self.__class__.__name__," ",",".join([x.name for x in self.inputs])," -> ",",".join([x.name for x in self.outputs]),'}']) def unique_id(self): try: return self.uid except AttributeError: m=md5() up=m.update up(self.env.variant()) for x in self.inputs+self.outputs: up(x.abspath()) up(self.__class__.__name__) up(Utils.h_fun(self.run)) self.uid=m.digest() return self.uid def set_inputs(self,inp): if type(inp)is types.ListType:self.inputs+=inp else:self.inputs.append(inp) def set_outputs(self,out): if type(out)is types.ListType:self.outputs+=out else:self.outputs.append(out) def set_run_after(self,task): assert isinstance(task,TaskBase) self.run_after.append(task) def add_file_dependency(self,filename): node=self.generator.bld.current.find_resource(filename) self.deps_nodes.append(node) def signature(self): try:return self.cache_sig[0] except AttributeError:pass m=md5() exp_sig=self.sig_explicit_deps() m.update(exp_sig) imp_sig=self.scan and self.sig_implicit_deps()or SIG_NIL m.update(imp_sig) var_sig=self.sig_vars() m.update(var_sig) ret=m.digest() self.cache_sig=(ret,exp_sig,imp_sig,var_sig) return ret def runnable_status(self): if self.inputs and(not self.outputs): if not getattr(self.__class__,'quiet',None): error("task is invalid : no inputs or outputs (override in a Task subclass?) %r"%self) for t in self.run_after: if not t.hasrun: return ASK_LATER env=self.env bld=self.generator.bld time=None for node in self.outputs: variant=node.variant(env) try: time=bld.node_sigs[variant][node.id] except KeyError: debug("task: task %r must run as the first node does not exist"%self) time=None break if time is None and self.outputs: try: new_sig=self.signature() except KeyError: debug("task: something is wrong, computing the task signature failed") return RUN_ME return RUN_ME key=self.unique_id() try: prev_sig=bld.task_sigs[key][0] except KeyError: debug("task: task %r must run as it was never run before or the task code changed"%self) return RUN_ME new_sig=self.signature() if Logs.verbose:self.debug_why(bld.task_sigs[key]) if new_sig!=prev_sig: return RUN_ME return SKIP_ME def post_run(self): bld=self.generator.bld env=self.env sig=self.signature() cnt=0 for node in self.outputs: variant=node.variant(env) os.stat(node.abspath(env)) bld.node_sigs[variant][node.id]=sig if Options.cache_global: ssig=sig.encode('hex') dest=os.path.join(Options.cache_global,ssig+'-'+str(cnt)) try:shutil.copy2(node.abspath(env),dest) except IOError:warn('Could not write the file to the cache') cnt+=1 bld.task_sigs[self.unique_id()]=self.cache_sig self.executed=1 def can_retrieve_cache(self): if not Options.cache_global:return None if Options.options.nocache:return None env=self.env sig=self.signature() cnt=0 for node in self.outputs: variant=node.variant(env) ssig=sig.encode('hex') orig=os.path.join(Options.cache_global,ssig+'-'+str(cnt)) try: shutil.copy2(orig,node.abspath(env)) os.utime(orig,None) except(OSError,IOError): debug('task: failed retrieving file') return None else: cnt+=1 self.generator.bld.node_sigs[variant][node.id]=sig self.generator.bld.printout('restoring from cache %r\n'%node.bldpath(env)) return 1 def debug_why(self,old_sigs): new_sigs=self.cache_sig def v(x): return x.encode('hex') debug("Task %r"%self) msgs=['Task must run','* Source file or manual dependency','* Implicit dependency','* Environment variable'] tmp='task: -> %s: %s %s' for x in xrange(len(msgs)): if(new_sigs[x]!=old_sigs[x]): debug(tmp%(msgs[x],v(old_sigs[x]),v(new_sigs[x]))) def sig_explicit_deps(self): bld=self.generator.bld m=md5() for x in self.inputs: variant=x.variant(self.env) m.update(bld.node_sigs[variant][x.id]) for x in getattr(self,'dep_nodes',[]): variant=x.variant(self.env) v=bld.node_sigs[variant][x.id] m.update(v) try: additional_deps=bld.deps_man except AttributeError: pass else: for x in self.inputs+self.outputs: try: d=additional_deps[x.id] except KeyError: continue if callable(d): d=d() for v in d: if isinstance(v,Node.Node): bld.rescan(v.parent) variant=v.variant(self.env) try: v=bld.node_sigs[variant][v.id] except KeyError: v='' m.update(v) return m.digest() def sig_vars(self): m=md5() bld=self.generator.bld env=self.env act_sig=bld.hash_env_vars(env,self.__class__.vars) m.update(act_sig) var_sig=SIG_NIL dep_vars=getattr(self,'dep_vars',None) if dep_vars: var_sig=bld.hash_env_vars(env,dep_vars) m.update(var_sig) for x in getattr(self.__class__,'vars',()): k=env[x] if k: m.update(str(k)) vars_sig=hash((var_sig,str(k))) return m.digest() scan=None def sig_implicit_deps(self): bld=self.generator.bld key=self.unique_id() prev_sigs=bld.task_sigs.get(key,()) if prev_sigs: try: if prev_sigs[2]==self.compute_sig_implicit_deps(): return prev_sigs[2] except KeyError: pass (nodes,names)=self.scan() if Logs.verbose and Logs.zones: debug('deps: scanner for %s returned %s %s'%(str(self),str(nodes),str(names))) bld.node_deps[self.unique_id()]=nodes bld.raw_deps[self.unique_id()]=names sig=self.compute_sig_implicit_deps() return sig def compute_sig_implicit_deps(self): m=md5() upd=m.update bld=self.generator.bld tstamp=bld.node_sigs env=self.env for k in bld.node_deps.get(self.unique_id(),[])+self.inputs: if not k.parent.id in bld.cache_scanned_folders: bld.rescan(k.parent) if k.id&3==Node.FILE: upd(tstamp[0][k.id]) else: upd(tstamp[env.variant()][k.id]) return m.digest() def funex(c): exec(c) return f reg_act=re.compile(r"(?P\$\$)|(?P\$\{(?P\w+)(?P.*?)\})",re.M) def compile_fun(name,line): extr=[] def repl(match): g=match.group if g('dollar'):return"$" elif g('subst'):extr.append((g('var'),g('code')));return"%s" return None line=reg_act.sub(repl,line) parm=[] dvars=[] app=parm.append for(var,meth)in extr: if var=='SRC': if meth:app('task.inputs%s'%meth) else:app('" ".join([a.srcpath(env) for a in task.inputs])') elif var=='TGT': if meth:app('task.outputs%s'%meth) else:app('" ".join([a.bldpath(env) for a in task.outputs])') else: if not var in dvars:dvars.append(var) app("p('%s')"%var) if parm:parm="%% (%s) "%(',\n\t\t'.join(parm)) else:parm='' c=''' def f(task): env = task.env p = env.get_flat cmd = "%s" %s return task.generator.bld.exec_command(cmd) '''%(line,parm) debug('action: %s'%c) return(funex(c),dvars) def simple_task_type(name,line,color='GREEN',vars=[],ext_in=[],ext_out=[],before=[],after=[]): (fun,dvars)=compile_fun(name,line) fun.code=line return task_type_from_func(name,fun,vars or dvars,color,ext_in,ext_out,before,after) def task_type_from_func(name,func,vars=[],color='GREEN',ext_in=[],ext_out=[],before=[],after=[]): params={'run':func,'vars':vars,'color':color,'name':name,'ext_in':Utils.to_list(ext_in),'ext_out':Utils.to_list(ext_out),'before':Utils.to_list(before),'after':Utils.to_list(after),} cls=new.classobj(name,(Task,),params) TaskBase.classes[name]=cls return cls hotssh-0.2.6+dfsg1/wafadmin/TaskGen.py0000644000175000017500000002116311105644247016176 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,types,traceback,copy import Build,Task,Utils,Logs,Options from Logs import debug,error,warn from Constants import* typos={'sources':'source','targets':'target','include':'includes','define':'defines','importpath':'importpaths','install_var':'install_path','install_subdir':'install_path','inst_var':'install_path','inst_dir':'install_path',} class register_obj(type): def __init__(cls,name,bases,dict): super(register_obj,cls).__init__(name,bases,dict) name=cls.__name__ suffix='_taskgen' if name.endswith(suffix): task_gen.classes[name.replace(suffix,'')]=cls class task_gen(object): __metaclass__=register_obj mappings={} mapped={} prec={} traits={} classes={} idx={} def __init__(self,*kw,**kwargs): self.prec={} self.source='' self.target='' self.meths=[] self.mappings={} self.features=list(kw) self.tasks=[] self.default_chmod=0644 self.default_install_path=None if Options.is_install: self.inst_files=[] self.allnodes=[] self.bld=kwargs.get('bld',Build.bld) self.env=self.bld.env.copy() self.path=self.bld.path self.name='' self.bld.all_task_gen.append(self) self.idx=task_gen.idx[self.path.id]=task_gen.idx.get(self.path.id,0)+1 for key,val in kwargs.iteritems(): setattr(self,key,val) def __str__(self): return(""%(self.name or self.target,self.__class__.__name__,str(self.path))) def __setattr__(self,name,attr): real=typos.get(name,name) if real!=name: warn('typo %s -> %s'%(name,real)) if Logs.verbose>0: traceback.print_stack() object.__setattr__(self,real,attr) def to_list(self,value): if type(value)is types.StringType:return value.split() else:return value def apply_core(self): find_resource=self.path.find_resource for filename in self.to_list(self.source): x=self.get_hook(filename) if x: x(self,filename) else: node=find_resource(filename) if not node:raise Utils.WafError("source not found: '%s' in '%s'"%(filename,str(self.path))) self.allnodes.append(node) for node in self.allnodes: filename=node.name k=max(0,filename.rfind('.')) x=self.get_hook(filename[k:]) if not x: raise Utils.WafError("Do not know how to process %s in %s, mappings are %s"%(str(node),str(self.__class__),str(self.__class__.mappings))) x(self,node) def apply(self): keys=set(self.meths) self.features=Utils.to_list(self.features) for x in self.features+['*']: keys.update(task_gen.traits.get(x,())) prec={} prec_tbl=self.prec or task_gen.prec for x in prec_tbl: if x in keys: prec[x]=prec_tbl[x] tmp=[] for a in keys: for x in prec.values(): if a in x:break else: tmp.append(a) out=[] while tmp: e=tmp.pop() if e in keys:out.append(e) try: nlst=prec[e] except KeyError: pass else: del prec[e] for x in nlst: for y in prec: if x in prec[y]: break else: tmp.append(x) if prec:raise Utils.WafError("graph has a cycle %s"%str(prec)) out.reverse() self.meths=out if not out:out.append(self.apply_core.__name__) debug('task_gen: posting %s %d'%(self,id(self))) for x in out: try: v=getattr(self,x) except AttributeError: raise Utils.WafError("tried to retrieve %s which is not a valid method"%x) debug('task_gen: -> %s (%d)'%(x,id(self))) v() def post(self): if not self.name:self.name=self.target if getattr(self,'posted',None): return self.apply() debug('task_gen: posted %s'%self.name) self.posted=True def get_hook(self,ext): try:return self.mappings[ext] except KeyError: try:return task_gen.mappings[ext] except KeyError:return None def create_task(self,name,env=None): task=Task.TaskBase.classes[name](env or self.env,generator=self) self.tasks.append(task) return task def name_to_obj(self,name): return self.bld.name_to_obj(name,self.env) def find_sources_in_dirs(self,dirnames,excludes=[],exts=[]): lst=[] err_msg="'%s' attribute must be a list.\n""Directories should be given either as a string separated by spaces, or as a list." not_a_list=lambda x:x and type(x)is not types.ListType if not_a_list(excludes): raise Utils.WscriptError(err_msg%'excludes') if not_a_list(exts): raise Utils.WscriptError(err_msg%'exts') dirnames=self.to_list(dirnames) ext_lst=exts or self.mappings.keys()+task_gen.mappings.keys() for name in dirnames: anode=self.path.find_dir(name) if not anode or not anode.is_child_of(self.bld.srcnode): raise Utils.WscriptError("Unable to use '%s' - either because it's not a relative path"", or it's not child of '%s'."%(name,self.bld.srcnode)) self.bld.rescan(anode) for name in self.bld.cache_dir_contents[anode.id]: (base,ext)=os.path.splitext(name) if ext in ext_lst and not name in lst and not name in excludes: lst.append((anode.relpath_gen(self.path)or'.')+os.path.sep+name) lst.sort() self.source=self.to_list(self.source) if not self.source:self.source=lst else:self.source+=lst def clone(self,env): newobj=task_gen(bld=self.bld) for x in self.__dict__: if x in["env"]: continue elif x in["path","features"]: setattr(newobj,x,getattr(self,x)) else: setattr(newobj,x,copy.copy(getattr(self,x))) newobj.__class__=self.__class__ if type(env)is types.StringType: newobj.env=self.bld.all_envs[env].copy() else: newobj.env=env.copy() self.bld.all_task_gen.append(newobj) return newobj def get_inst_path(self): return getattr(self,'_install_path',getattr(self,'default_install_path','')) def set_inst_path(self,val): self._install_path=val install_path=property(get_inst_path,set_inst_path) def get_chmod(self): return getattr(self,'_chmod',getattr(self,'default_chmod',0644)) def set_chmod(self,val): self._chmod=val chmod=property(get_chmod,set_chmod) def declare_extension(var,func): try: for x in var: task_gen.mappings[x]=func except: raise Utils.WscriptError('declare extension takes either a list or a string %s'%str(var)) task_gen.mapped[func.__name__]=func def declare_order(*k): assert(len(k)>1) n=len(k)-1 for i in xrange(n): f1=k[i] f2=k[i+1] try: if not f1 in task_gen.prec[f2]:task_gen.prec[f2].append(f1) except: task_gen.prec[f2]=[f1] def declare_chain(name='',action='',ext_in='',ext_out='',reentrant=1,color='BLUE',install=0,before=[],after=[],decider=None): if type(action)is types.StringType: act=Task.simple_task_type(name,action,color=color) else: act=Task.task_type_from_func(name,action,color=color) act.ext_in=tuple(Utils.to_list(ext_in)) act.ext_out=tuple(Utils.to_list(ext_out)) act.before=Utils.to_list(before) act.after=Utils.to_list(after) def x_file(self,node): if decider: ext=decider(self,node) elif type(ext_out)is types.StringType: ext=ext_out if type(ext)is types.StringType: out_source=node.change_ext(ext) if reentrant: self.allnodes.append(out_source) elif type(ext)==types.ListType: out_source=[node.change_ext(x)for x in ext] if reentrant: for i in xrange(reentrant): self.allnodes.append(out_source[i]) else: raise Utils.WafError("do not know how to process %s"%str(ext)) tsk=self.create_task(name) tsk.set_inputs(node) tsk.set_outputs(out_source) if Options.is_install and install: tsk.install=install declare_extension(act.ext_in,x_file) def bind_feature(name,methods): lst=Utils.to_list(methods) try: l=task_gen.traits[name] except KeyError: l=set() task_gen.traits[name]=l l.update(lst) def taskgen(func): setattr(task_gen,func.__name__,func) def feature(*k): def deco(func): setattr(task_gen,func.__name__,func) for name in k: try: l=task_gen.traits[name] except KeyError: l=set() task_gen.traits[name]=l l.update([func.__name__]) return func return deco def before(*k): def deco(func): for fun_name in k: try: if not func.__name__ in task_gen.prec[fun_name]:task_gen.prec[fun_name].append(func.__name__) except KeyError: task_gen.prec[fun_name]=[func.__name__] return func return deco def after(*k): def deco(func): for fun_name in k: try: if not fun_name in task_gen.prec[func.__name__]:task_gen.prec[func.__name__].append(fun_name) except KeyError: task_gen.prec[func.__name__]=[fun_name] return func return deco def extension(var): if type(var)is types.ListType: pass elif type(var)is types.StringType: var=[var] else: raise Utils.WafError('declare extension takes either a list or a string %s'%str(var)) def deco(func): setattr(task_gen,func.__name__,func) for x in var: task_gen.mappings[x]=func task_gen.mapped[func.__name__]=func return func return deco hotssh-0.2.6+dfsg1/wafadmin/Runner.py0000644000175000017500000000670311115036226016107 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import sys,random,time,threading,Queue,traceback import Build,Utils,Logs,Options import pproc from Logs import debug,error from Constants import* GAP=15 run_old=threading.Thread.run def run(*args,**kwargs): try: run_old(*args,**kwargs) except(KeyboardInterrupt,SystemExit): raise except: sys.excepthook(*sys.exc_info()) threading.Thread.run=run class TaskConsumer(threading.Thread): def __init__(self,m): threading.Thread.__init__(self) self.setDaemon(1) self.master=m self.start() def run(self): try: self.loop() except: pass def loop(self): m=self.master while 1: tsk=m.ready.get() if m.stop: m.out.put(tsk) continue try: tsk.generator.bld.printout(tsk.display()) if tsk.__class__.stat:ret=tsk.__class__.stat(tsk) else:ret=tsk.call_run() except Exception,e: tsk.err_msg=Utils.ex_stack() tsk.hasrun=EXCEPTION m.error_handler(tsk) m.out.put(tsk) continue if ret: tsk.err_code=ret tsk.hasrun=CRASHED else: try: tsk.post_run() except OSError: tsk.hasrun=MISSING except: tsk.err_msg=Utils.ex_stack() tsk.hasrun=EXCEPTION else: tsk.hasrun=SUCCESS if tsk.hasrun!=SUCCESS: m.error_handler(tsk) m.out.put(tsk) class Parallel(object): def __init__(self,bld,j=2): self.numjobs=j self.manager=bld.task_manager self.total=self.manager.total() self.outstanding=[] self.maxjobs=sys.maxint self.frozen=[] self.ready=Queue.Queue(0) self.out=Queue.Queue(0) self.count=0 self.stuck=0 self.processed=1 self.consumers=None self.stop=False self.error=False def get_next(self): if not self.outstanding: return None return self.outstanding.pop(0) def postpone(self,tsk): if random.randint(0,1): self.frozen.insert(0,tsk) else: self.frozen.append(tsk) def refill_task_list(self): while self.count>self.numjobs+GAP or self.count>self.maxjobs: self.get_out() while not self.outstanding: if self.count: self.get_out() if self.frozen: self.outstanding+=self.frozen self.frozen=[] elif not self.count: (self.maxjobs,tmp)=self.manager.get_next_set() if tmp:self.outstanding+=tmp break def get_out(self): ret=self.out.get() self.manager.add_finished(ret) if not self.stop and getattr(ret,'more_tasks',None): self.outstanding+=ret.more_tasks self.total+=len(ret.more_tasks) self.count-=1 def error_handler(self,tsk): if not Options.options.keep: self.stop=True self.error=True def start(self): while not self.stop: self.refill_task_list() tsk=self.get_next() if not tsk: if self.count: continue else: break if tsk.hasrun: self.processed+=1 self.manager.add_finished(tsk) try: st=tsk.runnable_status() except Exception,e: tsk.err_msg=Utils.ex_stack() tsk.hasrun=EXCEPTION self.processed+=1 self.error_handler(tsk) self.manager.add_finished(tsk) continue if st==ASK_LATER: self.postpone(tsk) elif st==SKIP_ME: self.processed+=1 tsk.hasrun=SKIPPED self.manager.add_finished(tsk) else: tsk.position=(self.processed,self.total) self.count+=1 self.ready.put(tsk) self.processed+=1 if not self.consumers: self.consumers=[TaskConsumer(self)for i in xrange(self.numjobs)] while self.error and self.count: self.get_out() assert(self.count==0 or self.stop) hotssh-0.2.6+dfsg1/wafadmin/Configure.pyc0000644000175000017500000002534111777064501016734 0ustar javijavi <4Ic@sddlZddlZddlZddlZddlZddlZddlZddlmZddl Tdej fdYZ e a dZgddZdefd YZd Zd ZdS( iN(twarn(t*tConfigurationErrorcBseZRS((t__name__t __module__(((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Configure.pyRscCsdt|tjkr$|j}n|}x3|D]+}tjjtjj||r1|Sq1WdS(Nt(ttypettypest StringTypetsplittostpathtexiststjoin(tfilenamet path_listtlstt directory((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Configure.pyt find_file s !cCs2y|j}Wntk r#nX|rb|tjkrMtj|||RARCRWRbRhRlRpR2RrRwR{RRRRROR(((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Configure.pyR$$s(           cCstt|j||S(N(tsetattrR$R(R((sq/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Configure.pytconfscCs|tj|js0$   hotssh-0.2.6+dfsg1/wafadmin/Environment.pyc0000644000175000017500000001564111777064501017321 0ustar javijavi {Hc@sddlZejdkr.ddlmZnddlZddlZddlZddlZddl Z ddl Tej dej Z defdYZdS(iNi(tSet(t*s^(#)*?([^#=]*?)\ =\ (.*?)$t EnvironmentcBseZdZddZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZRS(ttabletparentcCs^i|_tjdrDtjjtjjtjj|jds      cCs?|j|}t|tr.|j|n |j|dS(N(R6R3Rtextendtappend(RtvarR/t current_value((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Environment.pyt append_valueOscCsL|j|}t|tr8||}||j|Wtj dt |jdS(Ntriisenv: %s( RRAtreadRCtre_imptfinditertgrouptevaltLogstdebugtstr(RRttblRDtcodetmtg((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Environment.pyRts     cCs|jdrdStjjS(Nt NOINSTALLR1(R RR tdestdir(R((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Environment.pyt get_destdir}s(stablesparentN(t__name__t __module__t __slots__RRRR#R&R*R,R R0R5R6R;R=R?RHRRX(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Environment.pyR s"            (tsyst hexversiontsetsRRR R,treRORt ConstantstcompiletMRKtobjectR(((ss/home/javi/src/hotssh/hotssh/hotssh-0.2.6+dfsg1/.waf-1.5.1-3009bf2a0164643771f76f0e24c46d7e/wafadmin/Environment.pyts $ hotssh-0.2.6+dfsg1/NEWS0000600000175000017500000000044711045710163013165 0ustar javijavi= Changes in HotSSH 0.2.5 = - Favicon support (http://cgwalters.livejournal.com/19030.html) - Use ~/.hotssh directory for data, other bugfixes - Some build system tweaks, new README file - New/updated translations: - Arabic (Djihed Afifi) - Catalan (Gil Forcada) - Swedish (Daniel Nylander) hotssh-0.2.6+dfsg1/hotssh.csh0000644000175000017500000000012311033166502014473 0ustar javijavi[ -x //usr/bin/id ] || exit [ `//usr/bin/id -u` -gt 100 ] && alias ssh hotssh --bg hotssh-0.2.6+dfsg1/wscript0000644000175000017500000000302611122614255014111 0ustar javijavi#! /usr/bin/env python # encoding: utf-8 import sys import Configure import gnome, python, intltool, misc VERSION='0.2.6' APPNAME='hotssh' srcdir = '.' blddir = 'build' def set_options(opt): opt.tool_options('python') def configure(conf): conf.check_tool('gcc gnome python intltool misc') conf.check_python_version((2,4,2)) conf.check_python_module('dbus') conf.check_python_module('gobject') conf.define('VERSION', VERSION) conf.define('GETTEXT_PACKAGE', 'hotssh') conf.define('PACKAGE', 'hotssh') def build(bld): obj = bld.new_task_gen('py') obj.find_sources_in_dirs(['hotssh'], exts=['.py']) obj.install_path = '${PYTHONDIR}/hotssh' obj = bld.new_task_gen('py') obj.find_sources_in_dirs(['hotssh/hotlib'], exts=['.py']) obj.install_path = '${PYTHONDIR}/hotssh/hotlib' obj = bld.new_task_gen('py') obj.find_sources_in_dirs(['hotssh/hotlib_ui'], exts=['.py']) obj.install_path = '${PYTHONDIR}/hotssh/hotlib_ui' obj = bld.new_task_gen('py') obj.find_sources_in_dirs(['hotssh/hotvte'], exts=['.py']) obj.install_path = '${PYTHONDIR}/hotssh/hotvte' # process desktop.in file obj=bld.new_task_gen('intltool_in') obj.source = 'hotssh.desktop.in' obj.install_path = '${PREFIX}/share/applications' obj.subdir = 'share/applications' obj.podir = 'po' obj.flags = '-d' bld.install_files('${PREFIX}/share/doc/hotssh-' + VERSION, 'COPYING') if bld.env['PREFIX'] == '/usr': bld.install_files('${PREFIX}/../etc/profile.d', 'hotssh.csh') bld.install_files('${PREFIX}/../etc/profile.d', 'hotssh.sh') bld.add_subdirs('bin po') hotssh-0.2.6+dfsg1/hotssh.sh0000644000175000017500000000040411033166502014332 0ustar javijaviif [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then [ -x //usr/bin/id ] || return [ `//usr/bin/id -u` -le 100 ] && return # for bash and zsh, only if no alias is already set alias ssh >/dev/null 2>&1 || alias ssh='hotssh --bg' fi hotssh-0.2.6+dfsg1/COPYING0000644000175000017500000004312711043465530013536 0ustar javijavi GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. hotssh-0.2.6+dfsg1/images/0000755000175000017500000000000011122614266013741 5ustar javijavihotssh-0.2.6+dfsg1/images/hotwire-openssh.png0000644000175000017500000010777611027562325017631 0ustar javijaviPNG  IHDRRlsRGBbKGD pHYs  tIME   IDATxw|UwܛL$ C,7u'Ŷ:PlRZlUTd=7rooޏyܛ=zKKKKKHe߅{B/R/R/R/R/hvw~z͓QCcu5$Y7HVތ^ߣe_}{3zDI"/zoF/:j}Ȳ%BSS#,.UUU $i(Aa ̈4yaɒ:*W^?< H[$$I3$I(Jq(UBaBAT+y|y Rs-7x2jɲ^ @(+,Q(e=]Z~ ƛoS ٳfjj~߿zUUv\*@g4>^gN @,T3с.,S4bO>uL˯V?cj>~={:j`EEŅ(W˗eۘs)8I8 CÇFpq~e[jk534O>쳆QS߿p.bnU٧q\&L;>^ty?C͉tU?U?pXb^u&Nl}lFh⌄ GbIW0qEp튢*aQڛ0\.O/'@iz%ӋO<55"cFA@ K `yr~|_cG }r -%F3@q   뤥0uITT?fa_y??p/N2ݿ8Aft?M%,P~W_j >d=HZY^/^χA;6FfX_ϊUk# |rf: ǽ:KBnnn{5HvU̜6{@#2۶nw{\5毾 ,Ej0j,t sd~ˁCx<^/MMP 8}0*-r_^Ae.dtt99i!ª=}i3NW/+<{o҂ᶶvH oEɨu=cxx];驨9-d(ߵ_z"I91%;8TkFm}#a1pNJ6즱4%ر{/>/ v|9D $ '@`Q x:̾ob00~qDUUE?`Nm]-s:uj|,ՈS_ =/~/oeyF F{ :-}Hڙ7M7ˁpdYFef-s",Ipb0٣ d㹧pO )F,[Ql!զ@Q͝KZj (? ?Jn Z3V}5WbX 9a7ιiܷ v1FBP 7rL09\>BM/NNey(C]`>f9ޝFn_>KRxg gt8ʲͧf+W_rn/}ŗ]p1d2,>1! &$ dsS<'p Q|<4VE/H;em] MdNC}=/=}1E#!#gyR6lb2m<0/_浕ʢP(2z8 I,7w>NޠAaГ:,3B= Y2X*WeK/) vYsU{^(Bnn.֯dמhZ^~ҿ_`]R]YI<SܺT 3'$eK_‚[gCGإ-I8phiO~77_0s mj<ܶ5ŋ~̦8VaC ,]Ĵy^OHNKh(.d!>ڢ7B˥tS>>!C7 [bY ʥH0h< ሌQ4bgNobhk>@ߌ$:~L *Ǿ<^|)|mk)2kb' ԙ4*eٮ`@ + ؄'q/GqI|~TVN`4цY1QV0Ҹb,f-y &k@"ڠh@6maWeCo㑅|ĕfO9y%@&0Zܔn|_3Z:}\VuWY]wue5ln_2j6}\VQ48y Yrs] K$6)2fzIhsӘ{VF( %=+?e`_'O=g HIO+P咬"aSWgQ7 c q9ef`y,\yvT4Ea;30˃N pp8LUMzY'dq5x9raY/N.D*3B!ƌ kQ]}d[&~9 zO=W^h+(ѱeO[Lci:%ɎjZbȘ}صg֗WaS=p™ؒh|A\ n$ч&l7.lؒbW=( .,x;˿L65RU@ /3e\_]|1!ַaE{yۗ\*Znv$IKd Q``͘ db_=!ȷf+MMSp\|t-IK)}Whjuegخ-EQ? }T׻LK .FVUu%ڵIR{VAT\6mtUiNj<;FkYNnNJzb4|jN! 5MN~P(G^n_87˧_g0aꈈcYrK-^SS0n,? AU;DQ$ ?hߕp9Q,/A6E!3 w㷬|43)F!0r5D+#؈⺟8(bʪ[PjO% |N?Mj+uTn{kZGߌ$~)<\ΜYLB@V%ɖLͺj|;V dMXGms@̈́-l3I 5mteiv3a(QZLoⱻg= (L(d1mh NaHϜ>Y3~©E! ؐ*@R=_aTaڣv䥯il pݙ#%[$#}="al%TܫN(ߎ-_E"cgn{]U G##r4jy->G5/n[9i FӋ$8NaWsH)pNjْ@({p(űpƎ0LKRhw{ P2AL;XDZghJ)B;w)O?ch~:L#2<˙ n|NG45KnɆbŠӭsҝ;kz}Uw=Լ@Jjm7iZZʟ.{Qmcέx2jQ ’9kg=ٌb%>֭݁GFmOXtg_Dz)g?/,zrIr9{g݀fpRddYCv?H3O?#Wo~m]}a%mbimm@msL"cgMMT7 Geonz$PmdJff!NO˃^g Ʈ%/?YŖ /٧ "Q/%%?[YAN 'ΨW)ABJތVM4zt&#Z;XtrE gR(Y$"ŸbzvWT!2<_|W`0PbAxFG{&\ʺ~*X7`/|J"sgtҊfHW-UBGM!>CvkcpyS Ӽ=bC_0E2ٴm/>U_3Q[i6AѤH챧+еɨ&ڷo`p q.2YϭWpveJQw\<2]Q]4d#^tBSW>G, 9+9`47?rCSiiЎޔ׵܄yHOh .̸L?w) ayl͂J h 5dyH'׃/RwPbЀ4N+ mbl23,q# )Fvs >Y[E{I!_zg}}23x(lmc_/1k\!^]NYi&Qe+EF?b$h5D/zvJ.e!?0+RHCX"(! CmLVBU fdz. lE0|4ic"6qtf23,6绹gɝŬe)Qd{1>)`# E$Z *ΥW\3O+<( >y'?%˸yy //!aR '`1I 20 D@JL" /qə),tHa)F4W#['C%S9bkWeܶMf9Hr]":蓪eDa :OFQq X@.kqH [dNAG0zJ6mBD<7Uރ֘pU_>ܫNP_h_uzW~W=Њml9UwGO?`1ZZ#jCW p"bֱzm9?70aDiv]n54iTam N]kԈSW_ǚg jXS葅?gdfWr]kz/JhlX'Zvvb6F_UJNMK4>L0ǨIO񉢖V?r_ԖQF\nvg_?AN'rř&&gFfM&eecbYt~#vU書kyO GiZAmlAH Z#kw&N8lNUQONϳ59;s,ss:bicxfPpzyyƖ]zOGÁ_ O#7p)L_[+â Hݝd /|^` .Ds$I*mb9ADY草f?@#DM쉚QJrx!=H31zKeF ,H3*Q]Qp߯ 04yV(uA6QDf\n! ,%ɪgԂք%87Үbt[mPۇV'bKv; }T)-Z[v^`Axԩ.,|=?ϟR;At_찫A6b$7[Z G{Πh?CKުdn$gˏVJ1bgZ"W&~~}?7"/ڏ~Wb߿ڎgϞ?yjp_mwOeGUZVբhkɲLa`dm ٙh_*U՟l3KTKk{`)|x"APq$D IDAT%i^l Ycg&6p:@~"ϤP-erOYcfvs/ vBΘ6YsBF y<ޟf'@o4m8%_ϯP…}oFqvjܮZ@(JVW'UGMG[f0Y8Ə-y'5jg67W{xa,D?&.zGazVJrJ:,V ;{:p{>~ Qgz}Dc*-]aCay&JQMuQz\C-}\#W?Ѯu]}UMMmMQ{hx:E!;$w3~,-]DYl!ŖʖHRJ*Tlv;фa6Y7K7,G:",nAuŽr_df D I$XZ iۅd=\@ 3wW_c$aN0+G^K+$&hmpzcd:O mkI6Xc=~4=$rnߣV|>cqQTqrAPhqAa'M^\zĈz| F A@%р,NK)UL7`O =-d{ )IFtz]'W@>`:j:RyTWW'|I)ߏᠾz?^A]c(#V׻zh; sD}lbYco@MuXmt[$f0x|Π;tn5x[C0ILe@^.g>dk-T l4Ba@={D?^2-`MaFƽ}^ I$~j@3HeEY׮qƓ#&IIftܹtY EVWت]1Qn?͓O>MTUU $iNlK=JJww^rhMdv?YZ:j6zx{Ev,jsz,OQ=bu=%r3]>Hzf&^ Y:r_eB5K"`ȼooÚh"z=ZDQ!~*K"y ^w3(үoƟ~.i}xƆZj B/m8!Ư55XCQ~b$hnQ'cmq cD(s:ˠعԴt~/yZ'ڢ5Yr#&h𿛺^ىPwP1"wJۀXAsScԤD)Nd}HwAwd!A/Qa~:*%Xljߥ}Etp8Li*++A' c+3].nZ!c=lȖ>0Yi:RlztA,K]`O2z73p$I ^GЭtvbҤI<:%FG!!~zFc#w`:)k~WnNDOԢ(U}RxJ"fD! o ZBTǶhhCc0ttz$I"H0gǖغE<dkBg@ՠjuu: F#P($ 㦡 EA'$Gab91o\F -oqPkqTjq!n{=o_ML>ZZ NfJjժ.eBzDYu^CA~^wDž4ή{ % e]ZYZeںWA "!K"aE ˒ o:1̝D~kg'2rdY ! )Dn&ŚdFo֣7УA0d0FTۏp8NjhZt:}~\$M``N? :.YsqOA$jm1z;GΞ?ǹ?Z@SA [cή ?tMµ;$2gZ@Y@$DQ@D\3u k3[+jB# $(rEw:a%9 1M h׷\pltZmɠAN 竌+@ěψC0LFz=:F91FnX? v֧0(F^4Jwqx7,~yqZ V6=~6Q vwXV`bÏ@OfS{Gఁ}{ D0l"ީ 1`4D5ц"5JS7NW |VU}^hd2h4$%%3k֬Hl@hE鱁]ef6_3DQ$-5!TUqͷro ҕM¸ 86 z\s Og#-Dnr706Z-&It kz(M "Qbj`0u=K.}Nt=:`0`41$$$`40Lde'?o $$$`2"HtX;]M 5?袤tg,I,a6۾}w,dM;{̙;?}ىuXM)5f73mZ@PBT t >@U ɂjU'?eTp??ۺd9 E1ڦh}5')#Kz+pBBp8<4vk~ǀhr#vP(jb(!Yǫ1x]ؾ!C "@AzYAVjر{SN!-M daq{kvh`NdgAY'cj 2z vg MݤR(F hh :: Sh:NM+I"ZIp7^F{s̈T"R/!Q&}~[XWMMm- #Ei7FjTXXIn@ؒT/AƵ-imb# "R+,f6|@HQ In-7v4bO1~d"3[ٰy7`GAZ Oe簭>.PT`@B (L&]Bׄ٤@R=4[aW@ScbFMBANVyZ|j<^O:Ң64@e|YÖ́٤gRAT Hr86* z<8hk= ǃ D$.>}1`K,)?ipwj4`X,gէOtUMCC F˱@e"Ic4Yϖm{)--e߾ro߆5 3cj5.,㳽]ƍc@V#}@V s xE |݆"@]gI }I9!~ieA wA(rh荺ٌ9rjkطq1L}]FL+]+;xoE;oz]n>/7qQ^Do֣%D(t$V9˴qb2&Q[_w;.?!FkŪ.x<n7n;:ye ;[]dtuWk˹fܾ¨r[?BbZ3c_yw^{̤fK'+z 2P՗l= 1ØIXlV6#$ pzxnD-ں ._ևA0,~ f KW{Vpiy/D/@HjFfn-^TAWɇfԕG+`OH~9T8_-zx H㨝XCjݕu5hepv W^8￐ [Q|yƙ,u6V7 pt;^=Q# ЛHJК@BzVJ6pկ2lX?nT>VU2aTnV:cY$0 |x^n7N3ںzٽ{l^Ϲdgꢕ RZR Ju\;;13RǞKR{\?߬%'#z\} +,`F^]Ǻ#Y#/GOn+'L,~e/IcXxSFv> H6˯K?(}T6sU/̴xTX6|>7W˿܃`dPA!/]{¡Cp7k& =H;M= ~v謞ⓓ1ncoʰ87jQ- mp+4L)Jb90jJUMJ^Ҙ~d2L"VG/Ӡ;C}1]%OYӮo g'?.{;o9rW3kT֭{+6w ṟs* jfb1+X}d#,._Dpށ"bkk\۸kb GqI^-btl^5S?mNRQQq]#2)vSV۷pum}fث[*2uOOM*#qYXxL)"^5lܸ6v2~db=oPjX0rsp(!95aGHL{orsضsoɟLWQǮJ6)TGI^zN\0NvWDf]}٬tS -4 @f,.s9Y}ؽ:|> +&iN: Hj,m<̞ĮKK4POZɩͽnGz}\z]W%r L8u&>$llDfz ɺg33fP=N;Fj6Ȍբ' n~ EStnϗO˻iO8/xE_wxfD.|A D3jEgCC#! CuaK2F{U'j_(c_QGߌHZ_@WQ9!Se6~WDze_́ZFqO΢` A)_|ӎCVVm&xxU\qf%̊540̬ɤy}J"&s?G f3dDA.IZyU}#hOov;q dI B< B7@)l*$ ;qmɲHҖ%\K8O>psEN,r4ډE[:RQmD`;!2! k Cn84 }C/sJ̙=p;iws𸋁GWs@%-'mOɇ^x(466Zokj^o^jF' $~!mmm,gynO0A=Na&36/F}*T">vJeDv"b$kxk +i*ukw;v,%%%EOK1s3s\m >`N!JW }3Aw)ka4z@*Ba]wo7>wB5)Wg[Y5BsSLF:A1Ťf9٤l?gщ|a}m.y@]]AݦMX A륫_~V XMydt'hxs9gj&IKB!YEaJdjFs%HAvGaI4j+}~RP:S%%%\uJV~ab_o|8=rrM fFH))ffaynz]rU8]n<^/c C:Лdru*fLvE>Ц76¢"@]]~nEl^S7Tg˶mp:(adO;C9%#+iS1(ыDeb(BwW/P L AqYx1^/ixKb%b3Egq{az/ԵuInL;_NE2{dGj9]_r<-wDY1ԵzBϒ.+r\3J vvߛtZa ZW=@:no}ǚqCgu~],EzB+Mu]?CAT*nA7L iXS:e2Zmt$vus,YKRMfD)B|,P':RjڏvWqCl)$ʕt2 puWggrJA$/: $+i:@Y T{Q(W9fVgV5n/iY#d%,s '-~>;vdhI(&qZ:[A>H7=ISPRZN8v1$׏DP+ٸg\dʋ F,K6#qx-9 5gOՑMŇ_N_1vh$pu2m:=-mA뤣͐ӉJb J,&5Q( l& Rs\3 Ic24Qu ڝL(4G ?up_{3XDz9y$fU/){24fd~.H!6uY5uFCA8yPfP(̠sή. GLGguti=9$ L28F J@FY>߄'|GmdC0>U . PT\?f۞NnehQG XL,&5jA^"yFNOv9jl&lpE0=U?="Q ǢR*paj>Ė}}\vyg>ܐx<zu P Ywq$&;^R"*#G5pх`mJ džl/ 9j1=iLZ.Ť 伳1Ą#";:G4YPK4L*6BvVl`ݴ(_ްqY,<{.gVںٴTk6;)VAx$Y PK}!(&Ƙ(,H_KkJx}m/_x;cb0:$:{^J%V36Ǎ_Ow^izFpEhlb`u1e }G 4~;`w8hlj""MihXG|'Xt4.KcZtwsfvnNeu ZASGSNʕQ6c%89Ǟj'wQd9ɓR/ݭn[x!( sf'v'ffZuɊB<1ש >KGTj7hy))ɂ/iNcJ՝~ָٲ( átrގ6-MiEP4]8CgYJy= 렝vKi>藁;&yAWC(d|+Clڼ? t~@] Χx$)~ZOU5=l졩e`$ Hѯx+ M f \SuY妰d- k>g^ srX {#/^.p >& m񻻤Fao4A%A75vˡio:edlt\ARxUTzTO[qَ<|lZ 1hͯ~ ϟ>~>QOJ:RVJ 24kXOAJ<9 `S^G~ bP@ ɮ={ l.$6:kW]X~ز;Eh*q #=_QAW%4`)clgQǖ 즦Uhs<Էٴ~-֯%olg₥0ev?=F (OkhGܲo?@NeB4{IH fS.[ r]w LY^O@ff^ YOl's?% 044fíz2<֗ Eif z~6|K&' < I޻<=W-E暫ң/d7'O&=3фVRTlq< \x>ߗ5o YzR&gcZ1kLcQjVRբ;b qFzA^sD6 ^Et:y6iimߧ/ӤfaPɀrrh2 (ki&QsWmU"|an˼v o`G7SR6 Eydji(N;s][xWca Mu/GH+6;&Lxȑ#+u:J)>/mQ(K/ݻwsg0>Q(.({j1'd{ 5`h͢|R1ᣱL#{B @"13u߇]ߝҫ+(<%pߥXyյL2 5KooNLJjM%##T ` Ȧ]x|E=!dں^kz5V,ӯ?}],qu454p@{aǎ픍Ag4NP(4= Hz˗Hee%}}}XR5sEKʔIC!?;kVitc"@BԥՋ! w~9AK0rLd5:}xM5+ɓ3rq~jc1M\4tepW!c嵰@h hAU{wRS}^ +.ʧɄ壿̼3Xt. {ڥēỌ/ lRl6gb1-ǎ{< =.ՉK_eZ4c f͚ Nb{'G7k\bՒTTT6C'{}aB!E5,V!WN;D^jX69)Y%<]d8nz5̚5Q|TB X>ȢZdf?橷N3&RM[yzy2H$G3 2= pv?>[}UWo|3֌,zdB`˪_{ ~}fWO~?M7Lg6&NZ,OVd@)Y9ǚװw yًF ) Q rrRl" F!:;p5V/7S^C#x@XS{v\pufq`afrWoF_WlCJfDwJeX2[ϫ디͘:a~pQ}00ң4M~RM,zt~)/n:#?*}}-,I/5 ';%M+r?ƓCNZ[X* {vlOON5ޠSa #-Mb)-2I;);Gt@T颾Ϛg۶-w8jМ\:`13^kT7~/ { 2hgzz>ݷ|3M466Z`02 ME`]ҿ斸j@ IT{n|~;jywvK DF p:uN ]L:sEC}ct450&' *Gؾi2LL{0gY!wƝNGъgJ79I"75s"zIm ӛ)(9H{[){/\sլ]ouAq>*F !5scm](Oa^fNvqOkis>m7^8N8QMG|MAr]]ǎ;lch܏UnfsBNKI/hb϶ Jhr:zikjp71,Ԃ {Ǒ7n APy/0\7~ݓbl'xS8w^l1}x|բud鬮c235tZDiz fc'8_, IDAT c)y\qr?ƺjzfۃspM *S8&)hjy~nw~{|޻g$j<@0]V Mo9ܢ<-ϭ駶ϑ ^ڣ,r02lfͱ*f=s/fFYX(/XKQ# J\!**@.ʕPQ ]^rQ钰K`HBf{NPQ櫊Gܥx2*&9%Sos'}TkBE pڣA/d)$`,w}~j2l2ZUjZ4Z-j>Oׇuˑz#hFzz~7o3SO(>?-@  P H/(mNji&0Z^ql% gfSVO@ɛF{O3y7V%ǍZo 4F=wm땬ZkӨvF h4`ښx8-vt:b b_HK,Nf1S?ŅЃG4_^b+=|0exqMT*JJ ƑL/5pQuOn=0Z[Z:E\NzzTJL9jKQ6cC>WZq_DWU7Ā3 ": XCk?0`OJss"vYrPRs oSSo{r(+I~ qETi}4G\Ywns S0~M.ĈԼO!J1O՞ ({1@e 2UuAlD+Mh;ۢ<-UuV\42*IA@ m/ê%f%Fu,1f'GR7:x?N\ًCP8T*!R,fJu(FnB&~_Ē_yD=)vRL뀤HJYWꯏQct:vmA0,jښl707DVsjBTcX-Orkw8F+Tel 8΍ŨdLCB?9phqx&Z:x|% Z]\ ֨Qh4Xktrѭ>~t/ wyCrBᐨgIf 9uuukb9Œ+RTVx?)_b[$'{ J}N[h':7b0j"fVmJ'K .ٱ<|;c6!yﰸ~HmsWT&?β$T`W,d>wJx(: jEgBUF{W-13Xdڴi.]qgMßq(--}رcqt(A蓛Dھ}XuQ)%K }wn`Y\^S 198{{덖jtAfAԩ\կlc휨;=!Zpi,li6G4E3 2rb.2ċi FJ`X0ӇVѨEeP(p|\ۚa.\x9zޟZ1eچaGBRM@t:sk( ˔jM|-YXT#}65%:,:l@W(ǏkN3[/)PjzM(Z) }|\9>sv7䜼X1 ;xb~Bd&3KO_[6n$+݆Jkt8X|U|Lzf&ggLn.u2!^}p߻Xt uXu!ΝeKXXQP"&}aܾ0QHnN (mьwA>j9bk}Nr_N'`*i z'Mh42 7_3]p~S: ,Vm*Q厯%5kB!3+‚BL Zimk#+7˗v3~tfjT|>bR,{ 3gGߤY2Gֶ~,F0SaO͐,9t Bb/vŽNW43HHI`0M47yd?E_ :T*eesaؒ6.XMՊHHdB) (Vfŗ+׳&vlXKt&<;'߳U C\,Ev0[4&lG RH:N2*RaTofbhT?#;M_DԨ5qӇfQ_WOnNd?M;H48.~oX8a 䥄YrN>~{u8kT2T*jJI0$q)F&琋Xr hD^\( h'%;b?ߧ@$$t1vAUpza$7Pqj4H:\c!jytBhJ?SV.PHqݳلբ0ʦ3idz=$RCt\*8ium6:ȱ*N? Wc5FR0 Tp0$FP4IOt)DS}= MGyUg.e0Y1Y,}/Z\hѣ [YԢH]E2aB **aFPnx 5 04,ic51+[PGZJRJFWGCBAHV$"$>@("~+i'kw8;+^[:n5,67pDgϝg#I6rJU['C^XbED" !zu`TB$Q2TPOhh0H E9*A!@ 71FébT[ϻ[=#@~E55-`0šfi 3qeGU2 ;F_剂Hu4PktjNBP=^F~+@z)142Npj ~E|.'ZjUT 18,*[,V3{v?^ℿ֎DQx|V 7;QD"ʽ{E@Ft*ABТQ%8eT \}F&>@1 -; =BҒj:7erN4&ȵG:[X|^pf)\bZ@ P8@+b2i$}D)~g(ÄЫZ$` w qV@NYBT,@4!M|mdF'1ur9&Qq8}K9M|wQ(u S#k}P(4\s-ӧM%f͡%&XI@d DѨEK *uhЧpB8%% 擗s-/⅏jP qNZz6&KGٹy;cGW?P)aT s1zCFa NaHR2DjXBjDK驲S]IJ)8шhӥމ'k^{-Zė;Khu)[ ü?@IIɖX%aAr6z#Px)CbIH0I$jl>ɑ|1FMC%BL*bl6c2dhZB'IUӠ19JjWԟ8c`FblJ)/**V&^ćAE"B,ѠicA"AT+QC&Ze0ͲE  #r-B`ғ6#gD=hgOFF9oDqKFպB4h$+ 5j0 GxqC__|q_eEb* bX),,l6?Hmnp8LZJ??V ;3H$᪃ߞV S[[;](&4aK' ,K $@@BZRI@4aV 9 ,^~Y|=Nzg`Xqt@@fQ@73 -łRWOE3CG[G@zF'~ GQD[[@ɣV׈8, RDDd]1D@PJ츆BAB !7~1?j }̝ZxM5;Ӧsõ_ d2-z'zy ˅d"st<(! j@8@Л7apF&';Z>r]w(?v G!D0tzYtBB%"tP݃UBAFcs`AVS}55L<{﹇&QRX>?~EG:;{v'OG ah<LF#~ 1(Y@ DFV?x7E(N9DLIaM}w-<Ѓexv5?t~TV}?K>ڴ??+2rrOl7EEG*o~ÎwY+T܁|TzCF[ՇP_[ˬ HI7Ѻzz zC?")044CVh4k4C|ky =鏽 #p?&'ǑKZ-%bT¡~}_ ښ!d!'w|>J˒fK~J4탄=.ꛚy쉧9QwtjKlB4x{^Dl  n4h8t0Y?ei飭/Ba嗯ᲥK_XRFhBL3Rяc__fߎ,V1 Q'{㥺S)*/f0ev9 -m8\zh՞`m *9g)*$DBRAh4H@TVFj]tw "gK/<à3ĀH&T.@1"B)3hjz04MBc[ѕߺU_%|0|*om5/Zjɗ?h墼dp&1&$y P(-5¯jVe :?mR8>Ru7DQ^/% 0,}4Q  )H3"ٳ02|*w]6Vlȡ6}pw=w"Gز~-f~Ogk#HdCvG qFAPv) \n4~^5YVߠhlj233ɦ{D+`hkBKWpir/ $ ހB@(9] T+ $(A wTfɒtrpn)6krm1cYRRɂְy:Vڰ/Qk1th & zkZ&6 u4;B#Z}R(4B TIȐG ;{&aQ{ޅV~Lo?-CTڒaBnqX8"Ѩv~n/mMoWGwRR h:|^/!JMJjʰKA!5Պɚ``lA!mt:`P(DZj*9c9N~aڿVGF Ju3P(lP! AiN< Nwg'k z6+ _0@d-OU+زlj22ڻzOĝݒPb~T>ܼG~ kX:>~oc~x(8-`Zm`P7o]z:)0IH$WQZRFYSZZ/@H@:APԸ#)P(Oy(t] NГjKA!hea ;%.8?Ŭy=5^Cq~b 3谣dJǞd}ZϙOXέ;Ol\6rD]OT?< ӃJei'jEu:V}9 N~( zӈ|n?)6,[gtp|i;ve|K_l2%|kגbKe9G']~G([ /͸(K}m-&[t Sg䒋.Dw+%0EQ&S]4: \͖[ݝVC9yf[0ٳh: Ra,>mz}G?U+hh̼qYsf3хL޴ 3yM$N!!}305Xi;W:mY0aS&7y#5M[Y)7,!2ɱgB~̓6[oY ,à^ņud8~U|Y9&0ˮ]pKo ~˞NPjΛwϿ;M\{uxN\8]< [1O>Mp৐=@&cB\?=3GHYH˲"Œ|? GӴVH+R; u;Դ J:aժGxo?hlıQ._8{Z>;>b^^xn-{R;ʂ Xvm$Ncӫ/GW^L]m .lp5W/5kg,tRewןp'2(8%i"V~q (#wmKR+ǩVAVz3gV@m0 `cЩ^|)˾s>+^ZY0f( I.uzxv-]pYsٽwxˢ,9,NKs[/}W6Φ?m?G?K4`_^V>siIރc8f)B"p ڥcooI l;::֧R)dYAQ+UUC EQhC?Ǥ8={۷oe%<")IUhY7Lc34'|oL+.ŵkٵIS8w|^wv6C:o7y߰k$ |lw\c,x}{ pz)AE)8fL\vaM\vtt߽{wZQi.mc\q٥::S"<@7U&t$$F L9DPG~p ^z1|/Yf Т.rD\,h1(˸$ 3y\qL$% ({pװ}cOOV!ĻԖBJW( zd^߽±J͹%zAb>1- -ubTYGUTץ?)N8XF٪P*B<+%Ξ}#LA5]7s*KCF20"A_~\gsFqdn-~R3Zt(qr1H-YF+d$!MKHq+ǫPn6\E(0Vk]ڤhKbQ?!!*KL(m"bN~@,cETw4ClUoWr##/!P%"8# `cA{S kxa a 5#G/IHp$?Xy Pzڗ0 =/`[ K2AmTU%t*Dž5kV_8+@T0(`Y@0Hh) Y%#ADEH$kkhy*frZ{GD(G% '6yg 2%Qa$D-Qe Iv@hxZH&'RWWGǜ9y`#BPТz#pwnDaebqҌ$;,cNc88L̈́8'NŋL2Wm{yhdDuw31!\`6 ~ (~RdFc$$$I!Gk3x&M$5$I_IӴUC LS%-3Pi3ʦE6Jd&V* j@,cڴL2dmu]׉FDQb^gMlU `a !pyO2rBF(2fmkT1,#;699N}}=f3}TboAc'Hk4h4NC[Bm۷ !^&5$qʌ*K~E=M@ELϋ` , 'V@KK >H/l8vXYU8q/ !|`x'OFGȤmLT,#`%uy,plǠPISpUV,˨J&NMU{ui> %_qECBA@S.7tSF<:[j3J:T*uEl6K&!͒x0-ɠ_3 l'yM{}MwT_5Q;wޕfrCoτ J3!\. *:wVq!gZ}$Iw{9a>v1\3J0ܥ$@zuڵbxa MQ lI/.A^WCWwwL4ZueYg۶bYV @.o yRTaT5ӓtֶЋ~5LE*:]rIENDB`hotssh-0.2.6+dfsg1/hotssh.desktop.in0000644000175000017500000000031011035655040015774 0ustar javijavi[Desktop Entry] _Name=Secure Shell _Comment=Connect to a remote computer using Secure Shell Exec=hotssh Terminal=false Type=Application Icon=hotwire-openssh Categories=GTK;Network; StartupNotify=true hotssh-0.2.6+dfsg1/hotssh/0000755000175000017500000000000011122614266014004 5ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotlib/0000755000175000017500000000000011122614266015265 5ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotlib/__init__.py0000644000175000017500000000000011027562325017366 0ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotlib/timesince.py0000644000175000017500000000776711027562325017642 0ustar javijavi# This is lifted from Django: # http://code.djangoproject.com/browser/django/trunk/django/utils/timesince.py #Copyright (c) 2005, the Lawrence Journal-World #All rights reserved. # #Redistribution and use in source and binary forms, with or without modification, #are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # 3. Neither the name of Django nor the names of its contributors may be used # to endorse or promote products derived from this software without # specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR #ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES #(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON #ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import datetime from gettext import ngettext def timesince(d, now=None): """ Takes two datetime objects and returns the time between d and now as a nicely formatted string, e.g. "10 minutes". If d occurs after now, then "0 minutes" is returned. Units used are years, months, weeks, days, hours, and minutes. Seconds and microseconds are ignored. Up to two adjacent units will be displayed. For example, "2 weeks, 3 days" and "1 year, 3 months" are possible outputs, but "2 weeks, 3 hours" and "1 year, 5 days" are not. Adapted from http://blog.natbat.co.uk/archive/2003/Jun/14/time_since """ chunks = ( (60 * 60 * 24 * 365, lambda n: ngettext('year', 'years', n)), (60 * 60 * 24 * 30, lambda n: ngettext('month', 'months', n)), (60 * 60 * 24 * 7, lambda n : ngettext('week', 'weeks', n)), (60 * 60 * 24, lambda n : ngettext('day', 'days', n)), (60 * 60, lambda n: ngettext('hour', 'hours', n)), (60, lambda n: ngettext('minute', 'minutes', n)) ) # Convert datetime.date to datetime.datetime for comparison if d.__class__ is not datetime.datetime: d = datetime.datetime(d.year, d.month, d.day) if now: t = now.timetuple() else: t = time.localtime() tz = None now = datetime.datetime(t[0], t[1], t[2], t[3], t[4], t[5], tzinfo=tz) # ignore microsecond part of 'd' since we removed it from 'now' delta = now - (d - datetime.timedelta(0, 0, d.microsecond)) since = delta.days * 24 * 60 * 60 + delta.seconds if since <= 0: # d is in the future compared to now, stop processing. return _('in the future') if since < 60: return _('less than 1 minute ago') for i, (seconds, name) in enumerate(chunks): count = since // seconds if count != 0: break s = None if i + 1 < len(chunks): # Now get the second item seconds2, name2 = chunks[i + 1] count2 = (since - (seconds * count)) // seconds2 if count2 != 0: s = _('%(number)d %(type)s, %(number2)d %(type2)s ago') % {'number': count, 'type': name(count), 'number2': count2, 'type2': name2(count2)} if not s: s = _('%(number)d %(type)s ago') % {'number': count, 'type': name(count)} return s hotssh-0.2.6+dfsg1/hotssh/hotlib/logutil.py0000644000175000017500000000410411027562325017317 0ustar javijavi# This file is part of the Hotwire Shell project API. # Copyright (C) 2007 Colin Walters # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies # of the Software, and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR # THE USE OR OTHER DEALINGS IN THE SOFTWARE. import sys, logging, logging.config, StringIO def log_except(logger=None, text=''): def annotate(func): def _exec_cb(*args, **kwargs): try: return func(*args, **kwargs) except: log_target = logger or logging log_target.exception('Exception in callback%s', text and (': '+text) or '') return _exec_cb return annotate def init(default_level, debug_modules, prefix=None): rootlog = logging.getLogger() fmt = logging.Formatter("%(asctime)s [%(thread)d] %(name)s %(levelname)s %(message)s", "%H:%M:%S") stderr_handler = logging.StreamHandler(sys.stderr) stderr_handler.setFormatter(fmt) rootlog.setLevel(default_level) rootlog.addHandler(stderr_handler) for logger in [logging.getLogger(prefix+x) for x in debug_modules]: logger.setLevel(logging.DEBUG) logging.debug("Initialized logging") hotssh-0.2.6+dfsg1/hotssh/hotvte/0000755000175000017500000000000011122614266015315 5ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotvte/__init__.py0000644000175000017500000000000011027562325017416 0ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotvte/vteterm.py0000644000175000017500000002452711043465532017371 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os,sys,threading,pty,logging import gtk, gobject, pango import vte try: import gconf gconf_available = True except: gconf_available = False _logger = logging.getLogger("hotssh.VteTerminal") class VteTerminalScreen(gtk.Bin): def __init__(self): super(VteTerminalScreen, self).__init__() self.term = vte.Terminal() self.__termbox = gtk.HBox() self.__scroll = gtk.VScrollbar(self.term.get_adjustment()) border = gtk.Frame() border.set_shadow_type(gtk.SHADOW_ETCHED_IN) border.add(self.term) self.__termbox.pack_start(border) self.__termbox.pack_start(self.__scroll, False) self.add(self.__termbox) def do_size_request(self, req): (w,h) = self.__termbox.size_request() req.width = w req.height = h def do_size_allocate(self, alloc): self.allocation = alloc wid_req = self.__termbox.size_allocate(alloc) gobject.type_register(VteTerminalScreen) # From gnome-terminal src/terminal-screen.c _USERCHARS = "-A-Za-z0-9" _PASSCHARS = "-A-Za-z0-9,?;.:/!%$^*&~\"#'" _HOSTCHARS = "-A-Za-z0-9" _PATHCHARS = "-A-Za-z0-9_$.+!*(),;:@&=?/~#%" _SCHEME = "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)" _USER = "[" + _USERCHARS + "]+(:[" + _PASSCHARS + "]+)?" _URLPATH = "/[" + _PATHCHARS + "]*[^]'.}>) \t\r\n,\\\"]" class VteTerminalWidget(gtk.VBox): __gsignals__ = { "child-exited" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), "fork-child" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } def __init__(self, cwd=None, cmd=None, ptyfd=None, initbuf=None, **kwargs): super(VteTerminalWidget, self).__init__() self.__screen = screen = VteTerminalScreen() self.__term = screen.term self.pack_start(screen, expand=True) self.pid = None self.exited = False self.__actions = [ ('Copy', 'gtk-copy', _('_Copy'), 'C', _('Copy selected text'), self.__copy_cb), ('Paste', 'gtk-paste', _('_Paste'), 'V', _('Paste text'), self.__paste_cb), ] self.__action_group = gtk.ActionGroup('TerminalActions') self.__action_group.add_actions(self.__actions) self.__copyaction = self.__action_group.get_action('Copy') self.__pasteaction = self.__action_group.get_action('Paste') # Various defaults self.__term.set_emulation('xterm') self.__term.set_allow_bold(True) self.__term.set_size(80, 24) self.__term.set_scrollback_lines(1500) self.__term.set_mouse_autohide(True) self.__colors_default = True self.__term.set_default_colors() if gconf_available: self.__set_gnome_colors() else: self.__set_gtk_colors() # Use Gnome font if available if gconf_available: gconf_client = gconf.client_get_default() def on_font_change(*args): mono_font = gconf_client.get_string('/desktop/gnome/interface/monospace_font_name') _logger.debug("Using font '%s'", mono_font) font_desc = pango.FontDescription(mono_font) self.__term.set_font(font_desc) gconf_client.notify_add('/desktop/gnome/interface/monospace_font_name', on_font_change) on_font_change() self.__match_asis = self.__term.match_add("\\<" + _SCHEME + "//(" + _USER + "@)?[" + _HOSTCHARS + ".]+" + \ "(:[0-9]+)?(" + _URLPATH + ")?\\>/?") self.__match_http = self.__term.match_add("\\<(www|ftp)[" + _HOSTCHARS + "]*\\.[" + _HOSTCHARS + ".]+" + \ "(:[0-9]+)?(" + _URLPATH + ")?\\>/?") self.__term.connect('button-press-event', self.__on_button_press) self.__term.connect('selection-changed', self.__on_selection_changed) self.__on_selection_changed() if ptyfd is not None: # If we have a PTY, set it up immediately self.__idle_do_cmd_fork(None, cwd, ptyfd, initbuf) else: # http://code.google.com/p/hotwire-shell/issues/detail?id=35 # We do the command in an idle to hopefully have more state set up by then; # For example, "top" seems to be sized correctly on the first display # this way gobject.timeout_add(250, self.__idle_do_cmd_fork, cmd, cwd, ptyfd, initbuf) def __idle_do_cmd_fork(self, cmd, cwd, ptyfd, initbuf): _logger.debug("Forking cmd: %r", cmd) self.__term.connect("child-exited", self._on_child_exited) if cwd: kwargs = {'directory': cwd} else: kwargs = {} if ptyfd: self.__term.set_pty(ptyfd) pid = None elif cmd: pid = self.__term.fork_command(cmd[0], cmd, **kwargs) else: pid = self.__term.fork_command(**kwargs) if initbuf is not None: self.__term.feed(initbuf) self.pid = pid self.emit('fork-child') def __on_button_press(self, term, event): match = self.__term.match_check(int(event.x/term.get_char_width()), int(event.y/term.get_char_height())) if event.button == 1 and event.state & gtk.gdk.CONTROL_MASK: if not match: return (matchstr, mdata) = match if mdata == self.__match_http: url = 'http://' + matchstr else: url = matchstr self.__open_url(url) return True elif event.button == 3: menu = gtk.Menu() menuitem = self.__copyaction.create_menu_item() menu.append(menuitem) menuitem = self.__pasteaction.create_menu_item() menu.append(menuitem) if match: (matchstr, mdata) = match menuitem = gtk.ImageMenuItem(_('Open Link')) menuitem.set_property('image', gtk.image_new_from_stock('gtk-go-to', gtk.ICON_SIZE_MENU)) menuitem.connect('activate', lambda menu: self.__open_url(url)) menu.append(gtk.SeparatorMenuItem()) menu.append(menuitem) extra = self._get_extra_context_menuitems() if len(extra) > 0: menu.append(gtk.SeparatorMenuItem()) for item in extra: menu.append(item) menu.show_all() menu.popup(None, None, None, event.button, event.time) return True return False def _get_extra_context_menuitems(self): return [] def __open_url(self, url): # Older webbrowser.py didn't check gconf from hotwire.sysdep import is_windows if sys.version_info[0] == 2 and sys.version_info[1] < 6 and (not is_windows()): try: import hotwire.externals.webbrowser as webbrowser except ImportError, e: _logger.warn("Couldn't import hotwire.externals.webbrowser", exc_info=True) import webbrowser else: import webbrowser webbrowser.open(url) def __on_selection_changed(self, *args): have_selection = self.__term.get_has_selection() self.__copyaction.set_sensitive(have_selection) def __copy_cb(self, a): _logger.debug("doing copy") self.__term.copy_clipboard() def __paste_cb(self, a): _logger.debug("doing paste") self.__term.paste_clipboard() def _on_child_exited(self, term): _logger.debug("Caught child exited") self.exited = True self.emit('child-exited') def get_vte(self): return self.__term def get_action_group(self): return self.__action_group def set_copy_paste_actions(self, copyaction, pasteaction): """Useful in an environment where there is a global UI rather than a merged approach.""" self.__copyaction = copyaction self.__pasteaction = pasteaction def __set_gnome_colors(self): gconf_client = gconf.client_get_default() term_profile = '/apps/gnome-terminal/profiles/Default' fg_key = term_profile + '/foreground_color' bg_key = term_profile + '/background_color' def on_color_change(*args): if not self.__colors_default: return fg = gtk.gdk.color_parse(gconf_client.get_string(fg_key)) self.set_color(True, fg, isdefault=True) bg = gtk.gdk.color_parse(gconf_client.get_string(bg_key)) self.set_color(False, bg, isdefault=True) gconf_client.notify_add(fg_key, on_color_change) gconf_client.notify_add(bg_key, on_color_change) on_color_change() def __set_gtk_colors(self): fg = self.style.text[gtk.STATE_NORMAL] bg = self.style.base[gtk.STATE_NORMAL] self.set_color(True, fg, isdefault=True) self.set_color(False, bg, isdefault=True) def set_color(self, is_foreground, color, isdefault=False): if not isdefault: self.__colors_default = False if is_foreground: self.__term.set_color_foreground(color) self.__term.set_color_bold(color) self.__term.set_color_dim(color) else: self.__term.set_color_background(color) hotssh-0.2.6+dfsg1/hotssh/hotvte/vtewindow.py0000644000175000017500000005420711045670041017722 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os,sys,platform,logging,getopt import locale,threading,subprocess,time import signal import gtk,gobject,pango import dbus,dbus.glib,dbus.service from hotssh.hotvte.vteterm import VteTerminalWidget from hotssh.hotlib_ui.msgarea import MsgAreaController from hotssh.hotlib_ui.quickfind import QuickFindWindow _logger = logging.getLogger("hotvte.VteWindow") class QuickSwitchTabWindow(QuickFindWindow): def __init__(self, vtewin): self.__vtewin = vtewin super(QuickSwitchTabWindow, self).__init__(_('Tab Search'), parent=vtewin) def _do_search(self, text): for widget in self.__vtewin.get_tabs(): title = widget.get_title() markup = self._markup_search(title, text) if markup is not None: yield (title, markup, None) class TabbedVteWidget(VteTerminalWidget): __gsignals__ = { "metadata-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } def __init__(self, cmd=None, *args, **kwargs): super(TabbedVteWidget, self).__init__(cmd=cmd, *args, **kwargs) self.__title = ' '.join(cmd) def get_title(self): return self.__title def get_pixbuf(self): return None class VteWindow(gtk.Window): __gsignals__ = { "window-close" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), "shutdown" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } ascii_nums = [long(x+ord('0')) for x in xrange(10)] def __init__(self, factory=None, title=None, icon_name=None, **kwargs): super(VteWindow, self).__init__() self.__factory = factory self.__idle_save_session_id = 0 self.__old_char_height = 0 self.__old_char_width = 0 self.__old_geom_widget = None self.__vbox = vbox = gtk.VBox() self.add(vbox) self.__ui_string = """ """ self.__create_ui() vbox.pack_start(self.__ui.get_widget('/Menubar'), expand=False) self.__msgarea_mgr = MsgAreaController() vbox.pack_start(self.__msgarea_mgr, expand=False) self.connect("key-press-event", self.__on_keypress) self.__title = title self.set_title(title) self.set_default_size(720, 540) if os.getenv('HOTWIRE_UNINSTALLED'): # For some reason set_icon() started failing...do it manually. iinf = gtk.icon_theme_get_default().lookup_icon(icon_name, 24, 0) if iinf: fn = iinf.get_filename() self.set_icon_from_file(fn) else: self.set_icon_name(icon_name) self.connect("delete-event", lambda w, e: False) self.__tips = gtk.Tooltips() self.__notebook = gtk.Notebook() vbox.pack_start(self.__notebook) self.__notebook.connect('switch-page', self.__on_page_switch) self.__notebook.set_scrollable(True) self.__notebook.show() self.__tabs_visible = self.__notebook.get_show_tabs() self.__queue_session_save() def __queue_session_save(self): self.__factory.queue_save_session() def new_tab(self, args, cwd): widget = TabbedVteWidget(cmd=args, cwd=cwd) return self.append_widget(widget) def remote_new_tab(self, args, cwd): return self.new_tab(args, cwd) def __sync_metadata(self, widget): title = widget.get_title() label = widget.get_data('tab-label') label.set_text(title) self.__tips.set_tip(label, title) img = widget.get_data('tab-image') pixbuf_or_path = widget.get_pixbuf() if isinstance(pixbuf_or_path,basestring): pixbuf = gtk.gdk.pixbuf_new_from_file(pixbuf_or_path) else: pixbuf = pixbuf_or_path img.set_from_pixbuf(pixbuf) def append_widget(self, term): idx = self.__notebook.append_page(term) term.connect('metadata-changed', self.__sync_metadata) term.get_vte().connect('selection-changed', self.__sync_selection_sensitive) term.get_term().set_copy_paste_actions(self.__ag.get_action('Copy'), self.__ag.get_action('Paste')) if hasattr(term, 'has_close'): has_close = term.has_close() else: has_close = False if has_close: term.connect('close', self.__on_widget_close) if hasattr(self.__notebook, 'set_tab_reorderable'): self.__notebook.set_tab_reorderable(term, True) (label, icon) = self.__add_widget_title(term) self.__sync_metadata(term) term.show_all() self.__notebook.set_current_page(idx) term.get_vte().grab_focus() return term def _get_notebook(self): return self.__notebook def _get_vbox(self): return self.__vbox def _get_msgarea_mgr(self): return self.__msgarea_mgr def __on_page_switch(self, n, p, pn): _logger.debug("got page switch, pn=%d", pn) widget = self.__notebook.get_nth_page(pn) term = widget.get_vte() (cw, ch, (xp, yp)) = (term.get_char_width(), term.get_char_height(), term.get_padding()) if not (cw == self.__old_char_width and ch == self.__old_char_height and widget == self.__old_geom_widget): _logger.debug("resetting geometry on %s %s %s => %s %s", widget, self.__old_char_width, self.__old_char_height, cw, ch) kwargs = {'base_width':xp, 'base_height':yp, 'width_inc':cw, 'height_inc':ch, 'min_width':xp+cw*4, 'min_height':yp+ch*2} _logger.debug("setting geom hints: %s", kwargs) self.__geom_hints = kwargs self.set_geometry_hints(widget, **kwargs) self.__old_char_width = cw self.__old_char_height = ch self.__old_geom_widget = widget self.__sync_selection_sensitive() self.set_title('%s - %s' % (widget.get_title(),self.__title)) self.__queue_session_save() def __on_keypress(self, s2, e): if e.keyval == gtk.gdk.keyval_from_name('Page_Up') and \ e.state & gtk.gdk.CONTROL_MASK: idx = self.__notebook.get_current_page() self.__notebook.set_current_page(idx-1) return True elif e.keyval == gtk.gdk.keyval_from_name('Page_Down') and \ e.state & gtk.gdk.CONTROL_MASK: idx = self.__notebook.get_current_page() self.__notebook.set_current_page(idx+1) return True elif e.keyval in VteWindow.ascii_nums and \ e.state & gtk.gdk.MOD1_MASK: self.__notebook.set_current_page(e.keyval-ord('0')-1) #extra -1 because tabs are 0-indexed return True elif e.keyval == gtk.gdk.keyval_from_name('Return'): widget = self.__notebook.get_nth_page(self.__notebook.get_current_page()) if widget.get_exited(): self.__close_tab(widget) return True return False def __create_ui(self): self.__using_accels = True self.__ag = ag = gtk.ActionGroup('WindowActions') self.__actions = actions = [ ('FileMenu', None, _('File')), ('DetachTab', None, _('_Detach Tab'), 'D', 'Move tab into new window', self.__detach_cb), ('TabSearch', None, '_Search Tabs', 'L', 'Search across tab names', self.__quickswitch_tab_cb), ('Close', gtk.STOCK_CLOSE, _('_Close'), 'W', 'Close the current tab', self.__close_cb), ('Quit', gtk.STOCK_QUIT, _('_Quit'), 'Q', 'Quit application', self.__quit_cb), ('EditMenu', None, _('Edit')), ('Copy', gtk.STOCK_COPY, _('_Copy'), 'C', 'Copy selected text', self.__copy_cb), ('Paste', gtk.STOCK_PASTE, _('_Paste'), 'V', 'Paste text', self.__paste_cb), ('ViewMenu', None, _('View')), ('HelpMenu', None, _('Help')), ('About', gtk.STOCK_ABOUT, _('_About'), None, 'About this application', self.__help_about_cb), ] ag.add_actions(actions) self.__ui = gtk.UIManager() self.__ui.insert_action_group(ag, 0) self.__ui.add_ui_from_string(self.__ui_string) self.add_accel_group(self.__ui.get_accel_group()) def _merge_ui(self, actions, uistr): self.__ag.add_actions(actions) self.__ui_merge_id = self.__ui.add_ui_from_string(uistr) return self.__ag def _get_ui(self): return self.__ui def __add_widget_title(self, w): hbox = gtk.HBox() piximg = gtk.Image() w.set_data('tab-image', piximg) hbox.pack_start(piximg, expand=False, padding=6) label = gtk.Label('') label.set_selectable(False) label.set_ellipsize(pango.ELLIPSIZE_END) hbox.pack_start(label, expand=True) close = gtk.Button() close.set_focus_on_click(False) close.set_relief(gtk.RELIEF_NONE) close.set_name('hotwire-tab-close') img = gtk.Image() img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU) close.add(img) close.connect('clicked', lambda b: self.__close_tab(w)) (width, height) = gtk.icon_size_lookup_for_settings(label.get_settings(), gtk.ICON_SIZE_MENU) close.set_size_request(width + 2, height + 2) hbox.pack_start(close, expand=False) hbox.show_all() self.__notebook.set_tab_label(w, hbox) w.set_data('tab-label', label) self.__notebook.set_tab_label_packing(w, True, True, gtk.PACK_START) self.__sync_tabs_visible() return (label, piximg) def __close_tab(self, w): self.__remove_page_widget(w) w.destroy() def __close_cb(self, action): self.__remove_page_widget(self.__notebook.get_nth_page(self.__notebook.get_current_page())) def __quit_cb(self, action): self.emit('shutdown') def __on_widget_close(self, widget): self.__remove_page_widget(widget) def __help_about_cb(self, action): self._do_about() def _do_about(self): raise NotImplementedError() def get_tabs(self): return self.__notebook.get_children() def __quickswitch_tab_cb(self, action): w = QuickSwitchTabWindow(self) tabtitle = w.run_get_value() if tabtitle is None: return _logger.debug("got switch title: %r", tabtitle) for child in self.__notebook.get_children(): if child.get_title() == tabtitle: self.__notebook.set_current_page(self.__notebook.page_num(child)) break def __sync_tabs_visible(self): multitab = self.__notebook.get_n_pages() > 1 self.__ag.get_action('DetachTab').set_sensitive(multitab) self.__ag.get_action('TabSearch').set_sensitive(multitab) self.__notebook.set_show_tabs(multitab) def __remove_page_widget(self, w): idx = self.__notebook.page_num(w) _logger.debug("tab closed, current: %d", idx) self.__notebook.remove_page(idx) self.__sync_tabs_visible() if self.__notebook.get_n_pages() == 0: self.destroy() def __sync_selection_sensitive(self, *args): have_selection = self.__notebook.get_nth_page(self.__notebook.get_current_page()).get_vte().get_has_selection() self.__ag.get_action('Copy').set_sensitive(have_selection) def __copy_cb(self, a): _logger.debug("doing copy") widget = self.__notebook.get_nth_page(self.__notebook.get_current_page()) widget.get_vte().copy_clipboard() def __paste_cb(self, a): _logger.debug("doing paste") widget = self.__notebook.get_nth_page(self.__notebook.get_current_page()) widget.get_vte().paste_clipboard() def __detach_cb(self, a): widget = self.__notebook.get_nth_page(self.__notebook.get_current_page()) self.__remove_page_widget(widget) win = self.__factory.create_window() win.append_widget(widget) win.show_all() _factory = None class VteWindowFactory(gobject.GObject): __gsignals__ = { "shutdown" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } def __init__(self, klass, window_args, app): super(VteWindowFactory, self).__init__() self.__windows = set() self.__klass = klass self.__app = app self.__window_args = window_args self.__sticky_keywords = {'subtitle': ''} self.__sticky_keywords.update(window_args) self.__recentwindow = None self.__idle_save_session_id = 0 @staticmethod def getInstance(): global _factory if _factory is None: _factory = VteWindowFactory() return _factory def offer_load_session(self): dlg = Load def create_initial_window(self, *args, **kwargs): win = self.create_window(is_initial=True, *args, **kwargs) self.__recentwindow = win return win def create_window(self, is_initial=False, *args, **kwargs): _logger.debug("creating window") if is_initial: for k,v in kwargs.iteritems(): if self.__sticky_keywords.has_key(k): self.__sticky_keywords[k] = v for k,v in self.__sticky_keywords.iteritems(): if not kwargs.has_key(k): kwargs[k] = v win = self.__klass(factory=self, is_initial=is_initial, **kwargs) win.connect('notify::is-active', self.__on_window_active) win.connect('destroy', self.__on_win_destroy) win.connect('shutdown', self.__on_win_shutdown) self.__windows.add(win) return win def remote_new_tab(self, cmd, cwd): self.__recentwindow.remote_new_tab(cmd, cwd) return self.__recentwindow def queue_save_session(self): if self.__idle_save_session_id == 0: self.__idle_save_session_id = gobject.timeout_add(5*1000, self.__idle_save_session) def __save_session_now(self): if self.__idle_save_session_id > 0: gobject.source_remove(self.__idle_save_session_id) self.__idle_save_session() def __idle_save_session(self): self.__idle_save_session_id = 0 self.__app.save_session() def _get_windows(self): return self.__windows def __on_window_active(self, win, *args): active = win.get_property('is-active') if active: self.__recentwindow = win def __on_win_destroy(self, win): _logger.debug("got window destroy") self.__save_session_now() self.__windows.remove(win) win.get_child().destroy() if len(self.__windows) == 0: self.emit('shutdown') gtk.main_quit() def __on_win_shutdown(self, win): self.emit('shutdown') gtk.main_quit() class UiProxy(dbus.service.Object): def __init__(self, factory, bus_name, ui_iface, ui_opath): super(UiProxy, self).__init__(dbus.service.BusName(bus_name, bus=dbus.SessionBus()), ui_opath) self.__winfactory = factory # This is a disturbing hack. But it works. def RunCommand(self, timestamp, istab, cmd, cwd): _logger.debug("Handling RunCommand method invocation ts=%r cmd=%r cwd=%r)", timestamp, cmd, cwd) if istab: curwin = self.__winfactory.remote_new_tab(cmd, cwd) else: raise NotImplementedError('can only create new tabs') timestamp = long(timestamp)+1 if timestamp > 0: _logger.debug("presenting with timestamp %r", timestamp) curwin.present_with_time(timestamp) else: curwin.present() setattr(UiProxy, 'RunCommand', dbus.service.method(ui_iface, in_signature='ubass')(RunCommand)) class VteRemoteControl(object): def __init__(self, name, bus_name=None, ui_opath=None, ui_iface=None): super(VteRemoteControl, self).__init__() self.__bus_name = bus_name or ('org.hotwireshell.HotVTE.' + name) self.__ui_opath = ui_opath or ('/hotvte/' + name + '/ui') self.__ui_iface = ui_iface or (self.__bus_name + '.Ui') def __parse_startup_id(self): startup_time = None try: startup_id_env = os.environ['DESKTOP_STARTUP_ID'] except KeyError, e: startup_id_env = None if startup_id_env: idx = startup_id_env.find('_TIME') if idx > 0: idx += 5 startup_time = int(startup_id_env[idx:]) return startup_time def single_instance(self, replace=False): proxy = dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') flags = 1 | 4 # allow replacement | do not queue if replace: flags = flags | 2 # replace existing _logger.debug("Requesting D-BUS name %s on session bus", self.__bus_name) if not proxy.RequestName(self.__bus_name, dbus.UInt32(flags)) in (1,4): inst = dbus.SessionBus().get_object(self.__bus_name, self.__ui_opath) inst_iface = dbus.Interface(inst, self.__ui_iface) _logger.debug("Sending RunCommand to existing instance") # TODO support choosing tab/window starttime = self.__parse_startup_id() inst_iface.RunCommand(dbus.UInt32(starttime or 0), True, dbus.Array(sys.argv[1:], signature="s"), os.getcwd()) sys.exit(0) os._exit(0) def get_proxy(self, factory): return UiProxy(factory, self.__bus_name, self.__ui_iface, self.__ui_opath) class VteApp(object): def __init__(self, windowklass): super(VteApp, self).__init__() self.__windowklass = windowklass self.__factory = None @staticmethod def get_name(): raise NotImplementedError() def get_remote(self): return VteRemoteControl(self.get_name()) def get_factory(self): if self.__factory is None: self.__factory = VteWindowFactory(self.__windowklass, {}, self) return self.__factory def offer_load_session(self): pass def on_shutdown(self, factory): # We used to save the session here, but now that is done in # the window shutdown above pass def save_session(self): _logger.debug("noop session save") pass class VteMain(object): def main(self, appklass): default_log_level = logging.WARNING if 'HOTVTE_DEBUG' in os.environ: default_log_level = logging.DEBUG import hotssh.hotlib.logutil mods = os.environ.get('HOTVTE_DEBUG_MODULES', '') if mods: mods = mods.split(',') else: mods = [] hotssh.hotlib.logutil.init(default_log_level, mods, '') _logger.debug("logging initialized") locale.setlocale(locale.LC_ALL, '') import gettext gettext.install(appklass.get_name()) gobject.threads_init() app = appklass() remote = app.get_remote() remote.single_instance() def on_about_dialog_url(dialog, link): import webbrowser webbrowser.open(link) gtk.about_dialog_set_url_hook(on_about_dialog_url) gtk.rc_parse_string(''' style "hotwire-tab-close" { xthickness = 0 ythickness = 0 } widget "*hotwire-tab-close" style "hotwire-tab-close" ''') if os.getenv('HOTWIRE_UNINSTALLED'): theme = gtk.icon_theme_get_default() imgpath = os.path.join(os.getenv('HOTWIRE_UNINSTALLED'), 'images') _logger.debug("appending to icon theme: %s", imgpath) theme.append_search_path(imgpath) factory = app.get_factory() factory.connect('shutdown', app.on_shutdown) args = sys.argv[1:] if len(args) == 0: app.offer_load_session() else: w = factory.create_initial_window() w.new_tab(args, os.getcwd()) w.show_all() w.present() uiproxy = remote.get_proxy(factory) _logger.debug('entering mainloop') gtk.gdk.threads_enter() gtk.main() gtk.gdk.threads_leave() hotssh-0.2.6+dfsg1/hotssh/__init__.py0000644000175000017500000000146511027562325016125 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA hotssh-0.2.6+dfsg1/hotssh/hotlib_ui/0000755000175000017500000000000011122614266015762 5ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotlib_ui/__init__.py0000644000175000017500000000000011027562325020063 0ustar javijavihotssh-0.2.6+dfsg1/hotssh/hotlib_ui/quickfind.py0000644000175000017500000002053711033160603020310 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os, sys, re, logging, string import gtk, gobject, pango from hotssh.hotlib.logutil import log_except def markup_for_match(text, start, end, matchtarget=None): source = matchtarget or text return '%s%s%s%s' % (gobject.markup_escape_text(source[0:start]), gobject.markup_escape_text(source[start:end]), gobject.markup_escape_text(source[end:]), matchtarget and (' - ' + text + '') or '') _logger = logging.getLogger("hotwire.ui.QuickFind") class QuickFindWindow(gtk.Dialog): def __init__(self, title, parent=None): super(QuickFindWindow, self).__init__(title=title, parent=parent, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_ACCEPT)) self.connect('response', lambda *args: self.hide()) self.connect('delete-event', self.hide_on_delete) self.set_has_separator(False) self.set_border_width(5) self.__vbox = gtk.VBox() self.vbox.add(self.__vbox) self.vbox.set_spacing(6) self.set_size_request(640, 480) self.__response_value = None self.__idle_search_id = 0 self.__entry = gtk.Entry() self.__entry.connect('notify::text', self.__on_text_changed) self.__entry.connect('key-press-event', self.__on_keypress) self.__vbox.pack_start(self.__entry, expand=False) self.__scroll = gtk.ScrolledWindow() self.__scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) self.__results = gtk.TreeView() self.__results.connect('row-activated', self.__on_row_activated) self.__scroll.add(self.__results) colidx = self.__results.insert_column_with_data_func(-1, '', gtk.CellRendererPixbuf(), self.__render_icon) renderer = gtk.CellRendererText() renderer.set_property('ellipsize', True) colidx = self.__results.insert_column_with_data_func(-1, '', renderer, self.__render_match) frame = gtk.Frame() frame.set_shadow_type(gtk.SHADOW_ETCHED_IN) frame.add(self.__scroll) self.__vbox.pack_start(frame, expand=True) self.__selection = self.__results.get_selection() self.__selection.set_mode(gtk.SELECTION_SINGLE) self.__selection.connect('changed', self.__on_selection_changed) self.__results.set_headers_visible(False) self.__do_search() def __on_keypress(self, entry, event): if event.keyval == gtk.gdk.keyval_from_name('Return'): self.__idle_do_search() return self.__activate_selection() elif event.keyval == gtk.gdk.keyval_from_name('Up'): self.__idle_do_search() self.__select_next() return True elif event.keyval == gtk.gdk.keyval_from_name('Down'): self.__idle_do_search() self.__select_prev() return True return False def __on_text_changed(self, *args): if self.__idle_search_id > 0: return self.__idle_search_id = gobject.timeout_add(300, self.__idle_do_search) def __idle_do_search(self): if self.__idle_search_id == 0: return False self.__idle_search_id = 0 self.__do_search() return False def _markup_search(self, text, searchq, text_lower=None, searchq_lower=None): if text_lower is not None: idx = text_lower.find(searchq_lower) else: idx = text.find(searchq) if idx >= 0: return markup_for_match(text, idx, idx+len(searchq)) else: return None def _get_string_data(self): """Generate a list of strings for search data.""" raise NotImplementedError() def _do_search(self, text): """Override this to implement a custom search with icons, etc.""" strings = self._get_string_data() text = text.lower() for s in strings: if s.lower().find(text) >= 0: yield (s, s, None) def __do_search(self): text = self.__entry.get_property('text') results = self._do_search(text) model = gtk.ListStore(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT) have_results = False for result in results: have_results = True _logger.debug("appending result: %s", result) model.append(result) self.__results.set_model(model) if have_results: self.__selection.select_iter(model.get_iter_first()) def __on_selection_changed(self, sel): (model, iter) = sel.get_selected() if iter: self.__results.scroll_to_cell(model.get_path(iter)) def __get_selected_path(self): (model, iter) = self.__selection.get_selected() return iter and model.get_path(iter) def __select_next(self): path = self.__get_selected_path() if not path: return previdx = path[-1]-1 if previdx < 0: return model = self.__results.get_model() previter = model.iter_nth_child(None, previdx) if not previter: return self.__selection.select_iter(previter) def __select_prev(self): path = self.__get_selected_path() if not path: return model = self.__results.get_model() seliter = model.get_iter(path) iternext = model.iter_next(seliter) if not iternext: return self.__selection.select_iter(iternext) def __activate_selection(self): (model, iter) = self.__selection.get_selected() if not iter: return False self._handle_activation(model.get_value(iter, 0)) return True @log_except(_logger) def __on_row_activated(self, tv, path, vc): _logger.debug("row activated: %s", path) model = self.__results.get_model() iter = model.get_iter(path) self._handle_activation(model.get_value(iter, 0)) def __render_match(self, col, cell, model, iter): markup = model.get_value(iter, 1) if markup: cell.set_property('markup', markup) else: cell.set_property('text', model.get_value(iter, 0)) def __render_icon(self, col, cell, model, iter): icon_name = model.get_value(iter, 2) if icon_name: pbcache = PixbufCache.getInstance() pixbuf = pbcache.get(icon_name, size=16, trystock=True, stocksize=gtk.ICON_SIZE_MENU) cell.set_property('pixbuf', pixbuf) else: cell.set_property('icon-name', None) def get_response_value(self): return self.__response_value def _handle_activation(self, val): self.__response_value = val self.response(gtk.RESPONSE_ACCEPT) def run_get_value(self): self.show_all() resp = self.run() if resp == gtk.RESPONSE_ACCEPT: return self.__response_value return None hotssh-0.2.6+dfsg1/hotssh/hotlib_ui/msgarea.py0000644000175000017500000002063411027562325017762 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007,2008 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os, sys, re, logging, string import gtk, gobject, pango from hotssh.hotlib.logutil import log_except _logger = logging.getLogger("hotwire.ui.MsgArea") # This file is a Python translation of gedit/gedit/gedit-message-area.c class MsgArea(gtk.HBox): __gsignals__ = { "response" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT,)), "close" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []) } def __init__(self, buttons, **kwargs): super(MsgArea, self).__init__(**kwargs) self.__contents = None self.__changing_style = False self.__main_hbox = gtk.HBox(False, 16) # FIXME: use style properties self.__main_hbox.show() self.__main_hbox.set_border_width(8) # FIXME: use style properties self.__action_area = gtk.HBox(True, 4); # FIXME: use style properties self.__action_area.show() self.__main_hbox.pack_end (self.__action_area, False, True, 0) self.pack_start(self.__main_hbox, True, True, 0) self.set_app_paintable(True) self.connect("expose-event", self.__paint) # Note that we connect to style-set on one of the internal # widgets, not on the message area itself, since gtk does # not deliver any further style-set signals for a widget on # which the style has been forced with gtk_widget_set_style() self.__main_hbox.connect("style-set", self.__on_style_set) self.add_buttons(buttons) def __get_response_data(self, w, create): d = w.get_data('hotwire-msg-area-data') if (d is None) and create: d = {'respid': None} w.set_data('hotwire-msg-area-data', d) return d def __find_button(self, respid): children = self.__actionarea.get_children() for child in children: rd = self.__get_response_data(child, False) if rd is not None and rd['respid'] == respid: return child def __close(self): cancel = self.__find_button(gtk.RESPONSE_CANCEL) if cancel is None: return self.response(gtk.RESPONSE_CANCEL) def __paint(self, w, event): gtk.Style.paint_flat_box(w.style, w.window, gtk.STATE_NORMAL, gtk.SHADOW_OUT, None, w, "tooltip", w.allocation.x + 1, w.allocation.y + 1, w.allocation.width - 2, w.allocation.height - 2) return False def __on_style_set(self, w, style): if self.__changing_style: return # This is a hack needed to use the tooltip background color window = gtk.Window(gtk.WINDOW_POPUP); window.set_name("gtk-tooltip") window.ensure_style() style = window.get_style() self.__changing_style = True self.set_style(style) self.__changing_style = False window.destroy() self.queue_draw() def __get_response_for_widget(self, w): rd = self.__get_response_data(w, False) if rd is None: return gtk.RESPONSE_NONE return rd['respid'] def __on_action_widget_activated(self, w): response_id = self.__get_response_for_widget(w) self.response(response_id) def add_action_widget(self, child, respid): rd = self.__get_response_data(child, True) rd['respid'] = respid if not isinstance(child, gtk.Button): raise ValueError("Can only pack buttons as action widgets") child.connect('clicked', self.__on_action_widget_activated) if respid != gtk.RESPONSE_HELP: self.__action_area.pack_start(child, False, False, 0) else: self.__action_area.pack_end(child, False, False, 0) def set_contents(self, contents): self.__contents = contents self.__main_hbox.pack_start(contents, True, True, 0) def add_button(self, btext, respid): button = gtk.Button(stock=btext) button.set_focus_on_click(False) button.set_flags(gtk.CAN_DEFAULT) button.show() self.add_action_widget(button, respid) return button def add_buttons(self, args): _logger.debug("init buttons: %r", args) for (btext, respid) in args: self.add_button(btext, respid) def set_response_sensitive(self, respid, setting): for child in self.__action_area.get_children(): rd = self.__get_response_data(child, False) if rd is not None and rd['respid'] == respid: child.set_sensitive(setting) break def set_default_response(self, respid): for child in self.__action_area.get_children(): rd = self.__get_response_data(child, False) if rd is not None and rd['respid'] == respid: child.grab_default() break def response(self, respid): self.emit('response', respid) def add_stock_button_with_text(self, text, stockid, respid): b = gtk.Button(label=text) b.set_focus_on_click(False) img = gtk.Image() img.set_from_stock(stockid, gtk.ICON_SIZE_BUTTON) b.set_image(img) b.show_all() self.add_action_widget(b, respid) return b def set_text_and_icon(self, stockid, primary_text, secondary_text=None): hbox_content = gtk.HBox(False, 8) hbox_content.show() image = gtk.Image() image.set_from_stock(stockid, gtk.ICON_SIZE_BUTTON) image.show() hbox_content.pack_start(image, False, False, 0) image.set_alignment(0.5, 0.5) vbox = gtk.VBox(False, 6) vbox.show() hbox_content.pack_start (vbox, True, True, 0) primary_markup = "%s" % (primary_text,) primary_label = gtk.Label(primary_markup) primary_label.show() vbox.pack_start(primary_label, True, True, 0) primary_label.set_use_markup(True) primary_label.set_line_wrap(True) primary_label.set_alignment(0, 0.5) primary_label.set_flags(gtk.CAN_FOCUS) primary_label.set_selectable(True) if secondary_text: secondary_markup = "%s" % (secondary_text,) secondary_label = gtk.Label(secondary_markup) secondary_label.show() vbox.pack_start(secondary_label, True, True, 0) secondary_label.set_flags(gtk.CAN_FOCUS) secondary_label.set_use_markup(True) secondary_label.set_line_wrap(True) secondary_label.set_selectable(True) secondary_label.set_alignment(0, 0.5) self.set_contents(hbox_content) class MsgAreaController(gtk.HBox): def __init__(self): super(MsgAreaController, self).__init__() self.__msgarea = None def clear(self): if self.__msgarea is not None: self.remove(self.__msgarea) self.__msgarea.destroy() self.__msgarea = None def new_from_text_and_icon(self, stockid, primary, secondary=None, buttons=[]): self.clear() msgarea = self.__msgarea = MsgArea(buttons) msgarea.set_text_and_icon(stockid, primary, secondary) self.pack_start(msgarea, expand=True) return msgarea hotssh-0.2.6+dfsg1/hotssh/version.py0000644000175000017500000000255511027562325016054 0ustar javijavi# This file is part of the Hotwire Shell project API. # Copyright (C) 2007 Colin Walters # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies # of the Software, and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR # THE USE OR OTHER DEALINGS IN THE SOFTWARE. __version__ = '0.201' def svn_version_str(): if not svn_version_info: return '' return '(%s %s)' % (svn_version_info['Revision'], svn_version_info['Last Changed Date']) # Default to empty svn_version_info = None hotssh-0.2.6+dfsg1/hotssh/sshwindow.py0000644000175000017500000020465611122612016016407 0ustar javijavi# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os,sys,platform,logging,getopt,re import locale,threading,subprocess,time import signal,tempfile,shutil,stat,pwd import datetime,gettext,sha,commands,errno import urllib from StringIO import StringIO import xml.dom.minidom try: import sqlite3 except: from pysqlite2 import dbapi2 as sqlite3 import gtk,gobject,pango import dbus,dbus.glib,dbus.service try: import avahi avahi_available = True except: avahi_available = False from hotssh.hotvte.vteterm import VteTerminalWidget from hotssh.hotvte.vtewindow import VteWindow from hotssh.hotvte.vtewindow import VteApp from hotssh.hotlib.logutil import log_except from hotssh.hotlib.timesince import timesince from hotssh.hotlib_ui.quickfind import QuickFindWindow from hotssh.hotlib_ui.msgarea import MsgAreaController _logger = logging.getLogger("hotssh.SshWindow") _whitespace_re = re.compile('\s+') def glibc_backtrace(): from ctypes import cdll libc = cdll.LoadLibrary("libc.so.6") btcount = 100 btdata = (c_void_p * btcount)() libc.backtrace(btdata, c_int(btcount)) symbols = libc.backtrace_symbols(btdata, c_int(btcount)) print symbols def userhost_pair_to_string(user, host, port=None): host = hostport_pair_to_string(host, port) if user: return user + '@' + host return host def hostport_pair_to_string(host, port=None): hostport = host if port is not None: hostport += (':%s' % (port,)) return hostport class HotSshAboutDialog(gtk.AboutDialog): def __init__(self): super(HotSshAboutDialog, self).__init__() dialog = self import hotssh.version dialog.set_property('website', 'http://www.gnome.org/projects/hotssh') dialog.set_property('version', hotssh.version.__version__) dialog.set_property('authors', ['Colin Walters ']) dialog.set_property('copyright', u'Copyright \u00A9 2007,2008 Colin Walters ') dialog.set_property('logo-icon-name', 'hotwire-openssh') dialog.set_property('license', '''Hotwire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n Hotwire 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 General Public License for more details.\n You should have received a copy of the GNU General Public License along with Hotwire; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA''') dialog.set_property('name', "About Secure Shell") comments = _("An interface to OpenSSH, a Secure Shell client\n\n") if hotssh.version.svn_version_info: comments += "changeset: %s\ndate: %s\n" % (hotssh.version.svn_version_info['Revision'], hotssh.version.svn_version_info['Last Changed Date'],) dialog.set_property('comments', comments) class SshConnectionHistory(object): def __init__(self): # We want to upgrade from the old Hotwire-derived location into the new ~/.hotssh self.__oldstatedir = os.path.expanduser('~/.hotwire/state') self.__statedir = os.path.expanduser('~/.hotssh') try: os.makedirs(self.__statedir) except: pass self.__path = path = os.path.join(self.__statedir, 'history.sqlite') oldpath = os.path.join(self.__oldstatedir, 'ssh.sqlite') if os.path.exists(oldpath) and not os.path.exists(self.__path): shutil.copy2(oldpath, path) self.__conn = sqlite3.connect(path, isolation_level=None) cursor = self.__conn.cursor() cursor.execute('''CREATE TABLE IF NOT EXISTS Connections (bid INTEGER PRIMARY KEY AUTOINCREMENT, host TEXT, user TEXT, options TEXT, conntime DATETIME)''') cursor.execute('''CREATE INDEX IF NOT EXISTS ConnectionsIndex1 on Connections (host)''') cursor.execute('''CREATE INDEX IF NOT EXISTS ConnectionsIndex2 on Connections (host,user)''') cursor.execute('''CREATE TABLE IF NOT EXISTS Colors (bid INTEGER PRIMARY KEY AUTOINCREMENT, pattern TEXT UNIQUE, fg TEXT, bg TEXT, modtime DATETIME)''') cursor.execute('''CREATE INDEX IF NOT EXISTS ColorsIndex on Colors (pattern)''') def get_recent_connections_search(self, host, limit=10): cursor = self.__conn.cursor() params = () q = '''SELECT user,host,options,conntime FROM Connections ''' if host: q += '''WHERE host LIKE ? ESCAPE '%' ''' params = ('%' + host.replace('%', '%%') + '%',) # We use a large limit here to avoid the query being totally unbounded q += '''ORDER BY conntime DESC LIMIT 1000''' def sqlite_timestamp_to_datetime(s): return datetime.datetime.fromtimestamp(time.mktime(time.strptime(s[:-7], '%Y-%m-%d %H:%M:%S'))) # Uniquify, which we coudln't do in the SQL because we're also grabbing the conntime seen = set() for user,host,options,conntime in cursor.execute(q, params): if len(seen) >= limit: break if user and host: uhost = user+'@'+host else: uhost = host if uhost in seen: continue seen.add(uhost) # We do this just to parse conntime yield user,host,options,sqlite_timestamp_to_datetime(conntime) def get_users_for_host_search(self, host): for user,host,options,ts in self.get_recent_connections_search(host): yield user def add_connection(self, user, host, options): if host is None or host == '': return cursor = self.__conn.cursor() cursor.execute('''BEGIN TRANSACTION''') cursor.execute('''INSERT INTO Connections VALUES (NULL, ?, ?, ?, ?)''', (host, user, ' '.join(options), datetime.datetime.now())) cursor.execute('''COMMIT''') def get_color_for_host(self, host): cursor = self.__conn.cursor() res = cursor.execute('SELECT fg,bg FROM Colors WHERE pattern = ? ORDER BY conntime DESC LIMIT 10') if len(res) > 0: return res[0] return None def set_color_for_host(self, host, fg, bg): cursor.execute('''BEGIN TRANSACTION''') cursor.execute('''INSERT INTO Colors VALUES (NULL, ?, ?, ?, ?)''', (host, fg, bg, datetime.datetime.now())) cursor.execute('''COMMIT''') _history_instance = None def get_history(): global _history_instance if _history_instance is None: _history_instance = SshConnectionHistory() return _history_instance class OpenSSHKnownHostsDB(gobject.GObject): __gsignals__ = { "changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), } def __init__(self): super(OpenSSHKnownHostsDB, self).__init__() self.__path = os.path.expanduser('~/.ssh/known_hosts') self.__hostcache_ts_size = (None, None) self.__hostcache = None self.__faviconcache = os.path.expanduser('~/.hotssh/favicons') self.__pixbufcache = {} def __get_favicon_cache(self): try: os.makedirs(self.__faviconcache) except OSError, e: if e.errno == errno.EEXIST: pass else: raise return self.__faviconcache def __read_hosts(self): try: _logger.debug("reading %s", self.__path) f = open(self.__path) except: _logger.debug("failed to open known hosts") return hosts = {} for line in f: if not line or line.startswith('|'): continue hostip,rest = line.split(' ', 1) if hostip.find(',') > 0: host = hostip.split(',', 1)[0] else: host = hostip hostkey_type,hostkey = rest.split(' ', 1) hostkey_type = hostkey_type.strip() hostkey = hostkey.strip() host = host.strip() hosts[host] = (hostkey_type, hostkey) f.close() return hosts def get_hosts(self): try: stbuf = os.stat(self.__path) ts_size = (stbuf[stat.ST_MTIME], stbuf[stat.ST_SIZE]) except OSError, e: ts_size = None if ts_size is not None and self.__hostcache_ts_size != ts_size: self.__hostcache = self.__read_hosts() self.__hostcache_ts_size = ts_size else: return [] return self.__hostcache.iterkeys() def __force_host_read(self): self.get_hosts() def get_favicon_for_host(self, host, port=None): cache = self.__get_favicon_cache() if cache is None: return None path = self.__get_favicon_path(host, port) try: stbuf = os.stat(path) except: return None return (path, stbuf[stat.ST_MTIME]) def render_cached_favicon(self, path): bn = os.path.basename(path) if bn not in self.__pixbufcache: self.__pixbufcache[bn] = gtk.gdk.pixbuf_new_from_file_at_size(path, 16, 16) return self.__pixbufcache[bn] def __get_favicon_path(self, hostname, port): key = urllib.quote_plus(hostname) return os.path.join(self.__get_favicon_cache(), key + '.png') def save_favicon(self, host, port, favicon_tmppath): cache = self.__get_favicon_cache() if cache is None: return None path = self.__get_favicon_path(host, port) shutil.move(favicon_tmppath, path) self.emit('changed') return path _openssh_hosts_db = OpenSSHKnownHostsDB() class SshAvahiMonitor(gobject.GObject): __gsignals__ = { "changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), } def __init__(self): super(SshAvahiMonitor, self).__init__() # maps name->(addr,port) self.__cache = {} if not avahi_available: return try: sysbus = dbus.SystemBus() avahi_service = sysbus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER) self.__avahi = dbus.Interface(avahi_service, avahi.DBUS_INTERFACE_SERVER) except dbus.exceptions.DBusException: return browser_ref = self.__avahi.ServiceBrowserNew(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, '_ssh._tcp', 'local', dbus.UInt32(0)) browser = sysbus.get_object(avahi.DBUS_NAME, browser_ref) self.__browser = dbus.Interface(browser, avahi.DBUS_INTERFACE_SERVICE_BROWSER) self.__browser.connect_to_signal('ItemNew', self.__on_item_new) self.__browser.connect_to_signal('ItemRemove', self.__on_item_remove) def __iter__(self): for k,(addr,port) in self.__cache.iteritems(): yield (k, addr, port) def __on_resolve_reply(self, *args): addr, port = args[-4:-2] name = args[2].decode('utf-8', 'replace') _logger.debug("add Avahi SSH: %r %r %r", name, addr, port) self.__cache[name] = (addr, port) self.emit('changed') def __on_avahi_error(self, *args): _logger.debug("Avahi error: %s", args) def __on_item_new(self, interface, protocol, name, type, domain, flags): self.__avahi.ResolveService(interface, protocol, name, type, domain, avahi.PROTO_UNSPEC, dbus.UInt32(0), reply_handler=self.__on_resolve_reply, error_handler=self.__on_avahi_error) def __on_item_remove(self, interface, protocol, name, type, domain,server): uname = name.decode('utf-8', 'replace') if uname in self.__cache: _logger.debug("del Avahi SSH: %r", uname) del self.__cache[uname] self.emit('changed') _local_avahi_instance = None def get_local_avahi(): global _local_avahi_instance if _local_avahi_instance is None: _local_avahi_instance = SshAvahiMonitor() return _local_avahi_instance class SshOptions(gtk.Expander): def __init__(self): super(SshOptions, self).__init__(_('Options')) self.set_label('%s' % (gobject.markup_escape_text(self.get_label()))) self.set_use_markup(True) options_vbox = gtk.VBox() options_hbox = gtk.HBox() options_vbox.add(options_hbox) self.__entry = gtk.Entry() options_hbox.pack_start(self.__entry, expand=True) options_help = gtk.Button(stock=gtk.STOCK_HELP) options_help.connect('clicked', self.__on_options_help_clicked) options_hbox.pack_start(options_help, expand=False) options_helplabel = gtk.Label(_('Example: ')) options_helplabel.set_markup('%s -C -Y -oTCPKeepAlive=false' % (gobject.markup_escape_text(options_helplabel.get_label()),)) options_helplabel.set_alignment(0.0, 0.5) options_vbox.add(options_helplabel) self.add(options_vbox) def get_entry(self): return self.__entry def __on_options_help_clicked(self, b): # Hooray Unix! subprocess.Popen(['gnome-terminal', '-x', 'man', 'ssh']) class ConnectDialog(gtk.Dialog): def __init__(self, parent=None, history=None, local_avahi=None): super(ConnectDialog, self).__init__(title=_("New Secure Shell Connection"), parent=parent, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) self.__history = history self.__local_avahi = local_avahi self.__local_avahi.connect('changed', self.__on_local_avahi_changed) self.__default_username = pwd.getpwuid(os.getuid()).pw_name self.connect('response', lambda *args: self.hide()) self.connect('delete-event', self.hide_on_delete) button = self.add_button(_('C_onnect'), gtk.RESPONSE_ACCEPT) button.set_property('image', gtk.image_new_from_stock('gtk-connect', gtk.ICON_SIZE_BUTTON)) self.set_default_response(gtk.RESPONSE_ACCEPT) self.set_has_separator(False) self.set_border_width(5) self.__vbox = vbox = gtk.VBox() self.vbox.add(self.__vbox) self.vbox.set_spacing(6) self.__response_value = None self.__viewmode = 'history' self.__suppress_recent_search = False self.__idle_search_id = 0 self.__idle_update_search_id = 0 self.__custom_user = False self.__hosts = _openssh_hosts_db sg = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) hbox = gtk.HBox() vbox.pack_start(hbox, expand=False) host_label = gtk.Label(_('Host: ')) host_label.set_markup('%s' % (gobject.markup_escape_text(host_label.get_text()))) sg.add_widget(host_label) hbox.pack_start(host_label, expand=False) self.__entry = gtk.combo_box_entry_new_text() self.__entry.child.connect('activate', self.__on_entry_activated) self.__entry.child.connect('notify::text', self.__on_entry_modified) self.__entrycompletion = gtk.EntryCompletion() self.__entrycompletion.set_property('inline-completion', True) self.__entrycompletion.set_property('popup-completion', False) self.__entrycompletion.set_property('popup-single-match', False) self.__entrycompletion.set_model(self.__entry.get_property('model')) self.__entrycompletion.set_text_column(0) self.__entry.child.set_completion(self.__entrycompletion) hbox.add(self.__entry) self.__reload_entry() hbox = gtk.HBox() vbox.pack_start(hbox, expand=False) user_label = gtk.Label(_('User: ')) user_label.set_markup('%s' % (gobject.markup_escape_text(user_label.get_text()))) sg.add_widget(user_label) hbox.pack_start(user_label, expand=False) self.__user_entry = gtk.Entry() self.__set_user(None) self.__user_entry.connect('notify::text', self.__on_user_modified) self.__user_entry.set_activates_default(True) self.__user_completion = gtk.EntryCompletion() self.__user_completion.set_property('inline-completion', True) self.__user_completion.set_property('popup-single-match', False) self.__user_completion.set_model(gtk.ListStore(gobject.TYPE_STRING)) self.__user_completion.set_text_column(0) self.__user_entry.set_completion(self.__user_completion) hbox.pack_start(self.__user_entry, expand=False) vbox.pack_start(gtk.Label(' '), expand=False) self.__conntype_notebook = gtk.Notebook() self.__conntype_notebook.set_scrollable(True) self.__conntype_notebook.connect('switch-page', self.__on_switch_page) vbox.pack_start(self.__conntype_notebook, expand=True) history_label = gtk.Label(_('History')) tab = gtk.ScrolledWindow() tab.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) #frame.set_label_widget(history_label) self.__recent_model = gtk.ListStore(object, str, object) self.__recent_view = gtk.TreeView(self.__recent_model) self.__recent_view.get_selection().connect('changed', self.__on_recent_selected) self.__recent_view.connect('row-activated', self.__on_recent_activated) tab.add(self.__recent_view) colidx = self.__recent_view.insert_column_with_data_func(-1, '', gtk.CellRendererPixbuf(), self.__render_favicon) colidx = self.__recent_view.insert_column_with_data_func(-1, _('Connection'), gtk.CellRendererText(), self.__render_userhost) colidx = self.__recent_view.insert_column_with_data_func(-1, _('Time'), gtk.CellRendererText(), self.__render_time_recency, datetime.datetime.now()) self.__conntype_notebook.append_page(tab, history_label) local_label = gtk.Label(_('Local')) tab = gtk.ScrolledWindow() tab.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) self.__local_model = gtk.ListStore(str, str, str) self.__local_view = gtk.TreeView(self.__local_model) self.__local_view.get_selection().connect('changed', self.__on_local_selected) self.__local_view.connect('row-activated', self.__on_local_activated) tab.add(self.__local_view) colidx = self.__local_view.insert_column_with_attributes(-1, _('Name'), gtk.CellRendererText(), text=0) colidx = self.__local_view.insert_column_with_attributes(-1, _('Address'), gtk.CellRendererText(), text=1) self.__conntype_notebook.append_page(tab, local_label) self.__on_entry_modified() self.__force_idle_search() self.__options_expander = SshOptions() self.__options_entry = self.__options_expander.get_entry() vbox.pack_start(self.__options_expander, expand=False) self.set_default_size(640, 480) @log_except(_logger) def __on_switch_page(self, nb, p, pn): _logger.debug("got page switch, pn=%d", pn) self.__suppress_recent_search = True widget = self.__conntype_notebook.get_nth_page(pn) self.__viewmode = (pn == 0 and 'history' or 'local') # If we're switching, particularly from history->local it's # unlikely we want to keep the active search; the assumption here # is that the history search failed. self.__entry.child.set_text('') self.__force_idle_search() self.__suppress_recent_search = False def __on_browse_local(self, b): pass def __on_local_avahi_changed(self, *args): if self.__viewmode == 'local': self.__force_idle_search() def __render_userhost(self, col, cell, model, iter): user = model.get_value(iter, 0) host = model.get_value(iter, 1) if user and host: userhost = user + '@' + host else: userhost = host cell.set_property('text', userhost) def __set_user(self, name): if name is None: name = self.__default_username self.__user_entry.set_text(name) def __render_favicon(self, col, cell, model, it): user = model.get_value(it, 0) host = model.get_value(it, 1) favicondata = _openssh_hosts_db.get_favicon_for_host(host, None) if favicondata is not None: (favicon_path,mtime) = favicondata pixbuf = _openssh_hosts_db.render_cached_favicon(favicon_path) cell.set_property('pixbuf',pixbuf) else: cell.set_property('pixbuf', None) def __render_time_recency(self, col, cell, model, it, curtime): val = model.get_value(it, 2) deltastr = timesince(val, curtime) cell.set_property('text', deltastr) def __reload_entry(self, *args, **kwargs): _logger.debug("reloading") # TODO do predictive completion here # For example, I have in my history: # foo.cis.ohio-state.edu # bar.cis.ohio-state.edu # Now I type baz.cis # The system notices that nothing matches baz.cis; however # the "cis" part does match foo.cis.ohio-state.edu, so # we start offering a completion for it self.__entry.get_property('model').clear() for host in self.__hosts.get_hosts(): self.__entry.append_text(host) def __on_user_modified(self, *args): text = self.__user_entry.get_text() self.__custom_user = text != self.__default_username def __on_entry_modified(self, *args): text = self.__entry.get_active_text() havetext = text != '' self.set_response_sensitive(gtk.RESPONSE_ACCEPT, havetext) if self.__suppress_recent_search: return if havetext and self.__idle_update_search_id == 0: self.__idle_update_search_id = gobject.timeout_add(250, self.__idle_update_search) def __force_idle_search(self): if self.__idle_update_search_id > 0: gobject.source_remove(self.__idle_update_search_id) self.__idle_update_search() def __idle_update_search(self): self.__idle_update_search_id = 0 self.__suppress_recent_search = True if self.__viewmode == 'history': self.__idle_update_search_history() else: self.__idle_update_search_local() self.__suppress_recent_search = False def __idle_update_search_local(self): self.__local_view.get_selection().unselect_all() hosttext = self.__entry.get_active_text() self.__local_model.clear() for name,host,port in self.__local_avahi: if host.find(hosttext) >= 0: self.__local_model.append((name,host,port)) def __idle_update_search_history(self): self.__recent_view.get_selection().unselect_all() host = self.__entry.get_active_text() if host: usernames = list(self.__history.get_users_for_host_search(host)) else: usernames = [] _logger.debug("doing history update, usernames:%r", usernames) if len(usernames) > 0: last_user = usernames[0] if last_user is None: last_user = self.__default_username self.__user_entry.set_text(last_user) model = gtk.ListStore(gobject.TYPE_STRING) for uname in usernames: if uname: model.append((uname,)) self.__user_completion.set_model(model) else: self.__user_entry.set_text(self.__default_username) self.__reload_connection_history() def __reload_connection_history(self): hosttext = self.__entry.get_active_text() self.__recent_model.clear() for user,host,options,ts in self.__history.get_recent_connections_search(hosttext): self.__recent_model.append((user, host, ts)) def __on_entry_activated(self, *args): self.__force_idle_search() hosttext = self.__entry.get_active_text() if hosttext.find('@') >= 0: (user, host) = hosttext.split('@', 1) self.__user_entry.set_text(user) self.__entry.child.set_text(host) self.__user_entry.activate() else: self.__user_entry.select_region(0, -1) self.__user_entry.grab_focus() def __on_local_selected(self, ts): if self.__suppress_recent_search: return _logger.debug("local selected: %s", ts) (tm, seliter) = ts.get_selected() if seliter is None: return host = self.__local_model.get_value(seliter, 1) port = self.__local_model.get_value(seliter, 2) self.__suppress_recent_search = True self.__entry.child.set_text(host) self.__suppress_recent_search = False def __on_local_activated(self, tv, path, vc): self.activate_default() def __on_recent_selected(self, ts): if self.__suppress_recent_search: return _logger.debug("recent selected: %s", ts) (tm, seliter) = ts.get_selected() if seliter is None: return user = self.__recent_model.get_value(seliter, 0) host = self.__recent_model.get_value(seliter, 1) self.__suppress_recent_search = True self.__entry.child.set_text(host) if user: self.__user_entry.set_text(user) else: self.__set_user(None) self.__suppress_recent_search = False def __on_recent_activated(self, tv, path, vc): self.activate_default() def __reset(self): self.__entry.child.set_text('') self.__user_entry.set_text(self.__default_username) def run_get_cmd(self): self.__reset() self.show_all() resp = self.run() if resp != gtk.RESPONSE_ACCEPT: return None host = self.__entry.get_active_text() if not host: return None args = [x for x in _whitespace_re.split(self.__options_entry.get_text()) if x != ''] if self.__custom_user: args.append(self.__user_entry.get_text() + '@' + host) else: args.append(host) return args _CONTROLPATH = None def get_controlpath(create=True): global _CONTROLPATH if _CONTROLPATH is None and create: _CONTROLPATH = tempfile.mkdtemp('', 'hotssh') return _CONTROLPATH def get_base_sshcmd(): return ['ssh'] def get_connection_sharing_args(): # TODO - openssh should really do this out of the box return ['-oControlMaster=auto', '-oControlPath=' + os.path.join(get_controlpath(), 'master-%r@%h:%p')] class AsyncCommandWithOutput(gobject.GObject): __gsignals__ = { "timeout" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [gobject.TYPE_STRING]), "complete" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (bool, int, gobject.TYPE_STRING)) } user = property(lambda self: self.__user) host = property(lambda self: self.__host) port = property(lambda self: self.__port) output = property(lambda self: self.__output.get_value()) def __init__(self, user, host, port, cmdstart, cmdend, timeout=7000, hostappend='', getoutput=True): super(AsyncCommandWithOutput, self).__init__() self.__user = user self.__host = host self.__port = port cmd = list(cmdstart) cmd.extend(get_connection_sharing_args()) if port: cmd.extend(['-p', str(port)]) if user: cmd.append('-oUser=' + user) # hostappend is a dirty hack to handle scp's syntax cmd.extend(['-oBatchMode=true', host+hostappend]) cmd.extend(cmdend) self.__cmd = cmd self.__starttime = time.time() nullf = open(os.path.devnull, 'w') _logger.debug("starting subprocess cmd=%r", cmd) if getoutput: stdout_target = subprocess.PIPE else: stdout_target = nullf self.__subproc = subprocess.Popen(cmd, stdout=stdout_target, stderr=nullf) nullf.close() if getoutput: self.__io_watch_id = gobject.io_add_watch(self.__subproc.stdout, gobject.IO_IN|gobject.IO_ERR|gobject.IO_HUP, self.__on_io) self.__output = StringIO() self.__child_watch_id = gobject.child_watch_add(self.__subproc.pid, self.__on_exited) self.__timeout_id = gobject.timeout_add(timeout, self.__on_timeout) def __on_io(self, source, condition): have_read = condition & gobject.IO_IN if have_read: _logger.debug("got status output") self.__output.write(os.read(source.fileno(), 8192)) if ((condition & gobject.IO_HUP) or (condition & gobject.IO_ERR)): source.close() _logger.debug("got condition %s, cancelling status io check", condition) return False else: return have_read def __on_timeout(self): _logger.debug("timeout for host=%r cmd=%r", self.__host, self.__cmd) try: os.kill(self.__subproc.pid, signal.SIGHUP) except OSError, e: _logger.debug("failed to signal pid %s", pid, exc_info=True) pass self.emit('timeout', self.__output.getvalue()) self.__timeout_id = 0 return False def __on_exited(self, pid, condition): _logger.debug("command exited host=%r condition=%r cmd=%r", self.__host, condition, self.__cmd) if self.__timeout_id == 0: _logger.debug("command exited (but timeout already run") return gobject.source_remove(self.__timeout_id) self.__timeout_id = 0 self.emit('complete', condition == 0, time.time() - self.__starttime, self.__output.getvalue()) return False class FaviconRetriever(gobject.GObject): __gsignals__ = { "favicon-loaded" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [str]), } user = property(lambda self: self.__user) host = property(lambda self: self.__host) port = property(lambda self: self.__port) def __init__(self, user, host, port=None): super(FaviconRetriever, self).__init__() self.__user = user self.__host = host self.__port = port self.__cached_mtime = None self.__favicon_mtime = None self.__tmp_favicon_path = None hostport = userhost_pair_to_string(user, host, port) _logger.debug("loading favicon for %s", hostport) cmd = commands.mkarg('''python -c 'import os,sys,stat; print os.stat(sys.argv[1])[stat.ST_MTIME]' /etc/favicon.png''') req = AsyncCommandWithOutput(user, host, port, ['ssh'], ['sh', '-c', cmd]) req.connect('timeout', self.__on_mtime_timeout) req.connect('complete', self.__on_mtime_complete) self.__active_req = req def __on_mtime_timeout(self, req, curoutput): _logger.debug("favicon mtime retrieval timeout") return False def __on_mtime_complete(self, req, status, elapsed_time, output): _logger.debug("favicon mtime retrieval complete, status: %r", status) if not status: return False mtime = int(output.strip()) self.__favicon_mtime = mtime gobject.idle_add(self.__idle_start_scp) @log_except(_logger) def __idle_start_scp(self): current = _openssh_hosts_db.get_favicon_for_host(self.__host, self.__port) cached_mtime = 0 if current is not None: (_, mtime) = current cached_mtime = mtime if self.__favicon_mtime > cached_mtime: (fd, tmppath) = tempfile.mkstemp('.png', 'favicon') self.__tmp_favicon_path = tmppath os.close(fd) _logger.debug("creating scp request") req = AsyncCommandWithOutput(self.__user, self.__host, self.__port, ['scp', '-p', '-q'], [tmppath], hostappend=':/etc/favicon.png', timeout=15000, getoutput=False) req.connect('timeout', self.__on_favicon_timeout) req.connect('complete', self.__on_favicon_complete) self.__active_req = req else: _logger.debug("favicon is up to date") return False def __on_favicon_timeout(self, req, elapsed): _logger.debug("favicon data retrieval timeout (%r elapsed)", elapsed) return False def __on_favicon_complete(self, req, status, elapsed_time, output): _logger.debug("favicon data retrieval complete; elapsed=%r status=%r", elapsed_time, status) if not status: return False self.emit('favicon-loaded', self.__tmp_favicon_path) return False class HostConnectionMonitor(gobject.GObject): __gsignals__ = { "host-status" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT)), } def __init__(self): super(HostConnectionMonitor, self).__init__() self._CHECK_MS = 15000 # map userhost -> failure count self._host_failures = {} # map userhost -> ids self.__host_monitor_ids = {} # map userhost -> various idle ids, etc self.__check_statuses = {} # Map userhost -> w output self.__check_status_output = {} def start_monitor(self, user, host): userhost = userhost_pair_to_string(user, host) if not (userhost in self.__host_monitor_ids or userhost in self.__check_statuses): _logger.debug("adding monitor for %s", userhost) self._host_failures[userhost] = 0 self.__host_monitor_ids[userhost] = gobject.timeout_add(self._CHECK_MS, self.__check_host, userhost) def stop_monitor(self, user, host): userhost = userhost_pair_to_string(user, host) _logger.debug("stopping monitor for %s", userhost) if userhost in self.__host_monitor_ids: monid = self.__host_monitor_ids[userhost] gobject.source_remove(monid) del self.__host_monitor_ids[userhost] if userhost in self.__check_statuses: del self.__check_statusesuser[userhost] def get_monitors(self): return self.__host_monitor_ids def __on_check_io(self, source, condition, userhost): have_read = condition & gobject.IO_IN if have_read: _logger.debug("got status output") self.__check_status_output[userhost] += os.read(source.fileno(), 8192) if ((condition & gobject.IO_HUP) or (condition & gobject.IO_ERR)): source.close() _logger.debug("got condition %s, cancelling status io check", condition) return False else: return have_read def __check_host(self, userhost): _logger.debug("performing check for %s", userhost) del self.__host_monitor_ids[userhost] cmd = list(get_base_sshcmd()) cmd.extend(get_connection_sharing_args()) starttime = time.time() # This is a hack. Blame Adam Jackson. cmd.extend(['-oBatchMode=true', userhost, 'uptime']) nullf = open(os.path.devnull, 'w') subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=nullf) nullf.close() io_watch_id = gobject.io_add_watch(subproc.stdout, gobject.IO_IN|gobject.IO_ERR|gobject.IO_HUP, self.__on_check_io, userhost) self.__check_status_output[userhost] = "" child_watch_id = gobject.child_watch_add(subproc.pid, self.__on_check_exited, userhost) timeout_id = gobject.timeout_add(7000, self.__check_timeout, userhost) self.__check_statuses[userhost] = [starttime, subproc.pid, timeout_id, child_watch_id, io_watch_id] return False def __check_timeout(self, userhost): _logger.debug("timeout for host=%r", userhost) try: (starttime, pid, timeout_id, child_watch_id, io_watch_id) = self.__check_statuses[userhost] except KeyError, e: return False self.__check_statuses[2] = 0 try: os.kill(pid, signal.SIGTERM) except OSError, e: _logger.debug("failed to signal pid %s", pid, exc_info=True) pass return False def __on_check_exited(self, pid, condition, userhost): _logger.debug("check exited, pid=%s condition=%s host=%s", pid, condition, userhost) try: (starttime, pid, timeout_id, child_watch_id, io_watch_id) = self.__check_statuses[userhost] except KeyError, e: _logger.debug("confused; no status for userhost=%s", userhost) return False if timeout_id > 0: gobject.source_remove(timeout_id) del self.__check_statuses[userhost] abort = False if condition == 0: self._host_failures[userhost] = 0 else: self._host_failures[userhost] += 1 if self._host_failures[userhost] > 3: _logger.debug("too many failures for host=%s", userhost) abort = True if not abort: self.__host_monitor_ids[userhost] = gobject.timeout_add(self._CHECK_MS, self.__check_host, userhost) self.emit('host-status', userhost, condition == 0, time.time()-starttime, self.__check_status_output[userhost]) del self.__check_status_output[userhost] return False _hostmonitor = HostConnectionMonitor() class SshTerminalWidgetImpl(VteTerminalWidget): def __init__(self, *args, **kwargs): self.__actions = kwargs['actions'] super(SshTerminalWidgetImpl, self).__init__(*args, **kwargs) def _get_extra_context_menuitems(self): return [self.__actions.get_action(x).create_menu_item() for x in ['CopyConnection', 'OpenSFTP']] class SshTerminalWidget(gtk.VBox): __gsignals__ = { "status-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), "close" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), # Emitted when we do a reconnect so that other tabs for this host can pick it up "reconnect" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), "metadata-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } latency = property(lambda self: self.__latency) status_line = property(lambda self: self.__status_output_first) connecting_state = property(lambda self: self.__connecting_state) connected = property(lambda self: self.__connected) ssh_options = property(lambda self: self.__sshopts) ssh_opt_with_args = "bcDeFiLlmOopRSw" ssh_opt_witouth_args = "1246AaCfgKkMNnqsTtVvXxY" def __init__(self, args, cwd, actions=None, inituser=None, inithost=None): super(SshTerminalWidget, self).__init__() self.__args = args self.__sshcmd = list(get_base_sshcmd()) self.__cwd = cwd self.__user = inituser self.__host = inithost self.__port = None self.__sshopts = [] self.__actions = actions self.__idle_start_favicon_id = 0 self.__favicon_path = None self.__favicon_pixbuf = None self.__favicon_retriever = None self.__favicon_retriever_connections = [] self.__init_state() enable_connection_sharing = True need_arg = False this_is_port = False port_in_args = False for arg in args: if not need_arg and not arg.startswith('-'): need_arg = False if self.__host is None: host_port = arg.split(":") if len(host_port) == 2: self.__host = host_port[0] self.__port = host_port[1] else: self.__host = arg try: (self.__user,self.__host) = self.__host.split('@', 1) except ValueError, e: pass elif this_is_port: self.__port = arg this_is_port = False need_arg = False port_in_args = True self.__sshcmd.append(arg) else: if arg == '-oControlPath=none': enable_connection_sharing = False elif self.ssh_opt_with_args.find(arg[1:]) != -1: need_arg = True if arg == "-p": this_is_port = True else: need_arg = False self.__sshcmd.append(arg) if self.__user: self.__sshcmd.append('-oUser=' + self.__user) self.__sshcmd.append(self.__host) if not port_in_args and self.__port: self.__sshcmd.append("-p") self.__sshcmd.append(self.__port) if enable_connection_sharing: self.__sshcmd.extend(get_connection_sharing_args()) header = gtk.VBox() self.__msg = gtk.Label() self.__msg.set_alignment(0.0, 0.5) self.__msgarea_mgr = MsgAreaController() #header.pack_start(self.__msg) header.pack_start(self.__msgarea_mgr) self.pack_start(header, expand=False) self.ssh_connect() def __init_state(self): if self.__idle_start_favicon_id > 0: gobject.source_remove(self.__idle_start_favicon_id) self.__idle_start_favicon_id = 0 if self.__favicon_retriever is not None: for sigid in self.__favicon_retriever_connections: self.__favicon_retriever.disconnect(sigid) self.__favicon_retriever_connections = [] self.__favicon_retriever = None self.__global_connection_changed = False self.__connecting_state = False self.__connected = None self.__cmd_exited = False self.__latency = None self.__status_output_first = None def set_global_connection_changed(self, changed): self.__global_connection_changed = changed if changed: self.__msgarea_mgr.clear() elif self.__cmd_exited: self.__show_disconnected() def set_status(self, connected, latency, status_output=None): if not connected and self.__connecting_state: return self.__connecting_state = False connected_changed = self.__connected != connected latency_changed = (not self.__latency) or (self.__latency*0.9 > latency) or (self.__latency*1.1 < latency) if not (connected_changed or latency_changed): return self.__connected = connected self.__latency = latency buf = StringIO(status_output) firstline = buf.readline().strip() self.__status_output_first = firstline self.emit('status-changed') self.__sync_msg() def __sync_msg(self): return def __on_favicon_loaded(self, retriever, faviconpath): _logger.debug("favicon loaded; path=%r", faviconpath) self.__favicon_path = _openssh_hosts_db.save_favicon(self.__host, self.__port, faviconpath) self.__favicon_pixbuf = _openssh_hosts_db.render_cached_favicon(self.__favicon_path) self.emit('metadata-changed') def ssh_connect(self): self.__connecting_state = True self.__term = term = SshTerminalWidgetImpl(cwd=self.__cwd, cmd=self.__sshcmd, actions=self.__actions) term.connect('child-exited', self.__on_child_exited) term.show_all() self.pack_start(term, expand=True) # For some reason, VTE doesn't have the CAN_FOCUS flag set, so we can't call # grab_focus. Do it manually then: term.emit('focus', True) self.__msgarea_mgr.clear() self.__sync_msg() current = _openssh_hosts_db.get_favicon_for_host(self.__host, self.__port) if current is not None: (pixbufpath, mtime) = current self.__favicon_path = pixbufpath self.__favicon_pixbuf = _openssh_hosts_db.render_cached_favicon(pixbufpath) self.__idle_start_favicon_id = gobject.timeout_add(3000, self.__idle_start_favicon) def __idle_start_favicon(self): if self.__favicon_retriever is not None: return self.__favicon_retriever = FaviconRetriever(self.__user, self.__host, self.__port) sigid = self.__favicon_retriever.connect('favicon-loaded', self.__on_favicon_loaded) self.__favicon_retriever_connections.append(sigid) def ssh_reconnect(self): # TODO - do this in a better way if not self.__term.exited and self.__term.pid: os.kill(self.__term.pid, signal.SIGTERM) self.remove(self.__term) self.__term.destroy() self.__init_state() self.ssh_connect() self.emit('reconnect') def __on_child_exited(self, term): _logger.debug("disconnected") self.__cmd_exited = True self.__show_disconnected() def __show_disconnected(self): self.__msg.hide() if self.__global_connection_changed: return msgarea = self.__msgarea_mgr.new_from_text_and_icon(gtk.STOCK_INFO, _('Connection closed'), buttons=[(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)]) reconnect = self.__actions.get_action('Reconnect') msgarea.add_stock_button_with_text(reconnect.get_property('label'), reconnect.get_property('stock-id'), gtk.RESPONSE_ACCEPT) msgarea.connect('response', self.__on_msgarea_response) msgarea.show_all() def __on_msgarea_response(self, msgarea, respid): if respid == gtk.RESPONSE_ACCEPT: self.ssh_reconnect() else: self.emit('close') def has_close(self): return True def get_exited(self): return self.__cmd_exited def get_term(self): return self.__term def get_vte(self): return self.__term.get_vte() def get_title(self): return self.get_host() def get_pixbuf(self): return self.__favicon_pixbuf def get_host(self): return self.__host def get_user(self): return self.__user def get_port(self): return self.__port def get_options(self): return self.__sshopts class SshWindow(VteWindow): def __init__(self, **kwargs): super(SshWindow, self).__init__(title='Secure Shell', icon_name='hotwire-openssh', **kwargs) self.__ui_string = """ """ self._get_notebook().connect('switch-page', self.__on_page_switch) try: self.__cached_nm_connected = None self.__nm_proxy = dbus.SystemBus().get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') self.__nm_proxy.connect_to_signal('StateChange', self.__on_nm_state_change) dbus.Interface(self.__nm_proxy, 'org.freedesktop.DBus.Properties').Get('org.freedesktop.NetworkManager', 'State', reply_handler=self.__on_nm_state_change, error_handler=self.__on_dbus_error) except dbus.DBusException, e: _logger.debug("Couldn't find NetworkManager") self.__nm_proxy = None self.__status_hbox = gtk.HBox() self._get_vbox().pack_start(self.__status_hbox, expand=False) self.__statusbar = gtk.Statusbar() self.__status_hbox.pack_start(self.__statusbar, expand=True) self.__statusbar_ctx = self.__statusbar.get_context_id("HotSSH") self.__in_reconnect = False self.__idle_stop_monitoring_id = 0 self.connect("notify::is-active", self.__on_is_active_changed) _hostmonitor.connect('host-status', self.__on_host_status) self.__connhistory = get_history() self.__local_avahi = get_local_avahi() self.__merge_ssh_ui() def __add_to_history(self, args, inituser=None, inithost=None): user = inituser host = inithost need_arg = False options = [] for arg in args: if arg.startswith('-') and SshTerminalWidget.ssh_opt_with_args.find(arg[1:]) >= 0: options.append(arg) if SshTerminalWidget.ssh_opt_with_args.find(arg[1:]) >= 0: need_arg = True continue if need_arg: options.append(arg) elif host is None: if arg.find('@') >= 0: (user, host) = arg.split('@', 1) else: host = arg need_arg = False self.__connhistory.add_connection(user, host, options) def remote_new_tab(self, args, cwd): return self.new_tab(args, cwd, exit_on_cancel=False) def new_tab(self, args, cwd, exit_on_cancel=True, **kwargs): if len(args) == 0 and len(kwargs) == 0: self.open_connection_dialog(exit_on_cancel=exit_on_cancel) else: self.__add_to_history(args, **kwargs) term = SshTerminalWidget(args=args, cwd=cwd, actions=self.__action_group, **kwargs) self.append_widget(term) def append_widget(self, w): super(SshWindow, self).append_widget(w) w.connect('status-changed', self.__on_widget_status_changed) w.connect('reconnect', self.__on_widget_reconnect) self.__sync_status_display() def __on_widget_status_changed(self, w): self.__sync_status_display() def __on_widget_reconnect(self, changed_widget): if self.__in_reconnect: return self.__in_reconnect = True changed_user = changed_widget.get_user() changed_host = changed_widget.get_host() changed_userhost = userhost_pair_to_string(changed_user, changed_host) _logger.debug("reconnecting all widgets for host %s", changed_userhost) for widget in self._get_notebook().get_children(): if changed_widget is widget: continue host = widget.get_host() user = widget.get_user() userhost = userhost_pair_to_string(user, host) if userhost != changed_userhost: continue widget.ssh_reconnect() self.__in_reconnect = False def __sync_status_display(self): notebook = self._get_notebook() pn = notebook.get_current_page() if pn < 0: return widget = notebook.get_nth_page(pn) if widget.connecting_state: text = _('Connecting') elif widget.connected is True: text = _('Connected; %.2fs latency; %s') % (widget.latency, widget.status_line) elif widget.connected is False: text = _('Connection timed out') elif widget.connected is None: text = _('Checking connection') #if len(widget.ssh_options) > 1: # text += _('; Options: ') + (' '.join(map(gobject.markup_escape_text, widget.ssh_options))) id = self.__statusbar.push(self.__statusbar_ctx, text) def __on_dbus_error(self, *args, **kwargs): _logger.error("DBus error: %r %r", args, kwargs) @log_except(_logger) def __on_nm_state_change(self, *args): if len(args) > 1: (_, curstate) = args else: curstate = args[0] _logger.debug("nm state: %s", curstate) connected = curstate == 3 if (self.__cached_nm_connected is not None) and \ (not self.__cached_nm_connected) and connected: self.__do_network_change_notify() self.__cached_nm_connected = connected for child in self._get_notebook(): child.set_global_connection_changed(True) def __do_network_change_notify(self): mgr = self._get_msgarea_mgr() msgarea = mgr.new_from_text_and_icon(gtk.STOCK_INFO, _('Network connection changed'), buttons=[(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)]) reconnect = self.__action_group.get_action('ReconnectAll') msgarea.add_stock_button_with_text(reconnect.get_property('label'), reconnect.get_property('stock-id'), gtk.RESPONSE_ACCEPT) msgarea.connect('response', self.__on_msgarea_response) msgarea.show_all() def __on_msgarea_response(self, msgarea, respid): mgr = self._get_msgarea_mgr() mgr.clear() if respid == gtk.RESPONSE_ACCEPT: for child in self._get_notebook(): child.set_global_connection_changed(False) reconnect = self.__action_group.get_action('ReconnectAll') reconnect.activate() @log_except(_logger) def __on_host_status(self, hostmon, userhost, connected, latency, status_output): _logger.debug("got host status host=%s conn=%s latency=%s", userhost, connected, latency) for widget in self._get_notebook().get_children(): child_userhost = userhost_pair_to_string(widget.get_user(), widget.get_host()) if child_userhost != userhost: continue widget.set_status(connected, latency, status_output) @log_except(_logger) def __on_is_active_changed(self, *args): isactive = self.get_property('is-active') if isactive: self.__start_monitoring() if self.__idle_stop_monitoring_id > 0: gobject.source_remove(self.__idle_stop_monitoring_id) self.__idle_stop_monitoring_id = 0 elif self.__idle_stop_monitoring_id == 0: self.__idle_stop_monitoring_id = gobject.timeout_add(8000, self.__idle_stop_monitoring) def __idle_stop_monitoring(self): self.__idle_stop_monitoring_id = 0 self.__stop_monitoring() @log_except(_logger) def __on_page_switch(self, n, p, pn): # Becuase of the way get_current_page() works in this signal handler, this # will actually disable monitoring for the previous tab, and enable it # for the new current one. self.__sync_monitoring(new_pn=pn) self.__sync_status_display() def __get_userhost_for_pn(self, pn): notebook = self._get_notebook() if pn >= 0: widget = notebook.get_nth_page(pn) return userhost_pair_to_string(widget.get_user(), widget.get_host()) return None def __stop_monitoring(self): notebook = self._get_notebook() pn = notebook.get_current_page() if pn >= 0: prev_widget = notebook.get_nth_page(pn) prev_user = prev_widget.get_user() prev_host = prev_widget.get_host() _hostmonitor.stop_monitor(prev_user, prev_host) prev_widget.set_status(None, None) def __start_monitoring(self, pn=None): notebook = self._get_notebook() if pn is not None: pagenum = pn else: pagenum = notebook.get_current_page() widget = notebook.get_nth_page(pagenum) _hostmonitor.start_monitor(widget.get_user(), widget.get_host()) def __sync_monitoring(self, new_pn): prev_userhost = self.__get_userhost_for_pn(self._get_notebook().get_current_page()) new_userhost = self.__get_userhost_for_pn(new_pn) if prev_userhost != new_userhost: self.__stop_monitoring() self.__start_monitoring(pn=new_pn) def __merge_ssh_ui(self): self.__using_accels = True self.__actions = actions = [ ('NewConnection', gtk.STOCK_NEW, _('Connect to server'), 'O', _('Open a new Secure Shell connection'), self.__new_connection_cb), ('CopyConnection', gtk.STOCK_JUMP_TO, _('New tab for connection'), 'T', _('Open a new tab for the same remote computer'), self.__copy_connection_cb), ('OpenSFTP', gtk.STOCK_OPEN, _('Open SFTP'), 'S', _('Open a SFTP connection'), self.__open_sftp_cb), ('ConnectionMenu', None, _('Connection')), ('Reconnect', gtk.STOCK_CONNECT, _('_Reconnect'), 'R', _('Reset connection to server'), self.__reconnect_cb), ('ReconnectAll', gtk.STOCK_CONNECT, _('R_econnect All'), None, _('Reset all connections'), self.__reconnect_all_cb), ] self.__action_group = self._merge_ui(self.__actions, self.__ui_string) @log_except(_logger) def __copy_connection_cb(self, action): notebook = self._get_notebook() widget = notebook.get_nth_page(notebook.get_current_page()) user = widget.get_user() host = widget.get_host() opts = widget.get_options() self.new_tab(widget.get_options(), None, inituser=user, inithost=host) def open_connection_dialog(self, exit_on_cancel=False): win = ConnectDialog(parent=self, history=self.__connhistory, local_avahi=self.__local_avahi) sshargs = win.run_get_cmd() if not sshargs: # We get here when called with no arguments, and we're the main instance. if exit_on_cancel: sys.exit(0) return self.new_tab(sshargs, None, exit_on_cancel=exit_on_cancel) @log_except(_logger) def __new_connection_cb(self, action): self.open_connection_dialog() @log_except(_logger) def __open_sftp_cb(self, action): notebook = self._get_notebook() widget = notebook.get_nth_page(notebook.get_current_page()) host = widget.get_host() port = widget.get_port() if port: subprocess.Popen(['nautilus', 'sftp://%s:%s' % (host,port)]) else: subprocess.Popen(['nautilus', 'sftp://%s' % (host,)]) @log_except(_logger) def __reconnect_cb(self, a): notebook = self._get_notebook() widget = notebook.get_nth_page(notebook.get_current_page()) widget.ssh_reconnect() @log_except(_logger) def __reconnect_all_cb(self, a): for widget in self._get_notebook().get_children(): widget.ssh_reconnect() def _do_about(self): dlg = HotSshAboutDialog() dlg.run() dlg.destroy() class SshApp(VteApp): def __init__(self): super(SshApp, self).__init__(SshWindow) self.__old_sessionpath = os.path.expanduser('~/.hotwire/hotssh.session') self.__sessionpath = os.path.expanduser('~/.hotssh/hotssh-session.xml') self.__connhistory = get_history() self.__local_avahi = SshAvahiMonitor() @staticmethod def get_name(): return 'HotSSH' def on_shutdown(self, factory): super(SshApp, self).on_shutdown(factory) cp = get_controlpath(create=False) if cp is not None: try: _logger.debug("removing %s", cp) shutil.rmtree(cp) except: pass def offer_load_session(self): savedsession = self._parse_saved_session() alltabs_count = 0 allhosts = set() if savedsession: for window in savedsession: for connection in window: allhosts.add(connection['userhost']) alltabs_count += 1 if len(allhosts) > 0: dlg = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_CANCEL, message_format=_("Restore saved session?")) button = dlg.add_button(_('_Reconnect'), gtk.RESPONSE_ACCEPT) button.set_property('image', gtk.image_new_from_stock('gtk-connect', gtk.ICON_SIZE_BUTTON)) dlg.set_default_response(gtk.RESPONSE_ACCEPT) allhosts_count = len(allhosts) # Translators: %d is the number of hosts we are about to reconnect to. text = gettext.ngettext('Reconnect to %d host' % (allhosts_count,), 'Reconnect to %d hosts' % (allhosts_count,), len(allhosts)) dlg.format_secondary_markup(text) #ls = gtk.ListStore(str) #gv = gtk.TreeView(ls) #colidx = gv.insert_column_with_attributes(-1, _('Connection'), # gtk.CellRendererText(), # text=0) #for host in allhosts: # ls.append((host,)) #dlg.add(gv) resp = dlg.run() dlg.destroy() if resp == gtk.RESPONSE_ACCEPT: self._load_session(savedsession) return w = self.get_factory().create_initial_window() w.new_tab([], os.getcwd()) w.show_all() w.present() def _load_session(self, session): factory = self.get_factory() for window in session: window_impl = factory.create_window() for connection in window: args = [connection['userhost']] if 'options' in connection: args.extend(connection['options']) widget = window_impl.new_tab(args, os.getcwd()) window_impl.show_all() #override @log_except(_logger) def _parse_saved_session(self): factory = self.get_factory() try: f = open(self.__sessionpath) except: try: f = open(self.__old_sessionpath) except: return None doc = xml.dom.minidom.parse(f) saved_windows = [] current_widget = None for window_child in doc.documentElement.childNodes: if not (window_child.nodeType == window_child.ELEMENT_NODE and window_child.nodeName == 'window'): continue connections = [] for child in window_child.childNodes: if not (child.nodeType == child.ELEMENT_NODE and child.nodeName == 'connection'): continue user = child.getAttribute('user') host = child.getAttribute('host') iscurrent = child.getAttribute('current') options = [] for options_elt in child.childNodes: if not (options_elt.nodeType == child.ELEMENT_NODE and options_elt.nodeName == 'options'): continue for option_elt in child.childNodes: if not (option_elt.nodeType == child.ELEMENT_NODE and options_elt.nodeName == 'option'): continue options.append(option.firstChild.nodeValue) userhost = userhost_pair_to_string(user, host) kwargs = {'userhost': userhost} if len(options) > 0: kwargs['options'] = options if iscurrent: kwargs['current'] = True connections.append(kwargs) saved_windows.append(connections) return saved_windows #override @log_except(_logger) def save_session(self): _logger.debug("doing session save") tempf_path = tempfile.mktemp('.xml.tmp', 'hotssh-session', os.path.dirname(self.__sessionpath)) f = open(tempf_path, 'w') state = [] doc = xml.dom.minidom.getDOMImplementation().createDocument(None, "session", None) root = doc.documentElement factory = self.get_factory() for window in factory._get_windows(): notebook = window._get_notebook() current = notebook.get_nth_page(notebook.get_current_page()) window_node = doc.createElement('window') root.appendChild(window_node) for widget in notebook: connection = doc.createElement('connection') window_node.appendChild(connection) user = widget.get_user() if user is not None: connection.setAttribute('user', user) host = widget.get_host() if host is not None: connection.setAttribute('host', host) if current == widget: connection.setAttribute('current', 'true') options = widget.get_options() if options: options_elt = doc.createElement('options') connection.appendChild(options_elt) for option in options: opt = doc.createElement('option') options_elt.appendChild(opt) opt.appendChild(doc.createTextNode(option)) f.write(doc.toprettyxml()) f.close() os.rename(tempf_path, self.__sessionpath) hotssh-0.2.6+dfsg1/README0000644000175000017500000000104411045672352013357 0ustar javijaviOn the web: http://www.gnome.org/projects/hotssh/ = Installation = HotSSH is currently built using WAF. This is a bit of an experiment, but it's what we use for now. If you want to run HotSSH straight from Subversion, just do: python bin/hotssh That's it, no setup/install. If you want to install to the system (complete with sh/csh aliases for 'ssh'), do: python ./waf configure --prefix=/usr python ./waf python ./waf install Hint for packagers: the waf usage of DESTDIR looks like this: python ./waf install --destdir=$RPM_BUILD_ROOT hotssh-0.2.6+dfsg1/bin/0000755000175000017500000000000011122614266013244 5ustar javijavihotssh-0.2.6+dfsg1/bin/wscript_build0000644000175000017500000000007011122606016016030 0ustar javijavibld.install_files('${PREFIX}/bin', 'hotssh', chmod=0755)hotssh-0.2.6+dfsg1/bin/hotssh0000755000175000017500000000463211115364205014504 0ustar javijavi#!/usr/bin/python # This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import sys, os if __name__ == '__main__' and hasattr(sys.modules['__main__'], '__file__'): basedir = os.path.dirname(os.path.abspath(__file__)) up_basedir = os.path.dirname(basedir) if os.path.exists(os.path.join(up_basedir, 'COPYING')): print "Detected COPYING; Apparently running uninstalled, extending path" sys.path.insert(0, up_basedir) os.environ['HOTWIRE_UNINSTALLED'] = up_basedir os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) exec_real_ssh = False try: import gtk except: # No gtk, clearly no hotssh exec_real_ssh = True if not exec_real_ssh: # These options are ones which are mostly designed to be used from # an existing Unix terminal. for arg in ['-n', '-s', '-T']: if arg in sys.argv[1:]: exec_real_ssh = True break if not exec_real_ssh: # If we have at least two nonoptions, then the command is of the form: # user@host command ... # This style is designed to get output into an existing display generally nonoption_count = 0 for arg in sys.argv[1:]: if not arg.startswith('-'): nonoption_count += 1 if nonoption_count > 1: exec_real_ssh = True if exec_real_ssh: os.execvp('ssh', ['ssh'] + sys.argv[1:]) # We want to avoid running under the controlling terminal if we were passed # --bg, which by default comes from our sh/csh alias if len(sys.argv) > 1 and sys.argv[1] == '--bg' and os.isatty(0): pid = os.fork() if pid == 0: del sys.argv[1] os.setsid() else: sys.exit(0) from hotssh.sshwindow import SshApp from hotssh.hotvte.vtewindow import VteMain VteMain().main(SshApp)