Skip to content

Commit

Permalink
Änderungen für Python2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
chriszero committed Sep 1, 2013
1 parent 44df601 commit 53083f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions tvsp2xmltv/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import operator
import os
import stat
import configparser
import ConfigParser

# ugo+rw because may different user work with this file
file_mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH
Expand All @@ -21,16 +21,16 @@ def find_in_path(file_name, path=None):
return file_name


config = configparser.ConfigParser()
config = ConfigParser.ConfigParser()
config.read(find_in_path('tvspielfilm2xmltv.ini'))

destination_file = config['DEFAULT']['destination_file']
control_file = config['DEFAULT']['control_file']
epgimages_dir = config['DEFAULT']['epgimages_dir']
remove_orphaned_images = config['DEFAULT'].getboolean('remove_orphaned_images')
grab_today = config['DEFAULT'].getboolean('grab_today')
number_of_images_per_show = int(config['DEFAULT']['number_of_images_per_show'])
debug = config['DEFAULT'].getboolean('debug')
destination_file = config.get('DEFAULT', 'destination_file')
control_file = config.get('DEFAULT', 'control_file')
epgimages_dir = config.get('DEFAULT', 'epgimages_dir')
remove_orphaned_images = config.getboolean('DEFAULT', 'remove_orphaned_images')
grab_today = config.getboolean('DEFAULT', 'grab_today')
number_of_images_per_show = config.getint('DEFAULT', 'number_of_images_per_show')
debug = config.getboolean('DEFAULT', 'debug')

sart_map = {
'SE': 'Serie',
Expand Down
4 changes: 2 additions & 2 deletions tvsp2xmltv/pictureLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import glob
from io import open
from os import path, remove, fchmod
from urllib.parse import urlsplit
import urllib
from . import defaults
from . import logger
from xml.etree.ElementTree import Element
Expand Down Expand Up @@ -43,7 +43,7 @@ def get_xml(self):

def __download_image(self, file_url, file_dir):
suffix_list = ['jpg', 'gif', 'png']
file_name = urlsplit(file_url)[2].split('/')[-1]
file_name = urllib.parse.split(file_url)[2].split('/')[-1]
file_suffix = file_name.split('.')[1]
full_file_path = path.abspath(path.join(file_dir, file_name))
#check if file exists before downloading it again
Expand Down

0 comments on commit 53083f4

Please sign in to comment.