mythbuntu-log-grabber/0000755000000000000000000000000012314441256012166 5ustar mythbuntu-log-grabber/applications/0000755000000000000000000000000012314436456014662 5ustar mythbuntu-log-grabber/applications/mythbuntu-log-grabber.desktop.in0000644000000000000000000000054512314436456023106 0ustar [Desktop Entry] Encoding=UTF-8 _Name=Mythbuntu Log Grabber _Comment=Grab troubleshooting logs Icon=mythbuntu-log-grabber Exec=/usr/bin/mythbuntu-control-centre -s "Log Grabber" --plugin-root-path=/usr/share/mythbuntu/plugins Terminal=false Type=Application Categories=GNOME;GTK;Utility X-Ubuntu-Gettext-Domain=mythbuntu-log-grabber X-KDE-SubstituteUID=true mythbuntu-log-grabber/build/0000755000000000000000000000000012314441256013265 5ustar mythbuntu-log-grabber/build/share/0000755000000000000000000000000012314441256014367 5ustar mythbuntu-log-grabber/build/share/applications/0000755000000000000000000000000012314441256017055 5ustar mythbuntu-log-grabber/build/share/applications/mythbuntu-log-grabber.desktop0000644000000000000000000000054312314441256024672 0ustar [Desktop Entry] Encoding=UTF-8 Name=Mythbuntu Log Grabber Comment=Grab troubleshooting logs Icon=mythbuntu-log-grabber Exec=/usr/bin/mythbuntu-control-centre -s "Log Grabber" --plugin-root-path=/usr/share/mythbuntu/plugins Terminal=false Type=Application Categories=GNOME;GTK;Utility X-Ubuntu-Gettext-Domain=mythbuntu-log-grabber X-KDE-SubstituteUID=true mythbuntu-log-grabber/debian/0000755000000000000000000000000012314441256013410 5ustar mythbuntu-log-grabber/debian/control0000644000000000000000000000150312314436456015020 0ustar Source: mythbuntu-log-grabber Section: misc Priority: optional Maintainer: MythTV Ubuntu Maintainers Build-Depends: debhelper (>= 7), python3-all, intltool, python3-distutils-extra Standards-Version: 3.9.5 Homepage: http://www.mythbuntu.org Vcs-Bzr: http://bazaar.launchpad.net/~mythbuntu-dev/mythbuntu/mythbuntu-log-grabber Vcs-Browser: http://codebrowse.launchpad.net/~mythbuntu-dev/mythbuntu/mythbuntu-log-grabber Package: mythbuntu-log-grabber Architecture: all Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, debconf, mythbuntu-control-centre Description: Mythbuntu diagnostic utility This package will install the Mythbuntu Log Grabber utility to gather diagnostic data in an automated manner and upload it to pastebin. . mythbuntu-log-grabber/debian/rules0000755000000000000000000000073612314436456014504 0ustar #!/usr/bin/make -f %: dh $@ --with=python3 override_dh_auto_clean: set -ex; for python in $(shell py3versions -r); do \ $$python setup.py build; \ done; rm -f po/*.pot override_dh_auto_build: set -ex; for python in $(shell py3versions -r); do \ $$python setup.py build; \ done; override_dh_auto_install: set -ex; for python in $(shell py3versions -r); do \ $$python setup.py install --root=$(CURDIR)/debian/mythbuntu-log-grabber --install-layout=deb; \ done; mythbuntu-log-grabber/debian/compat0000644000000000000000000000000212314436456014614 0ustar 7 mythbuntu-log-grabber/debian/copyright0000644000000000000000000000174612314436456015361 0ustar This package was debianized by Nick Fox on Tue, 17 Nov 2009 15:43:52 -0600 Source located at Author(s) & Copyright: © 2009 Nick Fox License: 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 3 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, see . The Debian packaging is Copyright 2009 Thomas Mashos and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. mythbuntu-log-grabber/debian/changelog0000644000000000000000000001067612314436456015302 0ustar mythbuntu-log-grabber (0.11-0ubuntu2) trusty; urgency=low * Fix lintian errors -- Thomas Mashos Tue, 25 Mar 2014 15:38:12 -0700 mythbuntu-log-grabber (0.11-0ubuntu1) trusty; urgency=low [ Thomas Mashos ] * Use new pastebin API * Release 0.11 for trusty [ Mario Limonciello ] * Python2->python3 transition. * bump lintian version * don't build with CDBS. * Fix spacing for GTK3 changes. -- Thomas Mashos Tue, 25 Mar 2014 15:24:21 -0700 mythbuntu-log-grabber (0.10-0ubuntu1) precise; urgency=low * Added new logs for 0.25 -- Thomas Mashos Wed, 11 Apr 2012 06:56:23 -0700 mythbuntu-log-grabber (0.9-0ubuntu2) oneiric; urgency=low [ Marcin Juszkiewicz ] * langpack.mk got dropped from cdbs in favour of dh_translations - LP: #833892 [ Dave Walker (Daviey) ] * debian/control: Added Vcs-* entries. -- Marcin Juszkiewicz Wed, 31 Aug 2011 17:03:53 +0000 mythbuntu-log-grabber (0.9-0ubuntu1) natty; urgency=low * Updated frontend and backend log in TOC * Fixed issue with backend and frontend log gathering * Reverted icon * Updated maintainer * Bump standards version -- Thomas Mashos Wed, 13 Apr 2011 11:57:05 -0700 mythbuntu-log-grabber (0.8-0ubuntu2) maverick; urgency=low * Now grabs last 1000 lines of log files (LP: #685275) -- Thomas Mashos Thu, 09 Dec 2010 16:00:34 -0800 mythbuntu-log-grabber (0.8-0ubuntu1) maverick; urgency=low * debian/control: Fixed description * Fixed no URL when pushing to pastebin (LP: 559765) -- Thomas Mashos Fri, 30 Apr 2010 13:35:52 -0700 mythbuntu-log-grabber (0.7-0ubuntu1) lucid; urgency=low * Undo accidentally installing to it's own location. * debian/compat: - Bump to dh7 * debian/control, debian/rules: - Switch to pysupport, as it appears to support byte compiling python that's in a private location such as /usr/share/mythbuntu/plugins/python. -- Mario Limonciello Sat, 28 Nov 2009 15:01:01 -0600 mythbuntu-log-grabber (0.6-0ubuntu1) lucid; urgency=low [ Nick Fox ] * Convert to MCC Plugin * Build UI to match MCC stardards * Add Log gathering selection * Remove step to ask user to upload * Add MCC Progress Bar Emit * Update Packging Standards * Remove Depend on Pastebinit * Add upload timeout * Add GUI Error Reporting [ Mario Limonciello ] * Add a .desktop file to run this in single plugin mode for MCC. * Add basics for translation support. * Update build depends. -- Nick Fox Fri, 27 Nov 2009 13:07:34 -0600 mythbuntu-log-grabber (0.5-0ubuntu1) karmic; urgency=low * Convert the application from Glade to GtkBuilder. -- Mario Limonciello Sat, 03 Oct 2009 17:03:47 -0500 mythbuntu-log-grabber (0.4-0ubuntu2) karmic; urgency=low * debian/control, debian/compat: - Update to dh7. Fixes FTBFS on karmic. -- Mario Limonciello Sun, 26 Jul 2009 23:29:03 -0500 mythbuntu-log-grabber (0.4-0ubuntu1) karmic; urgency=low * Move to stanard python logging module (LP: #405023) -- Nick Fox Sun, 26 Jul 2009 21:32:13 -0500 mythbuntu-log-grabber (0.3-0ubuntu1) jaunty; urgency=low [ Nick Fox ] * Fix mousepad opening twice (LP: #340931) [ Mario Limonciello ] * Don't install python files in two locations. -- Nick Fox Sun, 12 Apr 2009 23:03:27 -0500 mythbuntu-log-grabber (0.2-0ubuntu2) jaunty; urgency=low [ Thomas Mashos ] * Don't install the manpages anymore. [ Nick Fox ] * Open only one Editor for view (LP: #340931) * Create log gathering point is doesn't exist (LP: 341209) * Add Ubuntu release gathreing * Add app error logging -- Nick Fox Wed, 11 Mar 2009 22:54:59 -0500 mythbuntu-log-grabber (0.2-0ubuntu1) jaunty; urgency=low [ Thomas Mashos ] * Don't force the application to launch with root permissions -- Mario Limonciello Sat, 28 Feb 2009 22:35:57 -0600 mythbuntu-log-grabber (0.1-0ubuntu2) intrepid; urgency=low * debian/control: - Add editor dependencies. -- Mario Limonciello Mon, 15 Sep 2008 21:34:18 -0500 mythbuntu-log-grabber (0.1-0ubuntu1) intrepid; urgency=low [ Thomas Mashos and Nick Fox ] * Initial release -- Thomas Mashos Thu, 28 Aug 2008 22:20:57 -0700 mythbuntu-log-grabber/TODO0000644000000000000000000000030412314436456012661 0ustar Items to Be Repaired/Added Prior to Lucid Release: -Add Reccomends for Pastebinit -Add MCC Progress Bar support -Fix Bug for additional Log support -Add list of logs gathered to top of log report mythbuntu-log-grabber/setup.cfg0000644000000000000000000000015112314436456014012 0ustar [build_i18n] desktop_files=[ ('share/applications', ['applications/mythbuntu-log-grabber.desktop.in'])] mythbuntu-log-grabber/setup.py0000755000000000000000000000332412314436456013713 0ustar #!/usr/bin/python # Mythbuntu-log-grabber install script # Copyright (C) 2007-2009, Mario Limonciello # # # 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from distutils.core import setup import subprocess, glob, os.path from DistUtilsExtra.command import * setup( name="mythbuntu-log-grabber", author="Thomas Mashos", author_email="tgm4883@ubuntu.com", maintainer="Mythbuntu Team", maintainer_email="ubuntu-mythtv@lists.ubuntu.com", url="http://www.mythbuntu.org", license="gpl", description="debugs mythbuntu problems", data_files=[("share/mythbuntu/plugins/ui", glob.glob("plugins/ui/*")), ("share/mythbuntu/plugins/python", glob.glob("plugins/python/*")), ("share/pixmaps", glob.glob("plugins/*.png")), ("share/applications", glob.glob("applications/*.desktop"))], cmdclass = { 'build': build_extra.build_extra, 'build_i18n': build_i18n.build_i18n, 'build_icons': build_icons.build_icons, 'clean': clean_i18n.clean_i18n, } ) mythbuntu-log-grabber/plugins/0000755000000000000000000000000012314436456013655 5ustar mythbuntu-log-grabber/plugins/mythbuntu-log-grabber.png0000644000000000000000000000350112314436456020602 0ustar PNG  IHDR00WsRGBbKGD pHYs  tIME p tEXtCommentCreated with GIMPWIDAThՙklU^BV\DVAnYi]oS%^$Mv͢aXĕVM4fe7Q#&J"  3*,aLP0JIV ՊֿxRYO˺w_ʰ.Zd7%5)hqu~O jj\&/nO|fRԟk~'\Z&ő2v#_$wE@wQCH)XQm]+fN?\+)Bz*`l v-YCn߰ɿ?  $g"Yrf|zױëս;v没x<' " ,}9mB6lheUOFQ8[-$W+ صJQY+I1ߢrRQ|D%IgE۩BA\W2wP'|++c_°(CB/ ?ǯмoc\!~czwj@Y")$}6YEW)py7|0ED;U.rweۂcY`8}&Aab6{ Qy $~ <}PvY'"AYP*D&2V|%=:@Yt-/"uDHu%3lj}b 腵@GAFhWT0l@'VN|'XnLXѹgf,Ct :+D799]\&9t|j PMV)n澄hGBgY"^DGw@{Lnam o@ESnI 8u@!#ٰL}HD0 ˷~[Y퇁O 暙Jg_x&`WJn9/_.@%8bOU7sͦ6h^M PU$W=)Y*-9y#4**9R*8ßV7Ĩ7985' M3#%&((9Jw1$)())*),3v0%))*+:0"')**)*)*)0'()**)(())($$/&()*)**))'2()*))*(&1(')**))*)'&"2'()*))4#)((''("6"&'$; <;::;::9::89:987q79853󲱴1000/11󻷶2368<;:f:LK;LO:LNPQ9:NQRR9HPQQ:JPQQ:KPQRQ9KOQRR9NPQR:GNQQ91` $;V    ê   ö  ÿ    0/133433244434333445678:;=<􋈆q2򌊉/U-u'q& & &' U$ $ $# m#$##  U  f U  wUm     ./0223332s433343333456889:<=."(.311/.3+13433554300/54554/'0456676676654.,2566776553'O3.5667 7654/&PU/5667 765.&QH34677'RP>457 764.%QRQQK5567 7651%RPK7667 7651$RQN7567 7653$RQPN5567 7654$#RQOH/467753$QRME)/567 76530#NI<535577653#>;6556764- $,+-*767677654/ 2543445752 5655276513556776643 6776523566775 5667653*356677654 4545545567761'2556677654 *3342244667 7653$/445667 7645 $&"*4667 7653$/65677655/567 7652/656776550667 7653$/65677654 3567 7654565677654 1567 765445677645 ,6677645677655 0467767655 6567.76544567/765505670764516671765515672765-357376"356737*256737146672726737$45737*3673734673746737145737046737356737'566737'456747'566757'456767'456777'456787'566797'5667:75667;76=7577  1\_%/0ф1- ?~!& BP&M1 u&e| !&k b&~9 &$i W$焅 $w ;#nZ ]#1;g#UK #⭢7u   3n\&=Cє=SEF `EH Z EI W L|I $7k ^t G W _zG; [zH5 _zI 6 bzI 9 ꄄG 9G :H /.I,/H*0G)1G23n3L3)2 3~3 3 333*373 s3 a4 `5 b6 b7 a8 `9 `:`;<j *********** ª***Y ª**** j  U  j55465576417653763.75176547654 7654R764RR7652RR76554RR7652-RR7654*RR 7651RR7654RRI7 764/RR76540RR76417652-777 7652-7765377654477655377655377jHIHC2wC55 5 5 3 ' e* H I ;4e ' 2 5 6 6# /56655555555677788888999999999999953210/.-,# /56655555555677788888999999999999953210/.-,70#70 /70570670670572057205710571057105720573057406760771774776878787878797979797979797979797979797577737"((*)727+,-..--17,.-.//07+-//0/7+../00.7,-./00-7+-./00,7'../00 ;&808/yǻo695;5;493/2;764321.* ( '&%$                               ;7m74321. *拌 (󽌌 '筌&ܨ%Λ$ߺͥ  զ Ӥ Ȝ 洒 ؟ ė  ߭ ɗ 笍񿒍Ĩ ɖȖ  ܤ ⮍ ֬  Τۦ ᮍث Ʃȥ  䭍 ઍ ੍ۤʛ⮑ĕʔ ʔ  򿑍 ꯍ ࢎ  ј 븒 ס  ઍ㬍⬍଍ᱮҩРƯ鶏֠贒Ė˖ϗҚ;5677956777*036774(--356773124466772355671.4566771156677**"%(,+,3567 7(,,+--.--0567 7'%)-../36677&*--..//0/04677%(../00/0477$-/./0 025770,.//0 01577 00&,.0015770 0,-/00157700 0-./0015770 0'-./0036770 0,./00157700 0$-/002677 0%-//00367700$..00156700**),./0036700")+,..-..--/0025600350).--/./0015700133--..//00/015700*..//!0267003.//0"0147700../0"014770(-/0"014770!-.0"014770,.//0 014770-.//0 0147703-./0010014770-/0014332002577300/.00146654335776520 0$,/00147766 7610 0+//001577631000*$-/001577")++*+--//002577'),,..--../003677*,-../0256773--..//0$01567 7-..//0&0167 7+..//0'0267 7-//)0367 7)-//0)0467 7*../0)0157 7+./0*0367 7$-//0)0157 7)./0)01477%-.0(01477+../001210 01477"-.00241001477,//00341001477*$-./00154100123577,-,,./0035543445677.-.,,./0015766776677/.,./0036770/..110025770/101677!01577!01577;L7G6 /c4"n39y2;1.9*"3JA4_ ( Ktε 'J&*z%,$" #\"("x! U - a  "~Dc=NS#R&L'8(z)K(')O*f+f+n+ z*  |++@M_if*C}*<,N2I4/5 k6>7*8 ^99%:):#9v:K9-9aOJ8Ӵ7נ9;>;::8776644332223399:9999:9999:9:;:9ö9¹77Ŀ777::999¿9¿99ÿ99¿999¿7Ķ7»77ê87?<<<:8877653322233999999999999999;U:9m977777U9:9q9999999999777787767<7657;76547:7654479765447876553777654377654467654457654447655347654337655437654276327654276543765437654797654797654797654797654797654797654797654797654797654797654797654797654797654797654797637:76537:764,797641$797654.77767653*777651*7776430.777653177764'797647:754/797543797653.797654*7:74*7:753*797653*797652*797654*7:752*797643*797652*77767653$7776563"777651*777654*787653777<;:59586767565554636251:0A /D .D -D ,D +D*D)D(D'D&D%D$D#D"D!D DDDE_(M\ _ \ ٞO !i."M #u%6%T &^ 'a (a )^ *^ + ` , a - ` . ^ / e 0q1r2wM 3D4K7ݍ7654377654477654475375373777777777777655666K++ *)*) ' #  Ŀ.-,+*)( ' &$#""!  !""##$%&'()+)+, , , - - - -+*))(*'&%%##++*)*) ' #  u.-,󈊌+*)( ' %$#""!   !""#%&'')f)***+ - , - - - -++*('('&%$$"+7*./00+7!-./00*7,./00/0)7'-/00/./0*7)..00/0)7(./0 0'7(-.0 0 #7*,./0 07)--/0 07'-..//00./54420./00-462./00,/4667764100+45576400*3566776300)2356776300(46557763100'466 764200&7653100%466765334#56676#56676!256677!5677 -35677.33567732466773556677056771457 7346677.5667 735"73467"704567"7/5567#7/6567$7/6567%7/4567&7$4667'7.4567(71467)7&357*734567)735667*735667+7 -3567,7 .34567,7 $4567-7 (2567-7 *3567-7 .4567,735667+74567*746*724667(725667'7.367(7457'74557&73467%76567$75667#73567"71B10 [./+/3 /9 00 0 / b. V-,,++" *(|)3(5'5& %5$4#4"3!& g 2(e<5 K& l!6""{#z$z%z&t' a(>)|*K);*2+ ", P, y- z- _- &,2+1*1)3(8' d(''?&K%U$[#^"    ,,,+* ++++,.0 / . - , +*)'&&%$#"!    ½ĿĿ Ŀ ¼   ! # %'()+-¿/ϙĔթ籐赚 Ϛֹ ⨎ⳟ 鰍٫ ﵏Ծ첏ݥ,ŗ+⫎*뷏** 캐*踐+ⶐ+Ю+ѻ+,0 / . - + *)('&%%$#"! xm   U     ! # %'()+-/!01577 0210015677 0132003677 03531002677 0146530 012677 04665410 013467760 0377674100147677650 0367742101100125776520 03677545455776520 04677676776520 01567*76520 0467*76520 0367*76520 0367*76520 0367*76520 0367*76520 0367*76520 01367+762001234567*7620 0566+76520 067-76520 0.76520 0-76520 0,765200+765200*765200)765200(765200'765200&765200%765200$765200#765200"765200!765200 765200762007530076430/00767653-$./00765653600./00765541'00./0076543&00./00765560 0./00765430 0./00765530 0./007655300./007543300./0075450100./007654-00./007566500./00 754500./00 7654/00./0 0 75400./0 0 7653'./0 0 76544!./0 0 7656#./0 07654%./007653'./00753'(./007632*./007541+./007653.-./007654*/./00 <:{Y6l&4q&2ʈR &0E&.8 &,6 &*; &(@&%Ɣ<&#?&!~&v&z&&%&h &1!&B#&D%&F'&q (&3)& S+& ^ -&a /&¼:ö9;²;9:987 54 3 2 1 0 /.-,+*)('&%$###"!  !"%$%&'()*+, - . / 0 1234567:m9;99:987 543 2 1 0 / .-,+*)('&%$##$#"   !"%$%&'()*+, - . / 0 1234567765,7:7653$797653.7:7543787655.79752207:720//7970/7870/7770/777 70/70/60/50/4 0/3 0/2 0/1 0/0 0//0/.0/-0/,0/+0/*0/)0/(0/'0/&0/-$0/.#0.-#0/-"0/-!02 0/-0/+0/+0/,0/.0/*0/* 0/*!0/*"0%0/*$0/*%0/*&0/*'0/*(0/*)0/**0/*+0/*, 0/*- 0/*. 0/*/ 0/*0 0/*10/*20/*30/*40/*50/*60/*77Z78Y 8&9/:`9`8`7`6`5`4`3`2 `1 `0 `/ `. `-`,`+`*`)`(`'`&`%`$Z##8#8"8! 8/LQ!$$ $!$"$$$$%$&$'$($)$*$+$, $- $. $/ $0 $1$2$3$4$5$6$7ύ7!!! !%' ) +-û0IJ248w!!  f#% ' )+-0268"3567!7$0557!7(3567 7155677455677346677653456776553355677655404556776554) 4556776543#3466776544%34567 765531'35567 7542-)4556776543-+4556776553.$-346567764450345667655132/43455436*1335318*3+(|!:!i }܏~5SA!Α:% d$' j)ߤU+q&-ԉI0V 2fP44_}>8¿1ÿ35¿7:¿;<1357:;<m74*1./00767663*3./00665*5.//6554*7%-6443:2.*;03<$a 1&^ 3&` 5&\ 7"ٌD :~,;/<89:89:0/*80/*9.//*:'-($8$9΢$: "kk55mythbuntu-log-grabber/plugins/ui/0000755000000000000000000000000012314441256014264 5ustar mythbuntu-log-grabber/plugins/ui/tab_log_grabber.ui0000644000000000000000000004735112314436456017736 0ustar True False 6 True True 0 0.46000000834465027 <big><b>Log Grabber</b></big> True True False False 0 True False False False 6 1 True False 10 True False True False 0 0 Mythbuntu Log Grabber gathers diagnostic data for troubleshooting False False 0 True False 0 0 Select the logs you would like to gather and post to be used by Mythbuntu support for troubleshooting: False False 1 True False True False 10 Enable/Disable All True True False 0 0 True False False 0 True False False False 6 1 False False 2 True False 10 True False 4 2 True False 5 Syslog True True False 0.5 True GTK_FILL True False 5 Mythbuntu Version True True False 0.5 True 1 2 True False 5 MythTV Backend Log True True False 0.5 True 1 2 True False 5 Disk Space True True False 0.5 True 1 2 1 2 True False 5 MythTV Frontend Log True True False 0.5 True 2 3 True False 5 Installed Hardware True True False 0.5 True 3 4 True False 5 Xorg Log True True False 0.5 True 1 2 2 3 True False 5 Xsession Logs True True False 0.5 True 1 2 3 4 False False 3 True False True False 10 5 True False 0 0 <b>Gathered Logs:</b> True False False 0 True False 5 5 15 True True True You will need to provide the Mythbuntu support the URL generated here. False False False 1 True False 10 5 True False 0 0 Note: To get the output URL and collect the logs you will need to click on the apply button below. False False 2 False False 4 False False 6 2 mythbuntu-log-grabber/plugins/python/0000755000000000000000000000000012314436456015176 5ustar mythbuntu-log-grabber/plugins/python/log_grabber.py0000644000000000000000000003336212314436456020024 0ustar ## -*- coding: utf-8 -*- # # «mythbuntu_log_grabber» - Utility to grab diagnostic logs and data for user support # # Copyright (C) 2009, Nick Fox, for Mythbuntu # Copyright (C) 2009, Thomas Mashos, for Mythbuntu # Copyright (C) 2010, Thomas Mashos, for Mythbuntu # # # Mythbuntu 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 application; if not, write to the Free Software Foundation, Inc., 51 # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################## from MythbuntuControlCentre.plugin import MCCPlugin from gi.repository import Gtk import os import subprocess import urllib.request, urllib.parse, urllib.error import socket import threading class LogGrabberPostThread(threading.Thread): def __init__(self, data_input): self.data_input = data_input threading.Thread.__init__(self) def run(self): return post_data(self.data_input) def post_data(data_in): """ Post data to Mythbutnu Pastebin """ try: url = "http://pastebin.com/api/api_post.php" params={} params['api_dev_key'] = '9b1e10401e1ec3eda4b9f09be0ddca5e' params['api_paste_code'] = data_in params['api_option'] = 'paste' data = bytes(urllib.parse.urlencode(params), "utf-8") page = urllib.request.urlopen(url, data).read() paste_url = page except: paste_url = "Timeout/Error occured while uploading data. Local Data: /tmp/mythbuntu.diag" return paste_url class LogGrabberPlugin(MCCPlugin): """An Example Plugin for showing how to use MCC as a developer""" # #Load GUI & Calculate Changes # TOC = [ ] def __init__(self): import os #Initialize parent class information = {} information["name"] = "Log Grabber" information["icon"] = "mythbuntu-log-grabber" information["ui"] = "tab_log_grabber" """Remove Any Old Logs""" if os.path.exists('/tmp/mythbuntu.diag'): os.remove('/tmp/mythbuntu.diag') socket.setdefaulttimeout(45) MCCPlugin.__init__(self,information) def captureState(self): """Determines the state of the items on managed by this plugin and stores it into the plugin's own internal structures""" self.changes = {} self.changes['syslog'] = os.path.exists('/var/log/syslog') self.changes['backend'] = os.path.exists('/var/log/mythtv/mythbackend.log') self.changes['frontend'] = os.path.exists('/var/log/mythtv/mythfrontend.log') self.changes['xorg'] = os.path.exists('/var/log/Xorg.0.log') self.changes['xsession'] = os.path.exists(os.environ['HOME'] + '/.xsession-errors') self.changes['disk'] = True self.changes['version'] = True self.changes['hardware'] = True def applyStateToGUI(self): """Takes the current state information and sets the GUI for this plugin""" if not self.changes['syslog']: self.sys_log_check.set_sensitive(False) if not self.changes['backend']: self.backend_check.set_sensitive(False) if not self.changes['frontend']: self.frontend_check.set_sensitive(False) if not self.changes['xorg']: self.xorg_check.set_sensitive(False) if not self.changes['xsession']: self.xsession_check.set_sensitive(False) # MCC Will Try to upload logs if This is enabled by default self.enable_all_checkbox.set_active(False) def compareState(self): """Determines what items have been modified on this plugin""" MCCPlugin.clearParentState(self) if self.sys_log_check.get_active(): self._markReconfigureUser('Syslog', self.sys_log_check.get_active()) if self.backend_check.get_active(): self._markReconfigureUser('Mythbackend Log', self.backend_check.get_active()) if self.frontend_check.get_active(): self._markReconfigureUser('Mythfrontend Log', self.frontend_check.get_active()) if self.xorg_check.get_active(): self._markReconfigureUser('Xorg Log', self.xorg_check.get_active()) if self.xsession_check.get_active(): self._markReconfigureUser('Xsession Errors', self.xsession_check.get_active()) if self.hardware_check.get_active(): self._markReconfigureUser('Installed Hardware', self.hardware_check.get_active()) if self.version_check.get_active(): self._markReconfigureUser('Mythbuntu Version', self.version_check.get_active()) if self.disk_space_check.get_active(): self._markReconfigureUser('Disk Space', self.disk_space_check.get_active()) # # Callbacks # def on_enable_all_checkbox_toggled(self,widget,data=None): """Enable/Disable all Options in GUI""" check_changed = self.enable_all_checkbox.get_active() if check_changed: if self.sys_log_check.props.sensitive: self.sys_log_check.set_active(True) if self.backend_check.props.sensitive: self.backend_check.set_active(True) if self.frontend_check.props.sensitive: self.frontend_check.set_active(True) if self.xorg_check.props.sensitive: self.xorg_check.set_active(True) if self.xsession_check.props.sensitive: self.xsession_check.set_active(True) if self.hardware_check.props.sensitive: self.hardware_check.set_active(True) if self.version_check.props.sensitive: self.version_check.set_active(True) if self.disk_space_check.props.sensitive: self.disk_space_check.set_active(True) else: if self.sys_log_check.props.sensitive: self.sys_log_check.set_active(False) if self.backend_check.props.sensitive: self.backend_check.set_active(False) if self.frontend_check.props.sensitive: self.frontend_check.set_active(False) if self.xorg_check.props.sensitive: self.xorg_check.set_active(False) if self.xsession_check.props.sensitive: self.xsession_check.set_active(False) if self.hardware_check.props.sensitive: self.hardware_check.set_active(False) if self.version_check.props.sensitive: self.version_check.set_active(False) if self.disk_space_check.props.sensitive: self.disk_space_check.set_active(False) # # Process selected activities # def user_scripted_changes(self, reconfigure): for item in reconfigure: self.TOC.append(item) self.init_log() for item in reconfigure: if item == "Syslog": if reconfigure[item]: self.emit_progress("Gathering the Syslog...", 20) self.syslog() elif item == "Mythbackend Log": if reconfigure[item]: self.emit_progress("Gathering the MythTV Backend log...", 30) self.mythbackend() elif item == "Mythfrontend Log": if reconfigure[item]: self.emit_progress("Gathering the MythTV Frontend Log...", 40) self.mythfrontend() elif item == "Xorg Log": if reconfigure[item]: self.emit_progress("Gathering the Xorg Log...", 50) self.xorg_log() elif item == "Xsession Errors": if reconfigure[item]: self.emit_progress("Gathering the Xsession Log...", 60) self.xsession_errors() elif item == "Installed Hardware": if reconfigure[item]: self.emit_progress("Gathering System hardware Info...", 70) self.installed_hardware() elif item == "Mythbuntu Version": if reconfigure[item]: self.emit_progress("Gathering the Mythbuntu Version Info...", 80) self.mythbuntu_version() elif item == "Disk Space": if reconfigure[item]: self.emit_progress("Gathering the Hard disk info...", 90) self.disk_space() if os.path.exists('/tmp/mythbuntu.diag'): if len(reconfigure) >= 1: with open('/tmp/mythbuntu.diag') as file: self.emit_progress("Posting the diagnostic data...", 95) paste_data = file.read() get_url = LogGrabberPostThread(paste_data) paste_url = get_url.run() while get_url.isAlive(): """ Just keep passing until the thread goes away """ pass self.pastebin_output.set_text(paste_url.decode("utf-8")) file.close() else: print("Diagnostic data file not found!") def write_log(self, section_name, data_in=None): """Builds the Actual Log File on the Local Machine""" try: data_in = data_in.decode("utf-8") except: pass if ( section_name == "Initialize" ): log = open('/tmp/mythbuntu.diag', 'w') log.write("Gathered following logs\n") for TOC in self.TOC: log.write('=== '+TOC+' ===\n') log.write('\n') log.close() else: """Append""" log = open('/tmp/mythbuntu.diag', 'a') log.write('=== ' + section_name + ' ===\n') log.write(data_in) log.write('\n') log.close() def tail_log(self, FILEPATH, HEADER): MAXLINES=1000 MLP=int(MAXLINES/100) LINES=MAXLINES+MLP linestuffs = [] if os.path.isfile(FILEPATH): f = open(FILEPATH, "r") more = True while more: line = f.readline() if line: if len(linestuffs) >= LINES: del linestuffs[0:MLP] linestuffs.append(line) else: more = False f.close() else: linestuffs.append("** "+FILEPATH+" not found **\n") data_in = "=== "+FILEPATH+" ===\n" for stuff in linestuffs: data_in += stuff ## Change to write to logfile self.write_log(HEADER,data_in) def init_log(self): self.write_log("Initialize") def installed_hardware(self): """Gather all Hardware Information""" data_in = subprocess.Popen(["/usr/bin/lspci"], stdout=subprocess.PIPE).communicate()[0] data_in += subprocess.Popen(["/usr/bin/lsusb"], stdout=subprocess.PIPE).communicate()[0] self.write_log("Installed Hardware",data_in) def xorg_log(self): """Read in the Xorg.0.log""" self.tail_log('/var/log/Xorg.0.log',"Xorg Log") def xsession_errors(self): """Get the Xsession Errors""" session_log = os.environ['HOME'] + '/.xsession-errors' self.tail_log(session_log,"Xsession Log") def syslog(self): """Read in the Syslog""" self.tail_log('/var/log/syslog', "Syslog") def mythfrontend(self): """Read in the Frontend type logs""" self.tail_log('/var/log/mythtv/mythfrontend.log', "Mythfrontend Log") self.tail_log('/var/log/mythtv/mythavtest.log', "Mythavtest Log") self.tail_log('/var/log/mythtv/mythlcdserver.log', "Mythlcdserver Log") self.tail_log('/var/log/mythtv/mythmessage.log', "Mythmessage Log") self.tail_log('/var/log/mythtv/mythshutdown.log', "Mythshutdown Log") self.tail_log('/var/log/mythtv/mythwelcome.log', "Mythwelcome Log") def mythbackend(self): """Read in the Backend type logs""" self.tail_log('/var/log/mythtv/mythbackend.log', "Mythbackend Log") self.tail_log('/var/log/mythtv/mythccextractor.log', "Mythccextractor Log") self.tail_log('/var/log/mythtv/mythcommflag.log', "Mythcommflag Log") self.tail_log('/var/log/mythtv/mythexport.log', "Mythexport Log") self.tail_log('/var/log/mythtv/mythfilldatabase.log', "Mythfilldatabase Log") self.tail_log('/var/log/mythtv/mythjobqueue.log', "Mythjobqueue Log") self.tail_log('/var/log/mythtv/mythmediaserver.log', "Mythmediaserver Log") self.tail_log('/var/log/mythtv/mythmetadatalookup.log', "Mythmetadatalookup Log") self.tail_log('/var/log/mythtv/mythpreviewgen.log', "Mythpreviewgen Log") self.tail_log('/var/log/mythtv/mythtranscode.log', "Mythtranscode Log") self.tail_log('/var/log/mythtv/mythtv-setup.log', "Mythtv-setup Log") self.tail_log('/var/log/mythtv/mythutil.log', "mythutil Log") def disk_space(self): """Gather all Disk Information""" data_in = subprocess.Popen(["/bin/df", "-h"], stdout=subprocess.PIPE).communicate()[0] self.write_log("Disk Space",data_in) def mythbuntu_version(self): """Gather Mythbuntu Version""" data_in = subprocess.Popen(["/usr/bin/lsb_release", "-a"], stdout=subprocess.PIPE).communicate()[0] self.write_log("Mythbuntu Version",data_in) mythbuntu-log-grabber/po/0000755000000000000000000000000012314441256012604 5ustar mythbuntu-log-grabber/po/POTFILES.in0000644000000000000000000000003612314436456014366 0ustar plugins/ui/tab_log_grabber.ui