當前位置: 首頁>>代碼示例>>Python>>正文


Python File.replace方法代碼示例

本文整理匯總了Python中gio.File.replace方法的典型用法代碼示例。如果您正苦於以下問題:Python File.replace方法的具體用法?Python File.replace怎麽用?Python File.replace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gio.File的用法示例。


在下文中一共展示了File.replace方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __get_search_path_from

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __get_search_path_from(self, uri):
		self.__manager.response()
		from gio import File
		path = File(uri).get_parse_name()
		path = path.replace(self.__home_folder, "").strip("/\\")
		self.__manager.response()
		return path
開發者ID:mystilleef,項目名稱:scribes,代碼行數:9,代碼來源:DataGenerator.py

示例2: __set_label

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __set_label(self):
		from gio import File
		uri = self.__editor.uri
		if uri: folder = File(uri).get_parent().get_parse_name()
		if not uri: folder = self.__editor.desktop_folder
		folder = folder.replace(self.__editor.home_folder.rstrip("/"), "~")
		self.__label.set_label(message % folder)
		return False
開發者ID:mystilleef,項目名稱:scribes,代碼行數:10,代碼來源:InfoLabel.py

示例3: __get_display_path_from

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __get_display_path_from(self, uri):
		self.__manager.response()
		from gio import File
		path = File(uri).get_parent().get_parse_name()
		path = path.replace(self.__home_folder, "").strip("/\\")
		from os.path import split
		self.__manager.response()
		if not path: return split(self.__home_folder)[-1].strip("/\\")
		return path
開發者ID:mystilleef,項目名稱:scribes,代碼行數:11,代碼來源:DataGenerator.py

示例4: __set_label

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __set_label(self, fileinfo):
		try:
			if not self.__editor.uri: raise AssertionError
			from gio import File
			path = File(self.__editor.uri).get_parent().get_parse_name()
			folder = path.replace(self.__editor.home_folder.rstrip("/"), "~")
			self.__label.set_text(folder)
		except AssertionError:
			self.__label.set_text("Unknown")
		return False
開發者ID:mystilleef,項目名稱:scribes,代碼行數:12,代碼來源:LocationLabel.py

示例5: __get_dictionary

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __get_dictionary(self, uri):
		from gio import File
		title = File(uri).get_basename() if uri else _("Unnamed Document")
		ellipsize = self.__ellipsize
		if uri: parent_path = File(uri).get_parent().get_parse_name()
		if uri: parent_path = ellipsize(parent_path.replace(self.__editor.home_folder, "~").strip("/\\"))
		fulltitle = "%s - (%s)" % (title, parent_path) if uri else title
		fulltitle = title if len(title) > 30 else fulltitle
		dictionary = {
			"normal": fulltitle,
			"modified": "*" + fulltitle,
			"readonly": fulltitle + _(" [READONLY]"),
			"loading": _("Loading %s ...") % title,
		}
		return dictionary
開發者ID:mystilleef,項目名稱:scribes,代碼行數:17,代碼來源:TitleUpdater.py

示例6: __replace

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __replace(self, _file):
		from gio import File
		__file = File(_file).get_path()
		return __file.replace(self.__path, "").lstrip("/"), File(_file).get_uri()
開發者ID:mystilleef,項目名稱:scribes,代碼行數:6,代碼來源:FileFormatter.py

示例7: __update_names

# 需要導入模塊: from gio import File [as 別名]
# 或者: from gio.File import replace [as 別名]
	def __update_names(self, uri):
		from gio import File
		filename = File(uri).get_parse_name()
		filename = filename.replace(self.__editor.home_folder.rstrip("/"), "~")
		self.__default_name = filename
		return False
開發者ID:mystilleef,項目名稱:scribes,代碼行數:8,代碼來源:FallbackMessageHandler.py


注:本文中的gio.File.replace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。