• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python version.get_version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中version.get_version函数的典型用法代码示例。如果您正苦于以下问题:Python get_version函数的具体用法?Python get_version怎么用?Python get_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_version函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: create_userguide

def create_userguide():
    from docutils.core import publish_cmdline

    print 'Creating user guide ...'
    ugdir = os.path.dirname(os.path.abspath(__file__))
    sys.path.insert(0, os.path.join(ugdir, '..', '..', 'src', 'robot'))
    from version import get_version
    print 'Version:', get_version()
    vfile = open(os.path.join(ugdir, 'src', 'version.txt'), 'w')
    vfile.write('.. |version| replace:: %s\n' % get_version())
    vfile.close()

    description = 'HTML generator for Robot Framework User Guide.'
    arguments = '''
--time
--stylesheet-path=src/userguide.css
src/RobotFrameworkUserGuide.txt
RobotFrameworkUserGuide.html
'''.split('\n')[1:-1]

    os.chdir(ugdir)
    publish_cmdline(writer_name='html', description=description, argv=arguments)
    os.unlink(vfile.name)
    ugpath = os.path.abspath(arguments[-1])
    print ugpath
    return ugpath, get_version(sep='-')
开发者ID:Senseg,项目名称:robotframework,代码行数:26,代码来源:ug2html.py


示例2: _update_version

def _update_version():
    sys.path.insert(0, os.path.join(CURDIR, '..', '..', 'src', 'robot'))
    from version import get_version
    print 'Version:', get_version()
    with open(os.path.join(CURDIR, 'src', 'version.rst'), 'w') as vfile:
        vfile.write('.. |version| replace:: %s\n' % get_version())
    return get_version(sep='-'), vfile.name
开发者ID:xinmeng2011,项目名称:robotframework,代码行数:7,代码来源:ug2html.py


示例3: do_forgot

def do_forgot(**kw):
    ip = kw['request'].remote_addr
    ctx = kw['context']
    # verify captcha:
    challenge = ctx.get_argument('recaptcha_challenge_field', '')
    response = ctx.get_argument('recaptcha_response_field', '')
    email = ctx.get_argument('email', '')
    user = store.get_user_by_email(email)
    if user is None:
        return {
            '__view__' : 'forgot',
            'email' : email,
            'error' : 'Email is not exist',
            'recaptcha_public_key' : recaptcha.get_public_key(),
            'site' : _get_site_info(),
            'version' : get_version(),
        }
    result, error = recaptcha.verify_captcha(challenge, response, recaptcha.get_private_key(), ip)
    if result:
        token = model.create_reset_password_token(user.id)
        sender = store.get_setting('sender', 'mail', '')
        if not sender:
            raise ApplicationError('Cannot send mail: mail sender address is not configured.')
        appid = kw['environ']['APPLICATION_ID']
        body = r'''Dear %s
  You received this mail because you have requested reset your password.
  Please paste the following link to the address bar of the browser, then press ENTER:
  https://%s.appspot.com/manage/reset?token=%s
''' % (user.nicename, appid, token)
        html = r'''<html>
<body>
<p>Dear %s</p>
<p>You received this mail because you have requested reset your password.<p>
<p>Please paste the following link to reset your password:</p>
<p><a href="https://%s.appspot.com/manage/reset?token=%s">https://%s.appspot.com/manage/reset?token=%s</a></p>
<p>If you have trouble in clicking the URL above, please paste the following link to the address bar of the browser, then press ENTER:</p>
<p>https://%s.appspot.com/manage/reset?token=%s</p>
</body>
</html>
''' % (urllib.quote(user.nicename), appid, token, appid, token, appid, token)
        mail.send(sender, email, 'Reset your password', body, html)
        return {
            '__view__' : 'sent',
            'email' : email,
            'site' : _get_site_info(),
            'version' : get_version(),
    }
    return {
            '__view__' : 'forgot',
            'email' : email,
            'error' : error,
            'recaptcha_public_key' : recaptcha.get_public_key(),
            'site' : _get_site_info(),
            'version' : get_version(),
    }
开发者ID:cng1985,项目名称:express-me,代码行数:55,代码来源:controller.py


示例4: localized_classified_ads_context_processor

def localized_classified_ads_context_processor(request):
    """
    Context processor, used to return version number
    """
    results = {}
    results["version"] = get_version()
    return results
开发者ID:ouhouhsami,项目名称:localized_classified_ads,代码行数:7,代码来源:context_processors.py


