Browse Source

Coding style corrections

Helmut Pozimski 12 years ago
parent
commit
8e85b49820
7 changed files with 62 additions and 44 deletions
  1. 13 8
      configuration.py
  2. 2 1
      install.py
  3. 4 3
      outputhelper.py
  4. 11 9
      stov.py
  5. 6 4
      subscription.py
  6. 16 12
      youtube.py
  7. 10 7
      youtubeAPI.py

+ 13 - 8
configuration.py

@@ -23,6 +23,7 @@ import subprocess
 
 
 from outputhelper import printf
 from outputhelper import printf
 
 
+
 class conf(object):
 class conf(object):
 	def __init__(self):
 	def __init__(self):
 		"""Constructor
 		"""Constructor
@@ -54,7 +55,8 @@ class conf(object):
 		self.__explanations = {
 		self.__explanations = {
 				"database": _("the name of your database file"),
 				"database": _("the name of your database file"),
 				"downloaddir": _("the directory where downloaded videos are saved"),
 				"downloaddir": _("the directory where downloaded videos are saved"),
-				"maxvideos": _("the maximum number of videos to retrieve for each subscription"),
+				"maxvideos": _("the maximum number of videos to retrieve for each "
+					"subscription"),
 				"mailhost": _("the host of your mail server"),
 				"mailhost": _("the host of your mail server"),
 				"mailto": _("the address used for notifications"),
 				"mailto": _("the address used for notifications"),
 				"mailfrom": _("the sender address of notification e-mails"),
 				"mailfrom": _("the sender address of notification e-mails"),
@@ -65,7 +67,8 @@ class conf(object):
 				"youtube-dl": _("the path to your youtube-dl installation"),
 				"youtube-dl": _("the path to your youtube-dl installation"),
 				"notify": _("if you want to be notified via e-mail about new videos"),
 				"notify": _("if you want to be notified via e-mail about new videos"),
 				"videocodec": _("which video codec you prefer (h264, webm or flv)"),
 				"videocodec": _("which video codec you prefer (h264, webm or flv)"),
-				"maxresolution": _("which resolution you prefer (360p, 480p, 720p or 1080p)"),
+				"maxresolution": _("which resolution you prefer (360p, 480p, 720p "
+					"or 1080p)"),
 				}
 				}
 		self.dbpath = str(os.environ['HOME']) + "/.stov/" + self.values["database"]
 		self.dbpath = str(os.environ['HOME']) + "/.stov/" + self.values["database"]
 		self.outputlevel = "default"
 		self.outputlevel = "default"
