3 # Copyright (C) 2006 by Aiwota Programmer
4 # aiwotaprog@tetteke.tk
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 from Hage1 import thread_window
29 from Hage1 import board_window
30 from Hage1 import brdlist_window
31 from Hage1 import brdlist
32 from Hage1 import config
37 print """usage: hage1 [-s bbs | -b board | -t thread]
38 -s, --bbs bbs : bbs id
39 -b, --board board : board id, ignored if bbs is empty
40 -t, --thread thread : thread id, ignored if bbs and board is empty"""
48 opts, args = getopt.getopt(
49 sys.argv[1:], "hs:b:t:", ["help", "bbs=", "board=", "thread="])
50 except getopt.GetoptError, msg:
54 for option, value in opts:
55 if option in ("-h", "--help"):
58 elif option in ("-s", "--bbs"):
60 elif option in ("-b", "--board"):
62 elif option in ("-t", "--thread"):
65 return bbs, board, thread
67 if __name__ == "__main__":
70 bbs, board, thread = getoption()
72 gnome.init(APPNAME, APPVERSION)
73 gobject.threads_init()
74 config.APPNAME = APPNAME
75 # init brdlist after setting config.APPNAME
79 brdlist_window.open_brdlist("2ch")
81 brdlist_window.open_brdlist(bbs)
83 board_window.open_board(bbs, board)
85 thread_window.open_thread(bbs, board, thread)