示例5: __init_about

    def __init_about(self):
        '''
        Initialize the About notebook page
        '''
        self.__name_version = self.__builder.get_object("NameVersion")
        self.__name_version.set_markup(
            "<big><b>IBus Table %s</b></big>" %version.get_version())

        img_fname = os.path.join(ICON_DIR, "ibus-table.svg")
        if os.path.exists(img_fname):
            img = self.__builder.get_object("image_about")
            img.set_from_file(img_fname)

        # setup table info
        our_engine = None
        for engine in self.__bus.list_engines():
            if engine.get_name() == self.__engine_name:
                our_engine = engine
                break
        if our_engine:
            longname = our_engine.get_longname()
            if not longname:
                longname = our_engine.get_name()
            label = self.__builder.get_object("TableNameVersion")
            label.set_markup("<b>%s</b>" %longname)
            icon_path = our_engine.get_icon()
            if icon_path and os.path.exists(icon_path):
                from gi.repository import GdkPixbuf
                pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(
                    icon_path, -1, 32)
                image = self.__builder.get_object("TableNameImage")
                image.set_from_pixbuf(pixbuf)
开发者ID:mike-fabian,项目名称:ibus-table,代码行数:32,代码来源:main.py


示例6: __init__

	def __init__(cls, dims, project, request, vers=version.get_version()):
		"""
			Initialization of the data object. Creates an object with included metadata
			Inputs:
			cls:   Class Object, Self.
			dims:   A list of the names of the dimensions, the length of indicates the number of dimensions
			project:   Location of project config file (hard location)
			start:   beginning epoch (unix) timestamp
			end:   End epoch timestamp
			dtype:   type of data (source/instrument) being held in this data object
		"""
		# first we will read in the basic information to class attributes
		cls.project = project
		# with some error checking
		cls.start = request.data.begin
		cls.end = request.data.end
		cls.__version = vers
		cls.__dversion = 1.0 # the version of the data object
		
		# now for dims
		if type(dims) == list:
			cls.__dims__ = dims
			cls.__dim_array__ = range(len(dims)) # since dim array will be the same size as dims
			# that was pretty simple
		else:
			print "Dims need to be a list you provide of the name of each dimension"
			return False
		# create a blank levels array
		cls.__levels__ = {}
开发者ID:joeyoun9,项目名称:UUAdip,代码行数:29,代码来源:data.py


示例7: verscheck

	def verscheck(cls, vers=version.get_version()):
		# compare the internal program version to the new program version
		# if it is from an older version, then it may be off
		if not vers == cls.__version:
			return False
		else:
			return True
开发者ID:joeyoun9,项目名称:UUAdip,代码行数:7,代码来源:data.py


示例8: on_command_py2exe

def on_command_py2exe():
    import py2exe

    print "Preparing to build a Windows Executable of Archy."

    print "---------"
    print "NOTICE: If this setup script crashes, you may need to modify"
    print "the 'extra_DLLs' variable inside this script file."
    print "---------"

    excludes = ['AppKit', 'Foundation', 'objc', 'mac_specific', 'wx', 'wxPython']

    includes = ['xml.sax.expatreader']

    packages = ['commands', 'commands.tutorial', 'encodings', 'xml']

    # These are extra DLLs needed by the installer, which
    # modulefinder/py2exe may not be able to find.  These files also
    # aren't included with the CVS distribution of Archy, so they may
    # point to paths that don't exist on your computer!  If this script
    # file crashes, you may have to modify some of these pathnames or
    # place the DLLs in their expected locations.

    extra_DLLs = []

    aspell_files = [
        ("commands/aspell", glob.glob("commands/aspell/*.pyd")),
        ("commands/aspell/data", glob.glob("commands/aspell/data/*.*")),
        ("commands/aspell/dict", glob.glob("commands/aspell/dict/*.*"))
        ]

    setupParams.data_files.append( ("", extra_DLLs) )
    setupParams.data_files.extend( aspell_files )
    
    setupParams.windows = [ { "script": "archy.py", "icon_resources": [(1, "icons/archy.ico")] } ]
    setupParams.options["py2exe"] = \
                                  {"excludes": excludes,
                                   "includes" : includes,
                                   "packages": packages,
                                   "dll_excludes": ["DINPUT8.dll"]}

    # Dynamically generate the InnoSetup installer script.
    
    ISS_DIR = "windows_installer_files"
    ISS_OUT_FILENAME = "archy.iss"
    ISS_IN_FILENAME = "%s.in" % ISS_OUT_FILENAME
    
    print "Generating %s from %s." % (ISS_OUT_FILENAME, ISS_IN_FILENAME)
    f = open(os.path.join(ISS_DIR, ISS_IN_FILENAME), "r")
    text = f.read()
    f.close()

    text = text.replace( "$BUILD$", str(version.get_build_number()) )
    text = text.replace( "$VERSION$", str(version.get_version()) )
    text = """; WARNING: This file is automatically generated by setup.py; if you want to modify it, change %s instead.\n\n""" % (ISS_IN_FILENAME) + text
    
    f = open(os.path.join(ISS_DIR, ISS_OUT_FILENAME), "w")
    f.write(text)
    f.close()
