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


Python MappingId.mapping_host_with_scheme方法代码示例

本文整理汇总了Python中myapp.MappingId.MappingId.mapping_host_with_scheme方法的典型用法代码示例。如果您正苦于以下问题:Python MappingId.mapping_host_with_scheme方法的具体用法?Python MappingId.mapping_host_with_scheme怎么用?Python MappingId.mapping_host_with_scheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myapp.MappingId.MappingId的用法示例。


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

示例1: create_user_object

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def create_user_object(req,one):
		#if(one.icon):
		icon_url=MappingId.mapping_host_with_scheme(req.request)+"/show_icon?key="+one.user_id
		#else:
		#	icon_url=MappingId.mapping_host_with_scheme(req.request)+"/static_files/empty_user.png"
		profile_url=MappingId.mapping_host_with_scheme(req.request)+"/mypage?user_id="+one.user_id
		name=one.name
		if(not name):
			name="noname"
		one_dic={"user_id":one.user_id,"name":name,"homepage":one.homepage,"icon_url":icon_url,"profile_url":profile_url}
		return one_dic
开发者ID:abars,项目名称:illustbook,代码行数:13,代码来源:ApiObject.py

示例2: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		SetUtf8.set()
		
		data=""

		user = users.get_current_user()
		user_id="";
		if(user):
			user_id=user.user_id()
		
		is_iphone=CssDesign.is_iphone(self)
		is_mobile=is_iphone or CssDesign.is_tablet(self)
		app_key=ApiPerpetuation.get_app_key(self)

		host_url=MappingId.mapping_host_with_scheme(self.request)+"/";

		template_values = {
			'host': host_url,
			'user_id': user_id,
			'is_mobile': is_mobile,
			'is_iphone': is_iphone,
			'app_key': app_key
		}

		self.response.content_type = 'text/javascript'
		path = "/html/api/illustbook.js"
		self.response.out.write(template_select.render(path, template_values))
开发者ID:abars,项目名称:illustbook,代码行数:29,代码来源:ApiJs.py

示例3: _get_bbs_url

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def _get_bbs_url(req,bbs):
		if(req):
			bbs_url=MappingId.mapping_host_with_scheme(req.request)+"/"
		else:
			bbs_url="."
		if(bbs.short):
			bbs_url+=bbs.short+"/"
		else:
			bbs_url+="usr/"+str(bbs.key())+"/"
		return bbs_url
开发者ID:abars,项目名称:illustbook,代码行数:12,代码来源:ApiObject.py

示例4: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		try:
			bbs=db.get(self.request.get("bbs_key"))
		except:
			bbs=None
		if(bbs==None):
			Alert.alert_msg_notfound(self)
			return			
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/";
		url=MappingId.get_usr_url(host_url,bbs)
		self.redirect(str(url))
开发者ID:abars,项目名称:illustbook,代码行数:13,代码来源:RedirectBbs.py

示例5: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"
		page = 1
		if(self.request.get("page")):
			page=int(self.request.get("page"))
		
		template_values = {
		'host': host_url,
		'page': page
		}		  
		path = '/html/comic.html'
		self.response.out.write(template_select.render(path, template_values))
开发者ID:abars,项目名称:illustbook,代码行数:14,代码来源:Comic.py

示例6: _render_page

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def _render_page(self,template_values):
		host=MappingId.mapping_host_with_scheme(self.request)+"/";
		template_values['host']=host
		template_values['is_iphone']=CssDesign.is_iphone(self)
		template_values['is_tablet']=CssDesign.is_tablet(self)
		template_values['tag_display_n']=40
		template_values['is_maintenance']=MaintenanceCheck.is_appengine_maintenance()
		if(template_values['user']):
			template_values['login_flag']=1
		else:
			template_values['login_flag']=0
		render=template_select.render("/html/pinterest.html", template_values)
		#render=strip_spaces_between_tags(render)
		self.response.out.write(render)
开发者ID:abars,项目名称:illustbook,代码行数:16,代码来源:Pinterest.py

