padherder_proxy.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:padherder_proxy 作者: jgoldshlag 项目源码 文件源码
def __init__(self, parent):
        self.us_to_jp_map = {}
        self.monster_data = {}
        wx.Panel.__init__(self, parent)
        grid = wx.GridBagSizer(hgap=5, vgap=10)

        config = wx.ConfigBase.Get()
        host = config.Read("host") or socket.gethostbyname(socket.gethostname())

        start_instructions = wx.StaticText(self, label="Just the first time, you need to add the HTTPS certificate to your iOS/Android device. To do this, go to your wifi settings and set up a manual HTTP proxy. Set the server to '%s' and the port to 8080. Then visit http://mitm.it in Safari/Chrome, click the link for your device, and install the configuration profile when asked. After this is done, turn off the HTTP proxy." % host)
        start_instructions.Wrap(580)
        grid.Add(start_instructions, pos=(0,0))

        dns_instructions = wx.StaticText(self, label="To synchronize your box with padherder, enter your padherder username and password in Settings. Then go to your wifi settings and change your DNS server to '%s'. Then press the home button. If you switch to the DNS Proxy Log tab, you should see a bunch of log lines. Make sure Puzzle and Dragons is completely closed, and re-open it. Once you get in game, close PAD completely again and restore your DNS settings." % host)
        dns_instructions.Wrap(580)
        grid.Add(dns_instructions, pos=(1,0))

        status_label = wx.StaticText(self, label="Status:")
        grid.Add(status_label, pos=(2,0))

        self.status_ctrl = wx.TextCtrl(self, wx.ID_ANY, size=(400,300),
                          style = wx.TE_MULTILINE|wx.TE_READONLY)
        self.Bind(custom_events.EVT_STATUS_EVENT, self.onStatusEvent)
        if not config.Read("username"):
            self.status_ctrl.AppendText("You need to set your padherder username in Settings\n")
        if not config.Read("password"):
            self.status_ctrl.AppendText("You need to set your padherder password in Settings\n")

        grid.Add(self.status_ctrl, pos=(3,0), span=(1,2))

        if is_out_of_date(self):
            updateCtrl = HyperLinkCtrl(self, wx.ID_ANY, label="An updated version is available", URL="https://github.com/jgoldshlag/padherder_proxy")
            grid.Add(updateCtrl, pos=(4,0), span=(1,2))

        self.SetSizer(grid)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号