开发者ID:MySheep,项目名称:Archy,代码行数:59,代码来源:setup.py


示例9: test_django_suit

 def test_django_suit(self):
     """
     Test if django suit is plugged and respond with custom settings.
     """
     for language, name in settings.LANGUAGES:
         response = self.app.get('/%s/admin/' % language)
         self.assertEqual(response.status_int, 200)
         response.mustcontain(get_version('normal'), 'w.illi.am')
开发者ID:grangerp,项目名称:test_presentation,代码行数:8,代码来源:production.py


示例10: get

 def get(self):
     template = jinja_environment.get_template('Kalman.html')
     template_values = {
         'head' : cst.head,
         'responseDict': cst.responseDict,
         'version': version.get_version(),
     }
     self.response.out.write(template.render(template_values))
开发者ID:pansuo,项目名称:GAE_Xingzhong,代码行数:8,代码来源:views.py


示例11: show_register

def show_register(**kw):
    google_signin_url = _get_google_signin_url('/manage/g_signin')
    return {
            '__view__' : 'register',
            'error' : '',
            'google_signin_url' : google_signin_url,
            'site' : _get_site_info(),
            'version' : get_version(),
    }
开发者ID:cng1985,项目名称:express-me,代码行数:9,代码来源:controller.py


示例12: show_forgot

def show_forgot():
    return {
            '__view__' : 'forgot',
            'email' : '',
            'error' : '',
            'recaptcha_public_key' : recaptcha.get_public_key(),
            'site' : _get_site_info(),
            'version' : get_version(),
    }
开发者ID:cng1985,项目名称:express-me,代码行数:9,代码来源:controller.py


示例13: __init__

	def __init__(self):
		self.about = gtk.AboutDialog()
		self.about.set_program_name("dewdrop")
		self.about.set_version(version.get_version())
		self.about.set_authors(['Steve Gricci', 'Adam Galloway', 'Uri Herrera'])
		self.about.set_copyright("(c) Steve Gricci")
		self.about.set_comments("dewdrop is an Open Source Droplr client for Linux\n\nThe source code is available: http://github.com/sgricci/dewdrop")
		self.about.set_website("http://dewdrop.deepcode.net")
		self.about.set_logo(gtk.gdk.pixbuf_new_from_file("./windows/resource/icon/dewdrop-128-black.png"))
开发者ID:justasabc,项目名称:python_tutorials,代码行数:9,代码来源:about.py


示例14: report_ticket

    def report_ticket(self, ticket, status, log, plugins=(), dry_run=False, pending_status=None):
        report = {
            'status': status,
            'patches': ticket['patches'],
            'deps': ticket['depends_on'],
            'spkgs': ticket['spkgs'],
            'base': self.base,
            'user': self.config['user'],
            'machine': self.config['machine'],
            'time': datetime(),
            'plugins': plugins,
            'patchbot_version': patchbot_version.get_version(),
        }
        if pending_status:
            report['pending_status'] = pending_status
        try:
            report['base'] = ticket_base = sorted([
                describe_branch('patchbot/base', tag_only=True),
                describe_branch('patchbot/ticket_upstream', tag_only=True)], compare_version)[-1]
            report['git_base'] = self.git_commit('patchbot/base')
            report['git_base_human'] = describe_branch('patchbot/base')
            if ticket['id'] != 0:
                report['git_branch'] = ticket.get('git_branch', None)
                report['git_log'] = subprocess.check_output(['git', 'log', '--oneline', '%s..patchbot/ticket_upstream' % ticket_base]).strip().split('\n')
                # If apply failed, we don't want to be stuck in an infinite loop.
                report['git_commit'] = self.git_commit('patchbot/ticket_upstream')
                report['git_commit_human'] = describe_branch('patchbot/ticket_upstream')
                report['git_merge'] = self.git_commit('patchbot/ticket_merged')
                report['git_merge_human'] = describe_branch('patchbot/ticket_merged')
            else:
                report['git_branch'] = self.config['base_branch']
                report['git_log'] = []
                report['git_commit'] = report['git_merge'] = report['git_base']
        except Exception:
            traceback.print_exc()

        if status != 'Pending':
            history = open("%s/history.txt" % self.log_dir, "a")
            history.write("%s %s %s%s\n" % (
                    datetime(),
                    ticket['id'],
                    status,
                    " dry_run" if dry_run else ""))
            history.close()

        print "REPORT"
        import pprint
        pprint.pprint(report)
        print ticket['id'], status
        fields = {'report': json.dumps(report)}
        if os.path.exists(log):
            files = [('log', 'log', bz2.compress(open(log).read()))]
        else:
            files = []
        if not dry_run or status == 'Pending':
            print post_multipart("%s/report/%s" % (self.server, ticket['id']), fields, files)
