本文整理匯總了Python中PySide.QtCore.QDir.home方法的典型用法代碼示例。如果您正苦於以下問題:Python QDir.home方法的具體用法?Python QDir.home怎麽用?Python QDir.home使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PySide.QtCore.QDir
的用法示例。
在下文中一共展示了QDir.home方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: config_posix
# 需要導入模塊: from PySide.QtCore import QDir [as 別名]
# 或者: from PySide.QtCore.QDir import home [as 別名]
def config_posix(self):
""""""
# Path for all pinguinowriteable files
PATH = QDir.home().path() + "/.local/share/pinguino_ide"
writeable_path = PATH
pinguino_user_libs = PATH + "/pinguino-libraries"
pinguino_resources = "qtgui/resources"
pinguino_examples = PATH + "/examples/examples"
pinguino_examples_graphical = PATH + "/examples/examples_graphical"
# create (if not exist) a work dir space
if not os.path.isdir(writeable_path):
os.makedirs(writeable_path, 0777)
self.first_config.add_section("Paths")
self.first_config.set("Paths", "pinguino_writeable_path", writeable_path)
self.first_config.set("Paths", "pinguino_user_libs", pinguino_user_libs)
self.first_config.set("Paths", "pinguino_resources", pinguino_resources)
self.first_config.set("Paths", "pinguino_examples_graphical", pinguino_examples_graphical)
self.first_config.set("Paths", "pinguino_examples", pinguino_examples)
# set default paths
self.first_config.set("Paths", "sdcc_bin", "/usr/bin/sdcc")
#self.first_config.set("Paths", "sdcc_libs", "/usr/share/sdcc")
self.first_config.set("Paths", "gcc_bin", "")
#self.first_config.set("Paths", "gcc_libs", "")
self.first_config.set("Paths", "pinguino_8_libs", "pinguino/p8")
self.first_config.set("Paths", "pinguino_32_libs", "pinguino/p32")
self.first_config.set("Paths", "source", PATH + "/source")
config_location = os.path.join(writeable_path, CONFIG_FILENAME)
self.first_config.write(file(config_location, "w"))
local_config = file("config", "w")
local_config.write(config_location)
# Remove examples
if os.path.exists(pinguino_examples): shutil.rmtree(pinguino_examples)
if os.path.exists(pinguino_examples_graphical): shutil.rmtree(pinguino_examples_graphical)
# Copy examples to writeable path
shutil.copytree("pinguino/examples", pinguino_examples)
shutil.copytree("qtgui/gide/examples", pinguino_examples_graphical)
# Copy other configs
shutil.copy("qtgui/config/reserved.pickle", PATH + "/reserved.pickle")
shutil.copy("qtgui/config/wikidocs.pickle", PATH + "/wikidocs.pickle")
# Copy pinguino source dir
if os.path.exists(PATH + "/source"): shutil.rmtree(PATH + "/source")
shutil.copytree("pinguino/source", PATH + "/source")
示例2: rc_dir
# 需要導入模塊: from PySide.QtCore import QDir [as 別名]
# 或者: from PySide.QtCore.QDir import home [as 別名]
def rc_dir():
"""Return the directory that contains the rc files"""
return os.path.join(QDir.home().absolutePath(), ".biblereader")
示例3: generate_data_dir
# 需要導入模塊: from PySide.QtCore import QDir [as 別名]
# 或者: from PySide.QtCore.QDir import home [as 別名]
def generate_data_dir():
lmms_rc_file = os.path.join(QDir.home().absolutePath(), '.lmmsrc.xml')
xml = BeautifulSoup(open(lmms_rc_file).read())
return os.path.normpath(os.path.split(os.path.split(xml.paths['artwork'].rstrip('/\\'))[0])[0])