当前位置: 首页>>代码示例>>Python>>正文


Python profile.Profile类代码示例

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


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

示例1: callback_audio

def callback_audio(toxav, friend_number, samples, audio_samples_per_channel, audio_channels_count, rate, user_data):
    """New audio chunk"""
    print audio_samples_per_channel, audio_channels_count, rate
    Profile.get_instance().call.chunk(
        ''.join(chr(x) for x in samples[:audio_samples_per_channel * 2 * audio_channels_count]),
        audio_channels_count,
        rate)
开发者ID:SergeyDjam,项目名称:toxygen,代码行数:7,代码来源:callbacks.py

示例2: fetch_profile

def fetch_profile (profileId):
    profile = Profile(str(profileId))
    playerPage = get_full_page_stats(profile.hotslogsId)
    profile.heroes = get_heroes_stats(playerPage)
    profile.maps = get_map_stats(playerPage)
    profile.enemies = get_winrates_against_heroes(playerPage)
    return profile.toJSON()
开发者ID:johnsoe,项目名称:HotsAnalysis,代码行数:7,代码来源:fetchprofile.py

示例3: attach

    def attach (self, bockbuild):
        Profile.attach (self, bockbuild)

        self.name = 'unix'
        self.env = Environment(self)
        self.staged_prefix = bockbuild.staged_prefix 
        self.toolchain_root = bockbuild.toolchain_root

        self.gcc_flags = ['-I%s/include' % self.staged_prefix]
        self.ld_flags = ['-L%s/lib' % self.staged_prefix]

        self.env.set('BUILD_PREFIX', '%{prefix}')

        self.env.set('PATH', ':',
                     '%{toolchain_root}/bin',
                     '%{staged_prefix}/bin',
                     '/usr/bin',
                     '/bin',
                     '/usr/local/git/bin')

        self.env.set('C_INCLUDE_PATH',  '%{staged_prefix}/include')

        #self.env.set ('LD_LIBRARY_PATH', '%{staged_prefix}/lib')

        self.env.set('ACLOCAL_FLAGS',   '-I%{staged_prefix}/share/aclocal')
        self.env.set('PKG_CONFIG_PATH', ':',
                     '%{staged_prefix}/lib/pkgconfig',
                     '%{staged_prefix}/share/pkgconfig',
                     '%{toolchain_root}/lib/pkgconfig',
                     '%{toolchain_root}/share/pkgconfig')

        self.env.set('XDG_CONFIG_DIRS', '%{staged_prefix}/etc/xdg')
        self.env.set('XDG_DATA_DIRS',   '%{staged_prefix}/share')
        self.env.set('XDG_CONFIG_HOME', '$HOME/.config')
开发者ID:,项目名称:,代码行数:34,代码来源:

示例4: __init__

	def __init__ (self, prefix = False):
		Profile.__init__ (self, prefix)
		self.name = 'unix'

		self.gcc_flags = ['-I%s/include' % self.staged_prefix]
		self.ld_flags = ['-L%s/lib' % self.staged_prefix]

		self.env.set ('PATH', ':',
			'%{toolchain_root}/bin',
			'%{staged_prefix}/bin',
			'/usr/bin',
			'/bin',
			'/usr/local/git/bin')

		self.env.set ('C_INCLUDE_PATH',  '%{staged_prefix}/include')

		#self.env.set ('LD_LIBRARY_PATH', '%{staged_prefix}/lib')

		self.env.set ('ACLOCAL_FLAGS',   '-I%{staged_prefix}/share/aclocal')
		self.env.set ('PKG_CONFIG_PATH', ':',
			'%{staged_prefix}/lib/pkgconfig',
			'%{staged_prefix}/share/pkgconfig',
			'%{toolchain_root}/lib/pkgconfig',
			'%{toolchain_root}/share/pkgconfig')

		self.env.set ('XDG_CONFIG_DIRS', '%{staged_prefix}/etc/xdg')
		self.env.set ('XDG_DATA_DIRS',   '%{staged_prefix}/share')
		self.env.set ('XDG_CONFIG_HOME', '$HOME/.config')
开发者ID:alexanderkyte,项目名称:bockbuild,代码行数:28,代码来源:unixprofile.py

示例5: set_avatar

 def set_avatar(self):
     name = QtGui.QFileDialog.getOpenFileName(self, 'Open file', None, 'Image Files (*.png)')
     print name
     if name[0]:
         with open(name[0], 'rb') as f:
             data = f.read()
         Profile.get_instance().set_avatar(data)
开发者ID:SergeyDjam,项目名称:toxygen,代码行数:7,代码来源:menu.py

示例6: Login

class Login(flask.views.MethodView):
	def __init__(self):
		self.users = Users()
		self.profile = Profile()

	def get(self):
		if 'email' in session:
			return self.profile.get()
		else:
			return flask.render_template('login.html')

	def post(self):
		
		print request.form['username']
		session['email'] = request.form['username']
		success = self.users.loginCheck(request.form['username'],request.form['password'])
		print success
		if(success):
			#r = requests.get('http://localhost/profile')
			return self.profile.get()

			#Response(
			#	r.text,
			#	status=r.status_code,
			#	content_type=r.headers['content-type'],
			#	)
		else:
			return flask.render_template('login.html')
开发者ID:RaghavRamesh,项目名称:Kwest-Hack-n-Roll,代码行数:28,代码来源:login.py

示例7: search

 def search(self):
     Profile.get_instance().update()
     text = self.search_text.text()
     friend = Profile.get_instance().get_curr_friend()
     if text and friend and util.is_re_valid(text):
         index = friend.search_string(text)
         self.load_messages(index)