开发者ID:fchapoton,项目名称:sage-patchbot,代码行数:56,代码来源:patchbot.py


示例15: version

def version(request):
    """
    release number +  #commit if exists
    """
    version = get_version('normal')
    commit_file = os.path.join(settings.STATIC_ROOT, 'commit.txt')
    if os.path.exists(commit_file):
        commit = open(commit_file, 'r').read()
        version = '%s #%s' % (version, commit)
    return {'version': version}
开发者ID:grangerp,项目名称:test_presentation,代码行数:10,代码来源:context_processors.py


示例16: version

def version(version_number, release_tag=None):
    _verify_version(version_number, VERSIONS)
    if version_number == 'keep':
        _keep_version()
    elif version_number =='trunk':
        _update_version(version_number, '%d%02d%02d' % time.localtime()[:3])
    else:
        _update_version(version_number, _verify_version(release_tag, RELEASES))
    sys.path.insert(0, ROBOT_PATH)
    from version import get_version
    return get_version(sep='')
开发者ID:DiggerPlus,项目名称:robotframework,代码行数:11,代码来源:package.py


示例17: create_userguide

def create_userguide():
    from docutils.core import publish_cmdline

    print 'Creating user guide ...'
    sys.path.insert(0, os.path.join(CURDIR, '..', '..', 'src', 'robot'))
    from version import get_version
    print 'Version:', get_version()
    with open(os.path.join(CURDIR, 'src', 'version.rst'), 'w') as vfile:
        vfile.write('.. |version| replace:: %s\n' % get_version())

    description = 'HTML generator for Robot Framework User Guide.'
    arguments = ['--time',
                 '--stylesheet-path', ['src/userguide.css'],
                 'src/RobotFrameworkUserGuide.rst',
                 'RobotFrameworkUserGuide.html']
    os.chdir(CURDIR)
    publish_cmdline(writer_name='html', description=description, argv=arguments)
    os.unlink(vfile.name)
    ugpath = os.path.abspath(arguments[-1])
    print ugpath
    return ugpath, get_version(sep='-')
开发者ID:DiggerPlus,项目名称:robotframework,代码行数:21,代码来源:ug2html.py


示例18: __init__

	def __init__(self):
		self.about = gtk.AboutDialog()
		self.about.set_program_name("dewdrop")
		self.about.set_version(version.get_version())
		self.about.set_authors(['Steve Gricci', 'Adam Galloway', 'Uri Herrera'])
		self.about.set_copyright("(c) Steve Gricci")
		self.about.set_comments("dewdrop is an Open Source Droplr client for Linux\n\nThe source code is available: http://github.com/sgricci/dewdrop")
		self.about.set_website("http://dewdrop.deepcode.net")
		loader = gtk.gdk.PixbufLoader('png')
		loader.write(pkg_resources.resource_string(__name__, "/resources/icon/dewdrop-128-black.png"))
		loader.close()
		self.about.set_logo(loader.get_pixbuf())
开发者ID:AmieCooper,项目名称:dewdrop,代码行数:12,代码来源:about.py


示例19: setup_version

def setup_version(version=None, ask=False):
    if not version:
        version_info = get_version()
        if ask:
            prompt("Which version: ", default=version_info["version"], key="package_version")
        else:
            env.package_version = version_info["version"]
            env.version_build = version_info["build"]
            env.version_date = version_info["date"]
            env.version_version = version_info["version"]
    else:
        env.package_version = version
开发者ID:pombredanne,项目名称:nexiles.buildtools,代码行数:12,代码来源:nxfab.py


示例20: __init__

	def __init__(self):
		self.about = gtk.AboutDialog()
		self.about.set_program_name("DewDrop")
		self.about.set_version(version.get_version())
		self.about.set_authors(['Steve Gricci', 'Adam Galloway'])
		self.about.set_copyright("(c) Steve Gricci")
		self.about.set_comments("DewDrop is a Droplr client for Linux\n\nApplication Icon used under CC-Attribution-NonCommercial license from http://dapinographics.com")
		self.about.set_website("http://dewdropapp.tumblr.com")
		loader = gtk.gdk.PixbufLoader('png')
		loader.write(pkg_resources.resource_string(__name__, "resources/icons/icon.png"))
		loader.close()
		self.about.set_logo(loader.get_pixbuf())
开发者ID:adamgalloway-nrg,项目名称:dewdrop,代码行数:12,代码来源:about.py



注:本文中的version.get_version函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python version.str函数代码示例发布时间:2022-05-26
下一篇:
Python version.get_git_version函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap