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


Python Storage.deleteOwnedCourse方法代码示例

本文整理汇总了Python中data.storage.Storage.deleteOwnedCourse方法的典型用法代码示例。如果您正苦于以下问题:Python Storage.deleteOwnedCourse方法的具体用法?Python Storage.deleteOwnedCourse怎么用?Python Storage.deleteOwnedCourse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data.storage.Storage的用法示例。


在下文中一共展示了Storage.deleteOwnedCourse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Room

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import deleteOwnedCourse [as 别名]
class Room(object):
   # very limited content negotiation support - our format choices 
   # for output. This also shows _a way_ of representing enums in python
   json, xml, html, text = range(1,5)
   
   #
   # setup the configuration for our service
   #
   def __init__(self,base,conf_fn):
      self.host = socket.gethostname()
      self.base = base
      self.conf = {}
      
      # should emit a failure (file not found) message
      if os.path.exists(conf_fn):
         with open(conf_fn) as cf:
            for line in cf:
               name, var = line.partition("=")[::2]
               self.conf[name.strip()] = var.strip()
      else:
         raise Exception("configuration file not found.")

      # create storage
      self.__store = Storage()
   

   #
   # example: find data
   #
   def find(self,name):
      print '---> classroom.find:',name
      return self.__store.find(name)

   #
   # example: add data
   #
   def add(self,name,value):
      try:
         self.__store.insert(name,value)
         self.__store.names();
         return 'success'
      except:
         return 'failed'
   def checkLogin(self,data):
      try:
	 print("Inclassromm :::::::::::::");
         
         self.__store.names();
	 return(self.__store.checkLogin(data))
        
      except:
         return 'failed'

   #Sud start
   def userAdd(self,userJson):
      try:
	 print("Inclassromm :::::::::::::");
         
         self.__store.names();
	 return(self.__store.createUser(userJson))
        
      except:
         return 'failed'
   def updateUser(self,userJson,email):
      try:
	 print("Inclassromm of update user:::::::::::::");
         
         self.__store.names();
	 return(self.__store.updateUser(userJson,email))
        
      except:
         return 'failed'


   def updateEnrolled(self,enrolledCourseData):
      try:         
	 return(self.__store.updateEnrolled(enrolledCourseData))
        
      except:
         return 'failed'

   def ownedCourselist(self,email):
      try:
	 return(self.__store.ownedCourselist(email))
         
      except:
         return 'failed'


   def deleteCourse(self,courseJson,cid):
      try:      
	 return(self.__store.deleteCourse(courseJson,cid))
        
      except:
         return 'failed'


   def deleteOwnedCourse(self,courseJson,cid):
      try:      
	 return(self.__store.deleteOwnedCourse(courseJson,cid))
#.........这里部分代码省略.........
开发者ID:SudharshanR,项目名称:MooC,代码行数:103,代码来源:classroom.py


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