本文整理汇总了Python中Version.AppVerName类的典型用法代码示例。如果您正苦于以下问题:Python AppVerName类的具体用法?Python AppVerName怎么用?Python AppVerName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppVerName类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initTranslation
def initTranslation():
global initTranslationCalled
if not initTranslationCalled:
if six.PY2:
gettext.install(AppVerName.split(None, 1), './locale', unicode=True)
else:
gettext.install(AppVerName.split(None, 1), './locale')
initTranslationCalled = True
示例2: initTranslation
def initTranslation():
global initTranslationCalled
if not initTranslationCalled:
try:
gettext.install(AppVerName.split(None, 1), './locale', unicode=True)
except:
gettext.install(AppVerName.split(None, 1), './locale')
initTranslationCalled = True
示例3: make_inno_version
def make_inno_version():
setup = {
'AppName': AppVerName.split()[0],
'AppPublisher': "Edward Sitarski",
'AppContact': "Edward Sitarski",
'AppCopyright': "Copyright (C) 2004-{} Edward Sitarski".format(datetime.date.today().year),
'AppVerName': AppVerName,
'AppPublisherURL': "http://www.sites.google.com/site/crossmgrsoftware/",
'AppUpdatesURL': "http://www.sites.google.com/site/crossmgrsoftware/downloads/",
'VersionInfoVersion': AppVerName.split()[1],
}
with open('inno_setup.txt', 'w') as f:
for k, v in setup.iteritems():
f.write( '{}={}\n'.format(k,v) )
示例4: removeTabs
#!/usr/bin/env python
import shutil
import os
import io
import sys
import six
import stat
import glob
import datetime
import subprocess
from Version import AppVerName
pypiDir = 'pypi'
version = AppVerName.split(' ')[1]
six.print_( 'version=', version )
def removeTabs( buf, tabStop = 4 ):
# Remove tabs from Python code and preserve formatting.
lines = []
for line in buf.split( '\n' ):
lineOut = []
for c in line:
if c == '\t':
lineOut.append( ' ' )
pad = tabStop - len(lineOut) % tabStop
if pad != tabStop:
lineOut.append( ' ' * pad )
else:
lineOut.append( c )
示例5:
# Create the installer
inno = r'\Program Files\Inno Setup 5\ISCC.exe'
# Find the drive it is installed on.
for drive in ['C', 'D']:
innoTest = drive + ':' + inno
if os.path.exists( innoTest ):
inno = innoTest
break
cmd = '"' + inno + '" ' + 'SeriesMgr.iss'
print cmd
os.system( cmd )
# Create versioned executable.
from Version import AppVerName
vNum = AppVerName.split()[1]
vNum = vNum.replace( '.', '_' )
newExeName = 'SeriesMgr_Setup_v' + vNum + '.exe'
try:
os.remove( 'install\\' + newExeName )
except:
pass
shutil.copy( 'install\\SeriesMgr_Setup.exe', 'install\\' + newExeName )
print 'executable copied to: ' + newExeName
# Create compressed executable.
os.chdir( 'install' )
newExeName = os.path.basename( newExeName )
newZipName = newExeName.replace( '.exe', '.zip' )
示例6: open
'AppVerName': AppVerName,
'AppPublisherURL': "http://www.sites.google.com/site/crossmgrsoftware/",
'AppUpdatesURL': "http://www.sites.google.com/site/crossmgrsoftware/downloads/",
'VersionInfoVersion': AppVerName.split()[1],
}
with open('inno_setup.txt', 'w') as f:
for k, v in six.iteritems(setup):
f.write( '{}={}\n'.format(k,v) )
make_inno_version()
cmd = '"' + inno + '" ' + 'SeriesMgr.iss'
six.print_( cmd )
os.system( cmd )
# Create versioned executable.
from Version import AppVerName
vNum = AppVerName.split()[1].replace( '.', '_' )
newExeName = 'SeriesMgr_Setup_v' + vNum + '.exe'
try:
os.remove( os.path.join('install',newExeName) )
except:
pass
shutil.copy( os.path.join('install', 'SeriesMgr_Setup.exe'), os.path.join('install', newExeName) )
six.print_( 'executable copied to: ' + newExeName )
# Create compressed executable.
os.chdir( 'install' )
newExeName = os.path.basename( newExeName )
newZipName = newExeName.replace( '.exe', '.zip' )
示例7: __init__
def __init__( self, parent, id = wx.ID_ANY, title='', size=(1000,800) ):
wx.Frame.__init__(self, parent, id, title, size=size)
self.fps = 25
self.frameDelay = 1.0 / self.fps
self.bufferSecs = 10
self.tFrameCount = self.tLaunch = self.tLast = now()
self.frameCount = 0
self.frameCountUpdate = self.fps * 2
self.fpsActual = 0.0
self.fpt = timedelta(seconds=0)
self.fcb = FrameCircBuf( self.bufferSecs * self.fps )
self.config = wx.Config(appName="CrossMgrCamera",
vendorName="SmartCyclingSolutions",
#style=wx.CONFIG_USE_LOCAL_FILE
)
self.requestQ = Queue() # Select photos from photobuf.
self.writerQ = Queue( 400 ) # Selected photos waiting to be written out.
self.ftpQ = Queue() # Photos waiting to be ftp'd.
self.renamerQ = Queue() # Photos waiting to be renamed and possibly ftp'd.
self.messageQ = Queue() # Collection point for all status/failure messages.
self.SetBackgroundColour( wx.Colour(232,232,232) )
mainSizer = wx.BoxSizer( wx.VERTICAL )
self.primaryImage = ScaledImage( self, style=wx.BORDER_SUNKEN, size=(imageWidth, imageHeight) )
self.beforeImage = ScaledImage( self, style=wx.BORDER_SUNKEN, size=(imageWidth, imageHeight) )
self.afterImage = ScaledImage( self, style=wx.BORDER_SUNKEN, size=(imageWidth, imageHeight) )
self.beforeAfterImages = [self.beforeImage, self.afterImage]
#------------------------------------------------------------------------------------------------
headerSizer = wx.BoxSizer( wx.HORIZONTAL )
self.logo = Utils.GetPngBitmap('CrossMgrHeader.png')
headerSizer.Add( wx.StaticBitmap(self, wx.ID_ANY, self.logo) )
self.title = wx.StaticText(self, label='CrossMgr Camera\nVersion {}'.format(AppVerName.split()[1]), style=wx.ALIGN_RIGHT )
self.title.SetFont( wx.Font( (0,28), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL ) )
headerSizer.Add( self.title, flag=wx.ALL, border=10 )
#------------------------------------------------------------------------------
self.cameraDeviceLabel = wx.StaticText(self, label='Camera Device:')
self.cameraDevice = wx.StaticText( self )
boldFont = self.cameraDevice.GetFont()
boldFont.SetWeight( wx.BOLD )
self.cameraDevice.SetFont( boldFont )
self.cameraResolution = wx.StaticText( self )
self.cameraResolution.SetFont( boldFont )
bitmap = wx.Bitmap( clipboard_xpm )
self.copyLogToClipboard = wx.BitmapButton( self, bitmap=bitmap )
self.copyLogToClipboard.Bind( wx.EVT_BUTTON, self.onCopyLogToClipboard )
self.reset = wx.Button( self, label="Reset Camera" )
self.reset.Bind( wx.EVT_BUTTON, self.resetCamera )
cameraDeviceSizer = wx.BoxSizer( wx.HORIZONTAL )
cameraDeviceSizer.Add( self.cameraDeviceLabel, flag=wx.ALIGN_CENTRE_VERTICAL|wx.ALIGN_RIGHT )
cameraDeviceSizer.Add( self.cameraDevice, flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=8 )
cameraDeviceSizer.Add( self.cameraResolution, flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=8 )
cameraDeviceSizer.Add( self.copyLogToClipboard, flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=8 )
cameraDeviceSizer.Add( self.reset, flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=24 )
#------------------------------------------------------------------------------
self.targetProcessingTimeLabel = wx.StaticText(self, label='Target Frames:')
self.targetProcessingTime = wx.StaticText(self, label=u'{:.3f}'.format(self.fps))
self.targetProcessingTime.SetFont( boldFont )
self.targetProcessingTimeUnit = wx.StaticText(self, label='per sec')
self.framesPerSecondLabel = wx.StaticText(self, label='Actual Frames:')
self.framesPerSecond = wx.StaticText(self, label='25.000')
self.framesPerSecond.SetFont( boldFont )
self.framesPerSecondUnit = wx.StaticText(self, label='per sec')
self.availableMsPerFrameLabel = wx.StaticText(self, label='Available Time Per Frame:')
self.availableMsPerFrame = wx.StaticText(self, label=u'{:.0f}'.format(1000.0*self.frameDelay))
self.availableMsPerFrame.SetFont( boldFont )
self.availableMsPerFrameUnit = wx.StaticText(self, label='ms')
self.frameProcessingTimeLabel = wx.StaticText(self, label='Actual Frame Processing:')
self.frameProcessingTime = wx.StaticText(self, label='20')
self.frameProcessingTime.SetFont( boldFont )
self.frameProcessingTimeUnit = wx.StaticText(self, label='ms')
pfgs = wx.FlexGridSizer( rows=0, cols=6, vgap=4, hgap=8 )
fRight = wx.ALIGN_CENTRE_VERTICAL|wx.ALIGN_RIGHT
fLeft = wx.ALIGN_CENTRE_VERTICAL
#------------------- Row 1 ------------------------------
pfgs.Add( self.targetProcessingTimeLabel, flag=fRight )
pfgs.Add( self.targetProcessingTime, flag=fRight )
pfgs.Add( self.targetProcessingTimeUnit, flag=fLeft )
pfgs.Add( self.availableMsPerFrameLabel, flag=fRight )
pfgs.Add( self.availableMsPerFrame, flag=fRight )
pfgs.Add( self.availableMsPerFrameUnit, flag=fLeft )
#------------------- Row 2 ------------------------------
pfgs.Add( self.framesPerSecondLabel, flag=fRight )
#.........这里部分代码省略.........
示例8:
platform = 'Linux'
six.print_( 'Copying help, template and image files into the build folder...' )
resourceDirs = ['CrossMgrHtml', 'CrossMgrHtmlDoc', 'CrossMgrHelpIndex', 'CrossMgrImages']
dest = os.path.join('CrossMgrBuild', 'dist', 'CrossMgr')
for d in resourceDirs:
shutil.copytree( d, os.path.join(dest, d) )
if platform == 'OSX':
dest = os.path.join('CrossMgrBuild', 'CrossMgr.app', 'Contents', 'Resources')
for d in resourceDirs:
shutil.copytree( d, os.path.join(dest, d) )
# Check if 32 or 64 bit.
import struct
bits = '{}bit'.format( struct.calcsize("P") * 8 )
from Version import AppVerName
fname = platform + '_' + bits + '_' + AppVerName.replace(' ', '_') + '.tar.gz'
fname = os.path.join( 'CrossMgrBuild', fname )
six.print_( 'Combining and compressing the build directory...' )
import tarfile
tr = tarfile.open( fname, 'w:gz' )
tr.add( dest, 'CrossMgr' )
tr.close()
six.print_( 'Created:', fname )
six.print_( 'Done.' )
示例9: __init__
def __init__( self, parent, id = wx.ID_ANY, title='', size=(1000,800) ):
wx.Frame.__init__(self, parent, id, title, size=size)
self.db = Database()
self.bufferSecs = 10
self.setFPS( 30 )
self.xFinish = None
self.tFrameCount = self.tLaunch = self.tLast = now()
self.frameCount = 0
self.fpt = timedelta(seconds=0)
self.iTriggerSelect = None
self.triggerInfo = None
self.tsMax = None
self.captureTimer = wx.CallLater( 10, self.stopCapture )
self.tdCaptureBefore = tdCaptureBeforeDefault
self.tdCaptureAfter = tdCaptureAfterDefault
self.config = wx.Config()
self.requestQ = Queue() # Select photos from photobuf.
self.dbWriterQ = Queue() # Photos waiting to be written
self.messageQ = Queue() # Collection point for all status/failure messages.
self.SetBackgroundColour( wx.Colour(232,232,232) )
self.focusDialog = FocusDialog( self )
self.photoDialog = PhotoDialog( self )
self.autoCaptureDialog = AutoCaptureDialog( self )
self.triggerDialog = TriggerDialog( self )
mainSizer = wx.BoxSizer( wx.VERTICAL )
#------------------------------------------------------------------------------------------------
headerSizer = wx.BoxSizer( wx.HORIZONTAL )
self.logo = Utils.GetPngBitmap('CrossMgrHeader.png')
headerSizer.Add( wx.StaticBitmap(self, wx.ID_ANY, self.logo) )
self.title = wx.StaticText(self, label='CrossMgr Video\nVersion {}'.format(AppVerName.split()[1]), style=wx.ALIGN_RIGHT )
self.title.SetFont( wx.Font( (0,28), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL ) )
headerSizer.Add( self.title, flag=wx.ALL, border=10 )
clock = Clock( self, size=(90,90) )
clock.SetBackgroundColour( self.GetBackgroundColour() )
clock.Start()
headerSizer.Add( clock, flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, border=4 )
#------------------------------------------------------------------------------
self.cameraDevice = wx.StaticText( self )
self.cameraResolution = wx.StaticText( self )
self.targetFPS = wx.StaticText( self, label='30 fps' )
self.actualFPS = wx.StaticText( self, label='30.0 fps' )
boldFont = self.cameraDevice.GetFont()
boldFont.SetWeight( wx.BOLD )
for w in (self.cameraDevice, self.cameraResolution, self.targetFPS, self.actualFPS):
w.SetFont( boldFont )
fgs = wx.FlexGridSizer( 2, 2, 2 ) # 2 Cols
fgs.Add( wx.StaticText(self, label='Camera Device:'), flag=wx.ALIGN_RIGHT )
fgs.Add( self.cameraDevice )
fgs.Add( wx.StaticText(self, label='Resolution:'), flag=wx.ALIGN_RIGHT )
fgs.Add( self.cameraResolution )
fgs.Add( wx.StaticText(self, label='Target:'), flag=wx.ALIGN_RIGHT )
fgs.Add( self.targetFPS, flag=wx.ALIGN_RIGHT )
fgs.Add( wx.StaticText(self, label='Actual:'), flag=wx.ALIGN_RIGHT )
fgs.Add( self.actualFPS, flag=wx.ALIGN_RIGHT )
self.focus = wx.Button( self, label="Focus..." )
self.focus.Bind( wx.EVT_BUTTON, self.onFocus )
self.reset = wx.Button( self, label="Reset Camera" )
self.reset.Bind( wx.EVT_BUTTON, self.resetCamera )
self.manage = wx.Button( self, label="Manage Database" )
self.manage.Bind( wx.EVT_BUTTON, self.manageDatabase )
self.autoCaptureBtn = wx.Button( self, label="Config Auto Capture" )
self.autoCaptureBtn.Bind( wx.EVT_BUTTON, self.autoCaptureConfig )
self.help = wx.Button( self, wx.ID_HELP )
self.help.Bind( wx.EVT_BUTTON, self.onHelp )
self.snapshot, self.autoCapture, self.capture = CreateCaptureButtons( self )
self.snapshot.Bind( wx.EVT_LEFT_DOWN, self.onStartSnapshot )
self.focusDialog.snapshot.Bind( wx.EVT_LEFT_DOWN, self.onStartSnapshot )
self.autoCapture.Bind( wx.EVT_LEFT_DOWN, self.onStartAutoCapture )
self.focusDialog.autoCapture.Bind( wx.EVT_LEFT_DOWN, self.onStartAutoCapture )
self.capture.Bind( wx.EVT_LEFT_DOWN, self.onStartCapture )
self.capture.Bind( wx.EVT_LEFT_UP, self.onStopCapture )
self.focusDialog.capture.Bind( wx.EVT_LEFT_DOWN, self.onStartCapture )
#.........这里部分代码省略.........
示例10: application
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import biplist
import os.path
import os.path, sys
sys.path.append(os.path.dirname('.'))
from Version import AppVerName
MacApp = AppVerName.split(' ')[0]
MacAppVersion = AppVerName.split(' ')[1]
MacAppFullName = MacApp + '_' + MacAppVersion
print("Mac App Version:", MacAppVersion)
#
# Example settings file for dmgbuild
#
# Full docs are at http://dmgbuild.readthedocs.io/en/latest/
# Use like this: dmgbuild -s settings.py "Test Volume" test.dmg
# You can actually use this file for your own application (not just TextEdit)
# by doing e.g.
#
# dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg
# .. Useful stuff ..............................................................
application = defines.get('app', 'dist/' + MacApp + '.app')
appname = os.path.basename(application)