@@ -98,7 +101,7 @@ class conf(object):
 		except sqlite3.OperationalError:
 		except sqlite3.OperationalError:
 			printf(_("The database could not be created, please "
 			printf(_("The database could not be created, please "
 				"check that the configuration directory exists and is writable"),
 				"check that the configuration directory exists and is writable"),
-				outputlevel = "default", level=self.outputlevel, descriptor="stderr")
+				outputlevel="default", level=self.outputlevel, descriptor="stderr")
 		else:
 		else:
 			self.__dbcursor = self.__database.cursor()
 			self.__dbcursor = self.__database.cursor()
 			printf(_("Creating table subscriptions"),
 			printf(_("Creating table subscriptions"),
@@ -131,7 +134,8 @@ class conf(object):
 
 
 		"""
 		"""
 		try:
 		try:
-			printf(_("Creating hidden directory in home for configuration and database"),
+			printf(_("Creating hidden directory in home for configuration and "
+				"database"),
 				outputlevel="verbose", level=self.outputlevel, descriptor="stderr")
 				outputlevel="verbose", level=self.outputlevel, descriptor="stderr")
 			os.mkdir(str(os.environ['HOME']) + "/.stov", 0750)
 			os.mkdir(str(os.environ['HOME']) + "/.stov", 0750)
 		except os.error:
 		except os.error:
@@ -153,7 +157,7 @@ class conf(object):
 		"""
 		"""
 		try:
 		try:
 			printf(_("Opening config file for reading"),
 			printf(_("Opening config file for reading"),
-				outputlevel="verbose", level=self.outputlevel, descriptor="stderr")	
+				outputlevel="verbose", level=self.outputlevel, descriptor="stderr")
 			self.configfile = open(str(os.environ['HOME']) + "/.stov/stov.config", "r")
 			self.configfile = open(str(os.environ['HOME']) + "/.stov/stov.config", "r")
 		except IOError:
 		except IOError:
 			printf(_("Configuration could not be "
 			printf(_("Configuration could not be "
@@ -227,10 +231,11 @@ class conf(object):
 			except sqlite3.OperationalError:
 			except sqlite3.OperationalError:
 				printf(_("The database could not be updated, please "
 				printf(_("The database could not be updated, please "
 					"check that the configuration directory exists and is writable"),
 					"check that the configuration directory exists and is writable"),
-					outputlevel = "default", level=self.outputlevel, descriptor="stderr")
+					outputlevel="default", level=self.outputlevel, descriptor="stderr")
 			else:
 			else:
 				self.__dbcursor = self.__database.cursor()
 				self.__dbcursor = self.__database.cursor()
-				self.__dbcursor.execute("ALTER TABLE videos add column failcnt int DEFAULT 0;")
+				self.__dbcursor.execute("ALTER TABLE videos add column failcnt int \
+				DEFAULT 0;")
 				self.__database.commit()
 				self.__database.commit()
 				self.__database.close()
 				self.__database.close()
 				self.ReadConfig()
 				self.ReadConfig()
@@ -288,7 +293,7 @@ class conf(object):
 			descriptor="stdout")
 			descriptor="stdout")
 		for value in self.__explanations:
 		for value in self.__explanations:
 			printf(_(self.__explanations[value] + " [" + self.values[value] + "]: "),
 			printf(_(self.__explanations[value] + " [" + self.values[value] + "]: "),
-				outputlevel="default", level=self.outputlevel, 
+				outputlevel="default", level=self.outputlevel,
 				descriptor="stdout")
 				descriptor="stdout")
 			self.__user_input = raw_input()
 			self.__user_input = raw_input()
 			if self.__user_input != "":
 			if self.__user_input != "":

+ 2 - 1
install.py

@@ -117,7 +117,8 @@ you can write to it."""
 	os.chdir(programpath)
 	os.chdir(programpath)
 	if os.access(binpath, os.F_OK & os.W_OK) and installation_success is True:
 	if os.access(binpath, os.F_OK & os.W_OK) and installation_success is True:
 		try:
 		try:
-			os.symlink(os.path.join(programpath, "stov.py"), os.path.join(binpath, "stov"))
+			os.symlink(os.path.join(programpath, "stov.py"),
+				os.path.join(binpath, "stov"))
 		except OSError:
 		except OSError:
 			print "Symlink in bin-directory already exists"
 			print "Symlink in bin-directory already exists"
 		print ("stov has been installed successfully to "
 		print ("stov has been installed successfully to "

+ 4 - 3
outputhelper.py

@@ -23,6 +23,7 @@ import sys
 A little helper function used to do some additional checks before actually
 A little helper function used to do some additional checks before actually
 using print to generate the output"""
 using print to generate the output"""
 
 
+
 def printf(string, outputlevel, descriptor="stdout", level="default"):
 def printf(string, outputlevel, descriptor="stdout", level="default"):
 	if descriptor == "stdout":
 	if descriptor == "stdout":
 		if level == "default" and outputlevel == "default":
 		if level == "default" and outputlevel == "default":
@@ -38,7 +39,7 @@ def printf(string, outputlevel, descriptor="stdout", level="default"):
 			elif string is str:
 			elif string is str:
 				print string
 				print string
 			else:
 			else:
-				print str(string)	
+				print str(string)
 		elif level == "quiet":
 		elif level == "quiet":
 			pass
 			pass
 	elif descriptor == "stderr":
 	elif descriptor == "stderr":
@@ -55,6 +56,6 @@ def printf(string, outputlevel, descriptor="stdout", level="default"):
 			elif string is str:
 			elif string is str:
 				print >> sys.stderr, string
 				print >> sys.stderr, string
 			else:
 			else:
-				print >> sys.stderr, str(string)	
+				print >> sys.stderr, str(string)
 		elif level == "quiet":
 		elif level == "quiet":
-			pass	
+			pass

+ 11 - 9
stov.py

@@ -142,11 +142,11 @@ loaded as a module
 """
 """
 
 
 if __name__ != "__main__":
 if __name__ != "__main__":
-	print >> sys.stderr, """This file should not be imported as a module 
+	print >> sys.stderr, """This file should not be imported as a module
 				please run it directly from command line"""
 				please run it directly from command line"""
 	sys.exit(1)
 	sys.exit(1)
 
 
-"""Check which outputlevel is defined and save it to a temporary variable 
+"""Check which outputlevel is defined and save it to a temporary variable
 accordingly. Output generated before this will be printed to stdout regardless
 accordingly. Output generated before this will be printed to stdout regardless
 of the user defined setting
 of the user defined setting
 
 
@@ -222,7 +222,7 @@ else:
 	conf = configuration.conf()
 	conf = configuration.conf()
 	if conf.CheckConfig() is not True:
 	if conf.CheckConfig() is not True:
 		printf(_("Your configuration needs to be updated, performing"
 		printf(_("Your configuration needs to be updated, performing"
-			" update now."), outputlevel="default", level=outputlevel, 
+			" update now."), outputlevel="default", level=outputlevel,
 			descriptor="stdout")
 			descriptor="stdout")
 		conf.UpdateConfig()
 		conf.UpdateConfig()
 	if conf.CheckDB() is not True:
 	if conf.CheckDB() is not True:
@@ -233,7 +233,7 @@ else:
 	conf.ReadConfig()
 	conf.ReadConfig()
 
 
 """Check which outputlevel is defined and update the configuration object
 """Check which outputlevel is defined and update the configuration object
-accordingly. 
+accordingly.
 
 
 """
 """
 
 
@@ -293,7 +293,7 @@ if options.add is True:
 	if AddSub is True:
 	if AddSub is True:
 		NewSubscription.AddSub()
 		NewSubscription.AddSub()
 		NewSubscription.UpdateVideos()
 		NewSubscription.UpdateVideos()
-		printf(_("New subscription ") + NewSubscription.GetTitle()\
+		printf(_("New subscription ") + NewSubscription.GetTitle()
 		+ _(" successfully added"), outputlevel="default", level=conf.outputlevel,
 		+ _(" successfully added"), outputlevel="default", level=conf.outputlevel,
 		descriptor="stdout")
 		descriptor="stdout")
 elif options.list is True:
 elif options.list is True:
@@ -440,7 +440,8 @@ FROM subscriptions")
 			printf(_("The following videos have been downloaded:\n"),
 			printf(_("The following videos have been downloaded:\n"),
 			outputlevel="default", level=conf.outputlevel, descriptor="stdout")
 			outputlevel="default", level=conf.outputlevel, descriptor="stdout")
 			for i in mailcontent:
 			for i in mailcontent:
-				printf(i, outputlevel="default", level=conf.outputlevel, descriptor="stdout")
+				printf(i, outputlevel="default", level=conf.outputlevel,
+					descriptor="stdout")
 	else:
 	else:
 		printf(_("Could not determine how you want to be informed "
 		printf(_("Could not determine how you want to be informed "
 					"about new videos, please check the notify parameter "
 					"about new videos, please check the notify parameter "
@@ -512,7 +513,7 @@ elif options.cleanup is True:
 		title=element[1], type=element[2], name=element[3],
 		title=element[1], type=element[2], name=element[3],
 		search=element[4], directory=element[5], conf=conf))
 		search=element[4], directory=element[5], conf=conf))
 	for element in subscriptions_list:
 	for element in subscriptions_list:
-		element.CheckAndDelete()	
+		element.CheckAndDelete()
 	try:
 	try:
 		database = sqlite3.connect(conf.dbpath)
 		database = sqlite3.connect(conf.dbpath)
 		cursor = database.cursor()
 		cursor = database.cursor()
@@ -525,7 +526,7 @@ elif options.cleanup is True:
 		database.close()
 		database.close()
 
 
 elif options.license is True:
 elif options.license is True:
-	printf( """
+	printf("""
 	stov is free software: you can redistribute it and/or modify
 	stov is free software: you can redistribute it and/or modify
 	it under the terms of the GNU General Public License as published by
 	it under the terms of the GNU General Public License as published by
 	the Free Software Foundation, version 2 of the License.
 	the Free Software Foundation, version 2 of the License.
@@ -539,7 +540,8 @@ elif options.license is True:
 	along with stov.  If not, see <http://www.gnu.org/licenses/>.
 	along with stov.  If not, see <http://www.gnu.org/licenses/>.
 	""", outputlevel="default", level=conf.outputlevel, descriptor="stdout")
 	""", outputlevel="default", level=conf.outputlevel, descriptor="stdout")
 elif options.version is True:
 elif options.version is True:
-	printf("0.3dev", outputlevel="default", level=conf.outputlevel, descriptor="stdout")
+	printf("0.3dev", outputlevel="default", level=conf.outputlevel,
+		descriptor="stdout")
 else:
 else:
 	parser.print_help()
 	parser.print_help()
 
 

+ 6 - 4
subscription.py

@@ -26,6 +26,7 @@ import youtube
 
 
 from outputhelper import printf
 from outputhelper import printf
 
 
+
 class sub(object):
 class sub(object):
 	def __init__(self, type, name, conf, search="", id=0, title="", directory=""):
 	def __init__(self, type, name, conf, search="", id=0, title="", directory=""):
 		self.__ID = id
 		self.__ID = id
@@ -85,7 +86,7 @@ class sub(object):
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 
 
 		for i in self.__ParsedResponse.videos:
 		for i in self.__ParsedResponse.videos:
-			printf(_('Checking if video "%s" exists in the database' %i.title),
+			printf(_('Checking if video "%s" exists in the database' % i.title),
 				outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 				outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 			self.__ytid = i.ytid
 			self.__ytid = i.ytid
 			self.__videoquery = "SELECT id FROM videos WHERE ytid=?"
 			self.__videoquery = "SELECT id FROM videos WHERE ytid=?"
@@ -117,7 +118,7 @@ class sub(object):
 				"Please check permissions and try again."),
 				"Please check permissions and try again."),
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 
 
-		printf(_("Getting all videos for subscription %s from database" 
+		printf(_("Getting all videos for subscription %s from database"
 			% self.__title), outputlevel="verbose", level=self.__conf.outputlevel,
 			% self.__title), outputlevel="verbose", level=self.__conf.outputlevel,
 			descriptor="stderr")
 			descriptor="stderr")
 		self.__videoquerybysubscription = "SELECT id, title, description, \
 		self.__videoquerybysubscription = "SELECT id, title, description, \
@@ -152,7 +153,7 @@ class sub(object):
 			outputlevel="default", level=self.__conf.outputlevel, descriptor="stdout")
 			outputlevel="default", level=self.__conf.outputlevel, descriptor="stdout")
 		for i in self.__videos:
 		for i in self.__videos:
 			if i.downloaded == 0:
 			if i.downloaded == 0:
-				printf(i.title + _("   (pending)"), outputlevel="default", 
+				printf(i.title + _("   (pending)"), outputlevel="default",
 					level=self.__conf.outputlevel, descriptor="stdout")
 					level=self.__conf.outputlevel, descriptor="stdout")
 			elif i.downloaded == 1:
 			elif i.downloaded == 1:
 				printf(i.title + _("   (downloaded)"), outputlevel="default",
 				printf(i.title + _("   (downloaded)"), outputlevel="default",
@@ -192,7 +193,7 @@ class sub(object):
 		self.__cursor.execute(self.__query, self.__data)
 		self.__cursor.execute(self.__query, self.__data)
 		self.__ID = self.__cursor.fetchone()
 		self.__ID = self.__cursor.fetchone()
 		self.__ID = self.__ID[0]
 		self.__ID = self.__ID[0]
-		printf(_("Subscription got internal ID %s" %self.__ID),
+		printf(_("Subscription got internal ID %s" % self.__ID),
 			outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 			outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 		self.__connection.close()
 		self.__connection.close()
 
 
@@ -244,6 +245,7 @@ class sub(object):
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 				outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
 		printf(_("Constructed the following API URL: %s" % self.__APIURL),
 		printf(_("Constructed the following API URL: %s" % self.__APIURL),
 			outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 			outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
+
 	def CheckAndDelete(self):
 	def CheckAndDelete(self):
 		"""Checks if a video still exists in the current API response and deletes
 		"""Checks if a video still exists in the current API response and deletes
 		it if it doesn't
 		it if it doesn't

+ 16 - 12
youtube.py

@@ -24,8 +24,10 @@ import subprocess
 
 
 from outputhelper import printf
 from outputhelper import printf
 
 
+
 class video(object):
 class video(object):
-	def __init__(self, title, description, ytid, conf, downloaded, failcount = 0, id=0):
+	def __init__(self, title, description, ytid, conf, downloaded, failcount=0,
+			id=0):
 		self.__ID = id
 		self.__ID = id
 		self.title = title
 		self.title = title
 		self.description = description
 		self.description = description
@@ -53,16 +55,16 @@ and can't be created. Please check your configuration and try again"),
 				printf(_('Downloading video "%s"' % self.title),
 				printf(_('Downloading video "%s"' % self.title),
 					outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 					outputlevel="verbose", level=self.__conf.outputlevel, descriptor="stderr")
 				if self.__conf.outputlevel == "default":
 				if self.__conf.outputlevel == "default":
-					subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
-					"http://www.youtube.com/watch?v=%s" % self.ytid],
+					subprocess.check_call(["youtube-dl", "--max-quality=%s"
+					% itag_value, "-t", "http://www.youtube.com/watch?v=%s" % self.ytid],
 					stderr=sys.stderr, stdout=open("/dev/null", "w"))
 					stderr=sys.stderr, stdout=open("/dev/null", "w"))
 				elif self.__conf.outputlevel == "verbose":
 				elif self.__conf.outputlevel == "verbose":
-					subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
-					"http://www.youtube.com/watch?v=%s" % self.ytid],
+					subprocess.check_call(["youtube-dl", "--max-quality=%s"
+					% itag_value, "-t", "http://www.youtube.com/watch?v=%s" % self.ytid],
 					stderr=sys.stderr, stdout=sys.stdout)
 					stderr=sys.stderr, stdout=sys.stdout)
 				elif self.__conf.outputlevel == "quiet":
 				elif self.__conf.outputlevel == "quiet":
-					subprocess.check_call(["youtube-dl", "--max-quality=%s" % itag_value, "-t",
-					"http://www.youtube.com/watch?v=%s" % self.ytid],
+					subprocess.check_call(["youtube-dl", "--max-quality=%s"
+					% itag_value, "-t", "http://www.youtube.com/watch?v=%s" % self.ytid],
 					stderr=open("/dev/null", "w"), stdout=open("/dev/null", "w"))
 					stderr=open("/dev/null", "w"), stdout=open("/dev/null", "w"))
 				try:
 				try:
 					self.__database = sqlite3.connect(self.__conf.dbpath)
 					self.__database = sqlite3.connect(self.__conf.dbpath)
@@ -70,7 +72,8 @@ and can't be created. Please check your configuration and try again"),
 					printf(_("The Video \"%s\" has been "
 					printf(_("The Video \"%s\" has been "
 								"downloaded but the status could not be updated in the database. "
 								"downloaded but the status could not be updated in the database. "
 								"Please check what went wrong and correct it" % self.title),
 								"Please check what went wrong and correct it" % self.title),
-						outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
+						outputlevel="default", level=self.__conf.outputlevel,
+							descriptor="stderr")
 				else:
 				else:
 					self.__cursor = self.__database.cursor()
 					self.__cursor = self.__database.cursor()
 					printf(_('Downloaded video "%s", updating database accordingly.'
 					printf(_('Downloaded video "%s", updating database accordingly.'
@@ -92,14 +95,15 @@ and can't be created. Please check your configuration and try again"),
 					printf(_("The Video \"%s\" has failed "
 					printf(_("The Video \"%s\" has failed "
 								"downloading but the status could not be updated in the database. "
 								"downloading but the status could not be updated in the database. "
 								"Please check what went wrong and correct it" % self.title),
 								"Please check what went wrong and correct it" % self.title),
-						outputlevel="default", level=self.__conf.outputlevel, descriptor="stderr")
+						outputlevel="default", level=self.__conf.outputlevel,
+							descriptor="stderr")
 				else:
 				else:
 					self.__cursor = self.__database.cursor()
 					self.__cursor = self.__database.cursor()
 					self.failcnt = int(self.failcnt) + 1
 					self.failcnt = int(self.failcnt) + 1
 					if self.failcnt >= int(self.__conf.values["maxfails"]):
 					if self.failcnt >= int(self.__conf.values["maxfails"]):
 						printf(_("The video \"%s\" has failed downloading too often, marking as"
 						printf(_("The video \"%s\" has failed downloading too often, marking as"
-							" failed" % self.title), outputlevel="default", level=self.__conf.outputlevel,
-							descriptor="stderr")
+							" failed" % self.title), outputlevel="default",
+							level=self.__conf.outputlevel, descriptor="stderr")
 						self.__statement = "UPDATE videos SET downloaded = -1 WHERE id = ?"
 						self.__statement = "UPDATE videos SET downloaded = -1 WHERE id = ?"
 						self.__cursor.execute(self.__statement, (self.__ID,))
 						self.__cursor.execute(self.__statement, (self.__ID,))
 					self.__statement = "UPDATE videos SET failcnt = ? WHERE id = ?"
 					self.__statement = "UPDATE videos SET failcnt = ? WHERE id = ?"
@@ -118,7 +122,7 @@ and can't be created. Please check your configuration and try again"),
 			self.__database = sqlite3.connect(self.__conf.dbpath)
 			self.__database = sqlite3.connect(self.__conf.dbpath)
 		except sqlite3.OperationalError:
 		except sqlite3.OperationalError:
 			printf(_("Could not connect to the database, please check settings and"
 			printf(_("Could not connect to the database, please check settings and"
-				 "permissions and try again"), outputlevel="default",
+				"permissions and try again"), outputlevel="default",
 				level=self.__conf.outputlevel, descriptor="stderr")
 				level=self.__conf.outputlevel, descriptor="stderr")
 			return False
 			return False
 		else:
 		else:

+ 10 - 7
youtubeAPI.py

@@ -31,25 +31,28 @@ class Parser(object):
 		for title in dom.getElementsByTagName('title'):
 		for title in dom.getElementsByTagName('title'):
 			xmlTag = title.toxml()
 			xmlTag = title.toxml()
 			if i == 0:
 			if i == 0:
-				channel.title = xmlTag.replace('<title>','').replace('</title>','')
-				channel.title = channel.title.replace('&amp;','&').replace('&quot;','"')
+				channel.title = xmlTag.replace('<title>', '').replace('</title>', '')
+				channel.title = channel.title.replace('&amp;', '&').replace('&quot;', '"')
 			else:
 			else:
-				video_title = xmlTag.replace('<title>','').replace('</title>','')
-				video_title = video_title.replace('&amp;','&').replace('&quot;','"')
+				video_title = xmlTag.replace('<title>', '').replace('</title>', '')
+				video_title = video_title.replace('&amp;', '&').replace('&quot;', '"')
 				xmlTag = dom.getElementsByTagName('media:description')[i-1].toxml()
 				xmlTag = dom.getElementsByTagName('media:description')[i-1].toxml()
-				video_description = xmlTag.replace('<media:description type="plain">'
-				,'').replace('</media:description>','')
+				video_description = xmlTag.replace('<media:description type="plain">',
+				'').replace('</media:description>', '')
 				video_id = dom.getElementsByTagName('yt:videoid')[i-1].toxml()
 				video_id = dom.getElementsByTagName('yt:videoid')[i-1].toxml()
-				video_id = video_id.replace('<yt:videoid>','').replace('</yt:videoid>','')
+				video_id = video_id.replace('<yt:videoid>', '').replace('</yt:videoid>',
+					'')
 				channel.videos.append(YtVideo(video_title, video_description, video_id))
 				channel.videos.append(YtVideo(video_title, video_description, video_id))
 			i = i + 1
 			i = i + 1
 		return channel
 		return channel
 
 
+
 class YtChannel(object):
 class YtChannel(object):
 	def __init__(self):
 	def __init__(self):
 		self.title = u""
 		self.title = u""
 		self.videos = []
 		self.videos = []
 
 
+
 class YtVideo(object):
 class YtVideo(object):
 	def __init__(self, title, description, ytid):
 	def __init__(self, title, description, ytid):
 		self.title = title
 		self.title = title