本文整理汇总了Python中Utils.Utils.get_random_name方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.get_random_name方法的具体用法?Python Utils.get_random_name怎么用?Python Utils.get_random_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Utils
的用法示例。
在下文中一共展示了Utils.get_random_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_for_scattered_prev_cffile
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import get_random_name [as 别名]
def _check_for_scattered_prev_cffile(self, cffolder):
# This method workarounds a border case that happens when we have 2 files in a folder
# In wich the first file occupies more than one cab... When this happens, when the second
# cffile gets added, it cannot share the scattered CFFOLDER because it doesn't work..
# We need to create an anonymous CFFOLDER here and return it
last_cffile = cffolder.cffile_list[-1]
if last_cffile.iFolder & CFFILE.ifoldCONTINUED_FROM_PREV == CFFILE.ifoldCONTINUED_FROM_PREV:
anonymous_folder = self._create_cffolder(Utils.get_random_name(10))
self.cffolder_list.append(anonymous_folder)
return anonymous_folder
return cffolder
示例2: __generate_folder_name
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import get_random_name [as 别名]
def __generate_folder_name(self):
i = 0
base_name = Utils.get_random_name(5) + "_folder_"
while True:
yield base_name + str(i)
i += 1