# coding=utf-8 import tk_ as tk from PIL import ImageTk from tooltip import ToolTip from itemeditor import ItemEditor from inventoryeditor import InventoryEditor import config it = config.ItemTypes() cd = config.CharData() msg = config.Messages() colors = config.Colors() class EquipmentScreen(tk.Frame): def __init__(self, main, app): tk.Frame.__init__(self, main) self.app = app self.char = app.char self.itemlist = app.itemlist self.canvas_width = 0 self.account_info = tk.StringVar() self.active_bag_id = -1 self.open_windows = app.open_windows # define the three columns self.left_frame = tk.Frame(self) self.left_frame.place(relx=0,
from dl_cmdline import DisplayLegacyCmdline logging.basicConfig(filename="log", format="[%(lineno)d]%(asctime)s:%(levelname)s:%(message)s", level=logging.DEBUG) if __name__ == "__main__": if len(sys.argv) > 1: if os.path.exists(sys.argv[1]): cfg = config.Config(sys.argv[1]) else: # Change it so it at least tries to read default path/values first. print("Invalid configuration file path.") cfg = config.Config() else: cfg = config.Config() board = Board(config=cfg) c = config.Colors() # terminal colors object marker = Marker() dl = DisplayLegacy(cfg, board, c, marker) # Command line legacy interface - used by default if cfg.display_legacy in ("True", "true"): screen = DisplayLegacyCmdline(board, c, cfg, dl, marker) screen.run() # urwid GUI else: screen = display.Display(cfg, board) screen.run()
opts = sorted(cfg.defaults.keys()) for opt in opts: value = cfg.get_cfg_opt(opt, c.RED + "not set /" + c.BLACK \ + " default: " + c.GREEN + cfg.defaults[opt] + c.BLACK) print(opt.ljust(20) + value) elif cmd_argv[0] == "exit": sys.exit(0) else: print(c.RED + "Command " + cmd_argv[0] + " not found." + c.BLACK) if __name__ == "__main__": if len(sys.argv) > 1: if os.path.exists(sys.argv[1]): cfg = config.Config(sys.argv[1]) else: print("Invalid configuration file path.") cfg = config.Config() else: cfg = config.Config() marker = Marker() board = Board(config=cfg) # display = Display(config=cfg, board=board, marker=marker) # terminal colors object c = config.Colors() print(c.YELLOW + "sshchan-admin" + c.BLACK) while True: cmdline(cfg, board, c)