示例7: post

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def post(self,mode_url):
		mode=self.request.get("mode")

		user = users.get_current_user()
		if(not user):
			Alert.alert_msg_with_write(self,"ログインが必要です。")
			return

		msg=""

		if(mode=="add"):
			if(Event.all().filter("id =",self.request.get("id")).count()>=1):
				Alert.alert_msg_with_write(self,"このIDのイベントは既に存在しています")
				return
			
			event=Event()
			if(not self._update(event,user,True,True)):
				return
			event.put()

		if(mode=="edit"):
			event=Event.all().filter("id =",self.request.get("id")).fetch(limit=2)
			if(not event or len(event)==0):
				Alert.alert_msg_with_write(self,"イベントが存在しません")
				return
			if(len(event)>=2):
				Alert.alert_msg_with_write(self,"イベントが重複しています")
				return
			event=event[0]
			if(not self._update(event,user,True,False)):
				return
			event.put()

		if(mode=="del"):
			event=Event.all().filter("id =",self.request.get("id")).fetch(limit=2)
			if(not event or len(event)==0):
				Alert.alert_msg_with_write(self,"イベントが存在しません")
				return
			event[0].delete()

		host=MappingId.mapping_host_with_scheme(self.request)+"/"

		if(mode=="del"):
			self.redirect(str(host+"?order=event"))
		else:
			self.redirect(str(host+"?order=event&event_id="+event.id))
开发者ID:abars,项目名称:illustbook,代码行数:48,代码来源:EventList.py

示例8: create_bbs_object

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def create_bbs_object(req,bbs):
		if(not bbs):
			return None
	
		bookmark_cnt=0
		if(bbs.bookmark_count):
			bookmark_cnt=bbs.bookmark_count

		bbs_url=ApiObject._get_bbs_url(req,bbs)
		
		thumbnail_url=""
		if(bbs.cached_thumbnail_key and not bbs.del_flag):
			thumbnail_url=MappingId.mapping_host_with_scheme(req.request)+"/thumbnail/"+bbs.cached_thumbnail_key+".jpg"

		summary=ApiObject.truncate_html(bbs.summary,20)

		one_dic={"title":bbs.bbs_name,"summary":summary,"bbs_url":bbs_url,"bookmark":bookmark_cnt,"key":str(bbs.key()),"thumbnail_url":thumbnail_url,"mode":bbs.bbs_mode}
		return one_dic
开发者ID:abars,项目名称:illustbook,代码行数:20,代码来源:ApiObject.py

示例9: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"
		bbs_key=self.request.get("bbs_key")
		thread_key=self.request.get("thread_key")

		try:
			bbs = db.get(self.request.get("bbs_key"))
			thread = db.get(self.request.get("thread_key"))
		except:
			bbs = None
			thread = None
		
		if(bbs==None or thread==None):
			self.response.out.write(Alert.alert_msg("スレッドが見つかりません。",self.request.host))
			return
		
		image=thread.image_key#db.get(thread.image);
		width=400
		height=400
		if(image.width):
			width=image.width
		if(image.height):
			height=image.height
		if(self.request.get("width")):
			width=self.request.get("width")
		if(self.request.get("height")):
			height=self.request.get("height")
		
		if(CssDesign.is_iphone(self)==1):
			if(width>=300):
				height=300*height/width
				width=300
		
		template_values = {
		'host': host_url,
		'bbs': bbs,
		'bbs_key': bbs_key,
		'thread': thread,
		'thread_key': thread_key,
		'width': width,
		'height': height
		}		  
		path = '/html/moper/moper_embedded.htm'
		self.response.out.write(template_select.render(path, template_values))
开发者ID:abars,项目名称:illustbook,代码行数:46,代码来源:MoperPlayer.py

示例10: redirect_main

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def redirect_main(self):
		#リダイレクト
		host=MappingId.mapping_host_with_scheme(self.request)+"/";
		redirect_url=host+"mypage?";

		#リダイレクト先は必ず自分とする(他人のタイムラインには投稿は表示されないので)
		#if(self.request.get("to_user_id")):
		#	redirect_url=redirect_url+"&user_id="+self.request.get("to_user_id")

		if(self.request.get("feed_page")):
			redirect_url=redirect_url+"&feed_page="+self.request.get("feed_page")
		if(self.request.get("tab")):
			redirect_url=redirect_url+"&tab="+self.request.get("tab")
		else:
			redirect_url=redirect_url+"&tab=feed"
		if(self.request.get("edit")):
			redirect_url=redirect_url+"&edit="+self.request.get("edit")

		self.redirect(str(redirect_url))
开发者ID:abars,项目名称:illustbook,代码行数:21,代码来源:StackFeedTweet.py