开发者ID:limalayla,项目名称:toxygen,代码行数:7,代码来源:mainscreen_widgets.py

示例8: __init__

	def __init__ (self, prefix = False):
		Profile.__init__ (self, prefix)
		self.name = 'unix'

		self.gcc_flags = [ '-I%{prefix}/include' ]
		self.ld_flags = [ '-L%{prefix}/lib' ]

		try:
			self.gcc_flags.extend (self.gcc_extra_flags)
		except:
			pass

		try:
			self.ld_flags.extend (self.ld_extra_flags)
		except:
			pass

		self.env.set ('PATH', ':',
			'%{prefix}/bin',
			'/usr/bin',
			'/bin',
			'/usr/local/git/bin')

		self.env.set ('C_INCLUDE_PATH',  '%{prefix}/include')

		self.env.set ('LD_LIBRARY_PATH', '%{prefix}/lib')

		self.env.set ('ACLOCAL_FLAGS',   '-I%{prefix}/share/aclocal')
		self.env.set ('PKG_CONFIG_PATH', ':',
			'%{prefix}/lib/pkgconfig',
			'%{prefix}/share/pkgconfig')

		self.env.set ('XDG_CONFIG_DIRS', '%{prefix}/etc/xdg')
		self.env.set ('XDG_DATA_DIRS',   '%{prefix}/share')
		self.env.set ('XDG_CONFIG_HOME', '$HOME/.config')
开发者ID:BansheeMediaPlayer,项目名称:bockbuild,代码行数:35,代码来源:unixprofile.py

示例9: _exec_main

def _exec_main(parser, values):
    sconsflags = os.environ.get('SCONSFLAGS', '')
    all_args = sconsflags.split() + sys.argv[1:]

    options, args = parser.parse_args(all_args, values)

    if isinstance(options.debug, list) and "pdb" in options.debug:
        import pdb
        pdb.Pdb().runcall(_main, parser)
    elif options.profile_file:
        # compat layer imports "cProfile" for us if it's available.
        from profile import Profile

        # Some versions of Python 2.4 shipped a profiler that had the
        # wrong 'c_exception' entry in its dispatch table.  Make sure
        # we have the right one.  (This may put an unnecessary entry
        # in the table in earlier versions of Python, but its presence
        # shouldn't hurt anything).
        try:
            dispatch = Profile.dispatch
        except AttributeError:
            pass
        else:
            dispatch['c_exception'] = Profile.trace_dispatch_return

        prof = Profile()
        try:
            prof.runcall(_main, parser)
        except SConsPrintHelpException, e:
            prof.dump_stats(options.profile_file)
            raise e
        except SystemExit:
            pass
开发者ID:ballacky13,项目名称:Nuitka,代码行数:33,代码来源:Main.py

示例10: read_profile

def read_profile(file_name):
    f = open(file_name, "r")
    profile = Profile()
    for line in f:
        profile.process_sample(line)

    return profile
开发者ID:TaYpworm,项目名称:basic-profiler,代码行数:7,代码来源:basic_profile_processor.py

示例11: call_state

def call_state(toxav, friend_number, mask, user_data):
    """New call state"""
    print friend_number, mask
    if mask == TOXAV_FRIEND_CALL_STATE['FINISHED'] or mask == TOXAV_FRIEND_CALL_STATE['ERROR']:
        invoke_in_main_thread(Profile.get_instance().stop_call, friend_number, True)
    else:
        Profile.get_instance().call.toxav_call_state_cb(friend_number, mask)
开发者ID:SergeyDjam,项目名称:toxygen,代码行数:7,代码来源:callbacks.py

示例12: unblock_user

 def unblock_user(self):
     if not self.comboBox.count():
         return
     title = QtGui.QApplication.translate("privacySettings", "Add to friend list", None, QtGui.QApplication.UnicodeUTF8)
     info = QtGui.QApplication.translate("privacySettings", "Do you want to add this user to friend list?", None, QtGui.QApplication.UnicodeUTF8)
     reply = QtGui.QMessageBox.question(None, title, info, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
     Profile.get_instance().unblock_user(self.comboBox.currentText(), reply == QtGui.QMessageBox.Yes)
     self.close()
开发者ID:SergeyDjam,项目名称:toxygen,代码行数:8,代码来源:menu.py

示例13: __init__

	def __init__(self, name, CertClass):
		Profile.__init__(self, name, CertClass)
		self._certs_by_subj.set_filename("users/"+str(name)+"/certs.subj")
		self._certs_by_issuer.set_filename("users/"+str(name)+"/certs.issuer")

		# overload meaning of FileCertifications here to store user-profile.
		self.info = FileCertifications()
		self.info.set_filename("users/"+str(name)+"/profile")
开发者ID:SuperbBob,项目名称:trust-metrics,代码行数:8,代码来源:file_certs.py

示例14: callback_audio

def callback_audio(toxav, friend_number, samples, audio_samples_per_channel, audio_channels_count, rate, user_data):
    """
    New audio chunk
    """
    Profile.get_instance().call.chunk(
        bytes(samples[:audio_samples_per_channel * 2 * audio_channels_count]),
        audio_channels_count,
        rate)
开发者ID:limalayla,项目名称:toxygen,代码行数:8,代码来源:callbacks.py

示例15: get_ep_profile

def get_ep_profile( profiledb, edgepayload ):
    combiner = Profile()
    
    streets = unpack_streets( edgepayload )
    for street in streets:
        combiner.add( get_street_profile(profiledb, street) )

    return combiner.concat() #reduce( lambda x,y:x+y, profile )
开发者ID:bmander,项目名称:gstrip,代码行数:8,代码来源:shortcut_cache.py


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