本文整理汇总了Python中source.Source.save_source方法的典型用法代码示例。如果您正苦于以下问题:Python Source.save_source方法的具体用法?Python Source.save_source怎么用?Python Source.save_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source.Source
的用法示例。
在下文中一共展示了Source.save_source方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validate_forms
# 需要导入模块: from source import Source [as 别名]
# 或者: from source.Source import save_source [as 别名]
def validate_forms(self):
"""Validate form."""
root_pass = self.ids.pr2.text
username = self.ids.us1.text
user_pass = self.ids.us3.text
home = self.ids.us4.text
shell = self.ids.us5.text
pre = self.ids.pre.text
pos = self.ids.pos.text
if self.source:
s = self.source
else:
s = 'cdrom'
folder = ''
server = ''
partition = self.ids.partition.text
ftp_user = self.ids.ftp_user.text
ftp_pass = self.ids.ftp_pass.text
print('SOURCE:' + self.source)
if s == 'Hard drive':
folder = self.ids.hh_folder.text
elif s == 'NFS':
folder = self.ids.nfs_folder.text
server = self.ids.nfs_server.text
elif s == 'HTTP':
folder = self.ids.http_folder.text
server = self.ids.http_server.text
elif s == 'FTP':
folder = self.ids.ftp_folder.text
server = self.ids.ftp_server.text
source = Source()
source.save_source(s, partition, folder, server, ftp_user, ftp_pass)
# if self.active is True and self.ids.pr1.text
# is not self.ids.pr2.text:
# print(self.ids.pr1.focus)
# popup = InfoPopup()
# popup.set_info('Root passwords do not match')
# popup.open()
user = User()
user.save_user(root_pass, username, user_pass, home, shell)
script = Script()
script.save_script(pre, pos)
section = Section()
section.create_file()