示例11: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		celsys=0
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"

		bbs=None
		try:
			bbs = db.get(self.request.get("bbs_key"))
		except:
			bbs=None
		if(bbs==None):
			Alert.alert_msg_with_write(self,"イラストの投稿画面のURLが変更されています。掲示板からイラストを描くボタンをクリックして下さい。")
			return
		
		ipad=CssDesign.is_tablet(self)
		iphone=CssDesign.is_iphone(self)
		if(not ipad and not iphone):
			if(self.request.get("ipad") and self.request.get("ipad")=="1"):
				ipad=1
		
		thread_key=self.request.get("thread_key")
		entry_key=self.request.get("entry_key")

		category_list=CategoryList.get_category_list(bbs)
		event_list=EventList.get_event_list()

		user = users.get_current_user()
		logined=0
		if(user):
			logined=1

		is_reply=self.request.get("reply")

		wacom2=True
		#ipad=1

		#掲示板のデザインを取得
		design=CssDesign.get_design_object(self,bbs,host_url,1)

		#英語版かどうか
		is_english=CssDesign.is_english(self)
		
		#基本情報設定
		template_values = {
		'host': host_url,
		'bbs': bbs,
		'bbs_key': self.request.get("bbs_key"),
		'thread_key': thread_key,
		'entry_key': entry_key,
		'draw_time': 0,
		'canvas_width': int(self.request.get("canvas_width")),
		'canvas_height': int(self.request.get("canvas_height")),
		'canvas_url': self.request.get("canvas_url"),
		'reply': is_reply,
		'celsys': celsys,
		'category_list': category_list,
		'is_png': 0,
		'summary': "",
		'author': "",
		'title': "",
		'ipad': ipad,
		'logined': logined,
		'template_path':design["template_path"],
		'css_name':design["css_name"],
		'is_iphone':design["is_iphone"],
		'template_base_color':design["template_base_color"],
		'version': self.request.get("version"),
		'wacom2': wacom2,
		'selecting_category': None,
		'is_english': is_english,
		'event_list': event_list
		}

		#上書き時のコメントの初期値を設定
		if(not self.get_thread_comment(template_values,thread_key,entry_key,is_reply)):
			return
		if(not self.get_entry_comment(template_values,entry_key)):
			return
		
		if(ipad or iphone):
			path = '/html/tools/draw_window_ipad.htm'
		else:
			path = '/html/draw_window_flash_lapper.html'
		
		self.response.out.write(template_select.render(path, template_values))
开发者ID:abars,项目名称:illustbook,代码行数:86,代码来源:DrawWindow.py

示例12: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self,bbs_key,thread_key):
		SetUtf8.set()

		#ホストチェック
		if SpamCheck.is_deny(self.request):
			self.response.set_status(401)
			return

		#英語版かどうか
		is_english=CssDesign.is_english(self)

		#BBSを取得
		bbs_key=MappingId.mapping(bbs_key)
		bbs=ApiObject.get_cached_object(bbs_key)
		if(bbs == None):
			Alert.alert_msg_notfound(self)
			return

		#BBSが削除されていた場合
		if(bbs.del_flag) :
			if(is_english):
				Alert.alert_msg_with_write(self,"This bbs was deleted.")
			else:
				Alert.alert_msg_with_write(self,"このBBSは削除されました。")
			return
		
		#ページ番号を取得
		col_num = 10
		page = 1
		if self.request.get("page"):
			page = int(self.request.get("page"))
			if page < 1:
				page=1
		
		#メンテナンス画面
		is_maintenance=0
		if(MaintenanceCheck.is_appengine_maintenance()):
			is_maintenance=1

		#オーダー取得
		order="update"
		if(bbs.default_comment_order==1):
			order="new"
		if self.request.get("order"):
			order=self.request.get("order")
		
		#スレッド取得
		thread=ShowThread.get_thread(bbs,thread_key)
		if(thread == None):
			Alert.alert_msg_notfound(self)
			return

		#コメント数を更新
		if(bbs.page_comment_n):
			col_num=bbs.page_comment_n
		if(self.request.get("limit")):
			col_num=int(self.request.get("limit"))

		#コメントの一覧を取得
		query=ShowThread.get_comment_query(thread,order)
		entry_num = query.count()
		if(entry_num==0):
			com_list_ = []
		else:
			com_list_ = query.fetch(limit=col_num, offset=(page-1)*col_num)
		
		#検索
		search=""
		if(self.request.get("search")):
			search=self.request.get("search")
			query=""+search+' thread_key:"'+str(thread.key())+'"'
			com_list_=SearchThread.search(query,page,col_num,BbsConst.SEARCH_ENTRY_INDEX_NAME)
		
		#実体への変換
		com_list_=ApiObject.get_cached_object_list(com_list_)

		#現在のスレッドへのURLを取得
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"
		
		#編集モードか
		user = users.get_current_user()
		edit_flag = 0
		if(not OwnerCheck.check(bbs,user)):
			edit_flag = 1

		logined=0
		if(user):
			logined=1

		owner=user
		if(OwnerCheck.check(bbs,user)):
			owner=None

		admin_user=OwnerCheck.is_admin(user)

		#ページリンクを作成
		page_url_base = MappingId.get_usr_url(host_url,bbs)+thread_key+'.html?page='
		page_list=ShowThread.create_page_list(page,entry_num,col_num)
		
		#掲示板のデザインを取得
