def __init__(self):
     if dialog_msg('yesno',
                   line1 = __localize__(32015),
                   line2 = __localize__(32016),
                   background = False,
                   nolabel = __localize__(32014),
                   yeslabel = __localize__(32013)):
         try:
             # Creates temp folder
             fileops()
         except CreateDirectoryError, e:
             log('Could not create directory: %s' % str(e))
             return False
         else:
             if __addon__.getSetting("movie_enable") == 'true':
                 media_list = get_medialist('movie')
                 if media_list:
                     update_movie(media_list)
         dialog_msg("close")
예제 #2
0
 def initialise(self):
     log("## Checking for script arguments")
     try:
         log("## arg 0: %s" % sys.argv[0])
         log("## arg 1: %s" % sys.argv[1])
         log("## arg 2: %s" % sys.argv[2])
         log("## arg 3: %s" % sys.argv[3])
         log("## arg 4: %s" % sys.argv[4])
         log("## arg 5: %s" % sys.argv[5])
         log("## arg 6: %s" % sys.argv[6])
         log("## arg 7: %s" % sys.argv[7])
     except:
         log("## No more arg")
     log("## Checking for downloading mode...")
     for item in sys.argv:
         # Check for download mode
         match = re.search("silent=(.*)", item)
         if match:
             self.silent = match.group(1)
         # Check for download mode
         match = re.search("mode=(.*)", item)
         if match:
             self.mode = match.group(1)
         # Check for mediatype mode
         match = re.search("mediatype=(.*)", item)
         if match:
             self.mediatype = match.group(1)
             if self.mediatype == 'tvshow' or self.mediatype == 'movie' or self.mediatype == 'musicvideo':
                 pass
             else:
                 log(
                     'Error: invalid mediatype, must be one of movie, tvshow or musicvideo',
                     xbmc.LOGERROR)
                 return False
         # Check for medianame
         match = re.search("medianame=(.*)", item)
         if match:
             self.medianame = match.group(1)
         # Check for mediapath
         match = re.search("mediapath=(.*)", item)
         if match:
             self.mediapath = (match.group(1).rstrip(' /\ '))
             log('matchgroup: %s' % self.mediapath)
     try:
         # Creates temp folder
         self.fileops = fileops()
     except CreateDirectoryError, e:
         log("Could not create directory: %s" % str(e))
         return False
 def initialise(self):
     log("## Checking for script arguments")
     try:
         log( "## arg 0: %s" % sys.argv[0] )
         log( "## arg 1: %s" % sys.argv[1] )
         log( "## arg 2: %s" % sys.argv[2] )
         log( "## arg 3: %s" % sys.argv[3] )
         log( "## arg 4: %s" % sys.argv[4] )
         log( "## arg 5: %s" % sys.argv[5] )
         log( "## arg 6: %s" % sys.argv[6] )
         log( "## arg 7: %s" % sys.argv[7] )
     except:
         log( "## No more arg" )
     log("## Checking for downloading mode...")
     for item in sys.argv:
         # Check for download mode
         match = re.search("silent=(.*)" , item)
         if match:
             self.silent = match.group(1)
         # Check for download mode
         match = re.search("mode=(.*)" , item)
         if match:
             self.mode = match.group(1)
         # Check for mediatype mode
         match = re.search("mediatype=(.*)" , item)
         if match:
             self.mediatype = match.group(1)
             if self.mediatype == 'tvshow' or self.mediatype == 'movie' or self.mediatype == 'musicvideo':
                 pass
             else:
                 log('Error: invalid mediatype, must be one of movie, tvshow or musicvideo', xbmc.LOGERROR)
                 return False
         # Check for medianame
         match = re.search("medianame=(.*)" , item)
         if match:
             self.medianame = match.group(1)
         # Check for mediapath
         match = re.search("mediapath=(.*)" , item)
         if match:
             self.mediapath = (match.group(1).rstrip(' /\ '))
             log('matchgroup: %s' %self.mediapath)
     try:
         # Creates temp folder
         self.fileops = fileops()
     except CreateDirectoryError, e:
         log("Could not create directory: %s" % str(e))
         return False
예제 #4
0
 def initialise(self):
     log('## Checking for script arguments')
     try:
         log('## arg 0: %s' % sys.argv[0])
         log('## arg 1: %s' % sys.argv[1])
         log('## arg 2: %s' % sys.argv[2])
         log('## arg 3: %s' % sys.argv[3])
     except:
         pass
     log('## Checking for downloading mode...')
     for item in sys.argv:
         # Check for download mode
         match = re.search('silent=(.*)' , item)
         if match:
             self.silent = match.group(1)
         # Check for download mode
         match = re.search('mode=(.*)' , item)
         if match:
             self.mode = match.group(1)
         # Check for mediatype mode
         match = re.search('mediatype=(.*)' , item)
         if match:
             self.mediatype = match.group(1)
             if self.mediatype == 'tvshow' or self.mediatype == 'movie' or self.mediatype == 'musicvideo':
                 pass
             else:
                 log('Error: invalid mediatype, must be one of movie, tvshow or musicvideo', xbmc.LOGERROR)
                 return False
         # Check for download mode
         match = re.search('dbid=(.*)' , item)
         if match:
             self.dbid = match.group(1)
         # Check for medianame
         match = re.search('medianame=(.*)' , item)
         if match:
             self.medianame = match.group(1).lstrip(' " ').rstrip(' " ')
         # Check for mediapath
         match = re.search('mediapath=(.*)' , item)
         if match:
             self.mediapath = match.group(1).lstrip(' " ').rstrip(' "/\ ')
             log('matchgroup: %s' %self.mediapath)
     try:
         # Creates temp folder
         self.fileops = fileops()
     except CreateDirectoryError, e:
         log('Could not create directory: %s' % str(e))
         return False