ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:20.23KB ,
资源ID:2408379      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/2408379.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(基于esky实现python应用的自动升级.docx)为本站会员(b****1)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

基于esky实现python应用的自动升级.docx

1、基于esky实现python应用的自动升级基于esky实现python应用的自动升级一、esky介绍Esky is an auto-update framework for frozen Python applications. It provides a simple API through which apps can find, fetch and install updates, and a bootstrapping mechanism that keeps the app safe in the face of failed or partial updates. Updates

2、can also be sent as differential patches.Esky is currently capable of freezing apps with py2exe, py2app, cxfreeze and bbfreeze. Adding support for other freezer programs should be easy; patches will be gratefully accepted.We are tested and running on Python 2.7 Py2app will work on python3 fine, the

3、other freezers not so much.Esky是一个python编译程序的自动升级框架,提供简单的api实现应用的自动更新(包括比较版本、更新版本),esky支持py2exe,py2app,cxfreeze以及bbfreeze等多种python打包框架。二、esky安装及说明1、pip安装pip install esky2、esky说明3、esky教学视频http:/pyvideo.org/pycon-au-2010/pyconau-2010-esky-keep-your-frozen-apps-fresh.html三、esky用法示例esky用起来比较简单,我们这里以常用的基

4、于wx的windows应用举例。wxpython下有个wx.lib.softwareupdate 类,对wxpython应用的esky升级进行了二次封装。网上有个现成的示范例子,具体网址:http:/www.blog.pythonlibrary.org/2013/07/12/wxpython-updating-your-application-with-esky/代码很简单,对其中的关键部分进行注释说明(红色字体部分):复制代码# -# image_viewer2.py# Created 03-20-2010# Author: Mike Driscoll# -import globimport

5、 osimport wxfrom wx.lib.pubsub import setuparg1 from wx.lib.pubsub import pub as Publisher #申明语句from wx.lib.softwareupdate import SoftwareUpdateimport version#class ViewerPanel(wx.Panel): #- def _init_(self, parent): Constructor wx.Panel._init_(self, parent) width, height = wx.DisplaySize() self.pic

6、Paths = self.currentPicture = 0 self.totalPictures = 0 self.photoMaxSize = height - 200 Publisher.subscribe(self.updateImages, (update images) self.slideTimer = wx.Timer(None) self.slideTimer.Bind(wx.EVT_TIMER, self.update) self.layout() #- def layout(self): Layout the widgets on the panel self.main

7、Sizer = wx.BoxSizer(wx.VERTICAL) btnSizer = wx.BoxSizer(wx.HORIZONTAL) img = wx.EmptyImage(self.photoMaxSize,self.photoMaxSize) self.imageCtrl = wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(img) self.mainSizer.Add(self.imageCtrl, 0, wx.ALL|wx.CENTER, 5) self.imageLabel = wx.StaticText(self, l

8、abel=) self.mainSizer.Add(self.imageLabel, 0, wx.ALL|wx.CENTER, 5) btnData = (Previous, btnSizer, self.onPrevious), (Slide Show, btnSizer, self.onSlideShow), (Next, btnSizer, self.onNext) for data in btnData: label, sizer, handler = data self.btnBuilder(label, sizer, handler) self.mainSizer.Add(btnS

9、izer, 0, wx.CENTER) self.SetSizer(self.mainSizer) #- def btnBuilder(self, label, sizer, handler): Builds a button, binds it to an event handler and adds it to a sizer btn = wx.Button(self, label=label) btn.Bind(wx.EVT_BUTTON, handler) sizer.Add(btn, 0, wx.ALL|wx.CENTER, 5) #- def loadImage(self, ima

10、ge): image_name = os.path.basename(image) img = wx.Image(image, wx.BITMAP_TYPE_ANY) # scale the image, preserving the aspect ratio W = img.GetWidth() H = img.GetHeight() if W H: NewW = self.photoMaxSize NewH = self.photoMaxSize * H / W else: NewH = self.photoMaxSize NewW = self.photoMaxSize * W / H

11、img = img.Scale(NewW,NewH) self.imageCtrl.SetBitmap(wx.BitmapFromImage(img) self.imageLabel.SetLabel(image_name) self.Refresh() Publisher.sendMessage(resize, ) #- def nextPicture(self): Loads the next picture in the directory if self.currentPicture = self.totalPictures-1: self.currentPicture = 0 els

12、e: self.currentPicture += 1 self.loadImage(self.picPathsself.currentPicture) #- def previousPicture(self): Displays the previous picture in the directory if self.currentPicture = 0: self.currentPicture = self.totalPictures - 1 else: self.currentPicture -= 1 self.loadImage(self.picPathsself.currentPicture) #- def update(self, event): Called when the slideTimers timer event fires. Loads the next picture from the folder by calling th nextPicture method self.nextPicture() #- def updateImages(self, msg): Updates the picPaths list to contain the current folder

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1