#.........这里部分代码省略.........
开发者ID:abars,项目名称:illustbook,代码行数:103,代码来源:ShowThread.py

示例13: alert_msg_with_write

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def alert_msg_with_write(req,msg):
		is_iphone=CssDesign.is_iphone(req)
		is_english=CssDesign.is_english(req)
		host_url=MappingId.mapping_host_with_scheme(req.request)+"/";
		req.response.out.write(Alert._alert_msg_core(msg,host_url,is_iphone,is_english))
开发者ID:abars,项目名称:illustbook,代码行数:7,代码来源:Alert.py

示例14: get

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def get(self):
		host_url=MappingId.mapping_host_with_scheme(self.request)+"/"
		bbs_key=self.request.get("bbs_key")
		thread_key=self.request.get("thread_key")
		try:
			bbs = db.get(self.request.get("bbs_key"))
		except:
			 bbs=None
		if(bbs==None):
			Alert.alert_msg_with_write(self,"ブックが見つかりません。")
			return

		ipad=CssDesign.is_tablet(self)
		iphone=CssDesign.is_iphone(self)
		if(ipad or iphone):
			Alert.alert_msg_with_write(self,"iPhoneやiPadでは動画お絵かきツールは使用できません。")
			return

		draw_time=0
		summary=""
		author=""
		title=""

		if(thread_key!=""):
			try:
				thread=db.get(thread_key)
			except:
				thread=None
			if(thread==None):
				Alert.alert_msg_with_write(self,"スレッドが見つかりません。")
				return
			draw_time=thread.draw_time

			summary=ReeditEscape.escape(thread.summary)
			author=ReeditEscape.escape(thread.author)
			title=ReeditEscape.escape(thread.title)

		canvas_url=self.request.get("canvas_url");
		if(canvas_url!=""):
			canvas_url=host_url+"moper_load?id="+canvas_url
			
		force=0
		canvas_width=400
		canvas_height=400
		if(self.request.get("canvas_width")):
			canvas_width=self.request.get("canvas_width")
		if(self.request.get("canvas_height")):
			canvas_height=self.request.get("canvas_height")
		if(self.request.get("force")):
			force=self.request.get("force")
		
		template_values = {
		'host': host_url,
		'bbs': bbs,
		'thread_key': thread_key,
		'bbs_key': bbs_key,
		'canvas_url': canvas_url,
		'canvas_width': canvas_width,
		'canvas_height': canvas_height,
		'force': force,
		'draw_time': draw_time,
		'summary': summary,
		'author': author,
		'title': title
		}
		path = '/html/tools/draw_window_moper.htm'
		self.response.out.write(template_select.render(path, template_values))
开发者ID:abars,项目名称:illustbook,代码行数:69,代码来源:MoperDraw.py

示例15: create_user_object_fast

# 需要导入模块: from myapp.MappingId import MappingId [as 别名]
# 或者: from myapp.MappingId.MappingId import mapping_host_with_scheme [as 别名]
	def create_user_object_fast(req,user_id):
		icon_url=MappingId.mapping_host_with_scheme(req.request)+"/show_icon?key="+user_id
		profile_url=MappingId.mapping_host_with_scheme(req.request)+"/mypage?user_id="+user_id
		one_dic={"user_id":user_id,"name":"unknown","homepage":"unknown","icon_url":icon_url,"profile_url":profile_url}
		return one_dic
开发者ID:abars,项目名称:illustbook,代码行数:7,代码来源:ApiObject.py


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