本文整理汇总了Python中FileUtils.expandPath方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtils.expandPath方法的具体用法?Python FileUtils.expandPath怎么用?Python FileUtils.expandPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils.expandPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import expandPath [as 别名]
def __init__(self, args, cmd=None):
'''
@summary: Initializes the PySchedUI
@result:
'''
self.version = "1.1.1"
self.initializeLogger(args)
self.debug = args.debug
self.userId = args.user or None
self.rsaKey = args.key or None
self.lastError = None
self.network = None
self.isAdmin = False
self.multicastGroup = args.multicast
self.server = args.server or None
if cmd:
self.logger.debug("Command = {}".format(cmd))
if self.openConnection():
if cmd.lower() == "addjob":
uiDict = UIDict()
uiDict.addInfo("Template-File", "template", os.path.normpath(FileUtils.expandPath(args.template)))
uiDict.addInfo("Username", "userId", self.userId)
self.logger.info("Scheduling job from {}".format(args.template))
self.addJob(uiDict.getInfos())
print
print
self.closeConnection()
示例2: openConnection
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import expandPath [as 别名]
def openConnection(self):
self.network = Network(
self,
self.debug,
keyFile=FileUtils.expandPath(self.rsaKey),
multicast=self.multicastGroup,
server=self.server)
if self.network.openConnection():
userAuth, self.isAdmin = self._checkUser(self.userId)
if not userAuth:
self.lastError = "Unable to log in with this User. Please contact your system administrator."
self.logger.error(self.lastError)
return False
return True