本文整理汇总了Python中FileSystem.FileSystem.loadForumTypes方法的典型用法代码示例。如果您正苦于以下问题:Python FileSystem.loadForumTypes方法的具体用法?Python FileSystem.loadForumTypes怎么用?Python FileSystem.loadForumTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem.FileSystem
的用法示例。
在下文中一共展示了FileSystem.loadForumTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from FileSystem import FileSystem [as 别名]
# 或者: from FileSystem.FileSystem import loadForumTypes [as 别名]
def __init__(self):
self.forumTypes = list(FileSystem.loadForumTypes())
self.forums = list(ForumForums.objects.all())
self.threads = list(ForumThreads.objects.all())
self.posts = list(ForumPosts.objects.all())
self.comments = list(ForumComments.objects.all())
self.reputations = list(ForumReputationPoints.objects.all())
try:
self.views = list(ForumViewLog.objects.all())
except:
pass
self._buildForumIndex()
self._getForumParentMap()
self._getForumTypeMap()
self._getThreadToForumMap()
self._getThreadToPostMap()
self._getPostToThreadMap()
self._getPostToForumMap()
self._getCommentToPostMap()
self._getCommentToThreadMap()
self._getCommentToForumMap()
try:
self._getViewToThreadMap()
except:
pass
示例2: runner
# 需要导入模块: from FileSystem import FileSystem [as 别名]
# 或者: from FileSystem.FileSystem import loadForumTypes [as 别名]
def runner(self):
if not self.checkForDB():
logging.info('Necessary database does not exist, bailing. (' \
+ self.getCourseName() + ')')
#sys.exit()
return
try:
self.threads = list(ForumThreads.objects.all())
self.forums = list(ForumForums.objects.all())
except:
return
#raise CourseDBError
self.forumTypes = FileSystem.loadForumTypes()
self.buildForumIndex()
self.getForumNameMap()
dist = self.findDistribution()
path = os.path.join(self.getMainResultsDir(),self.getCourseName() + '.csv')
with open(path,'wt') as fid:
for n,x in zip(typeCategories,dist):
fid.write(n + ', ' + str(x) + '\n')