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


Python QDir.home方法代码示例

本文整理汇总了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")
开发者ID:ajaborsk,项目名称:pinguino-ide,代码行数:55,代码来源:post_install.py

示例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")
开发者ID:JasonFruit,项目名称:BibleReader,代码行数:5,代码来源:rc.py

示例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])
开发者ID:kmklr72,项目名称:LMMS-Theme-Installer,代码行数:7,代码来源:functions.py


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