diff options
author | saksham1115 <saksham115@gmail.com> | 2016-07-08 19:47:35 +0000 |
---|---|---|
committer | saksham1115 <saksham115@gmail.com> | 2016-07-19 17:29:09 +0000 |
commit | 1ba4556b90730f94e8b173bf6282373d85a3e69e (patch) | |
tree | a67a1f1c1ce00db413d58021303ca0fbb8d3ad64 /mediagoblin/tools | |
parent | 0e60155a6fd2605ccdb787246bfd6132c0f8fa73 (diff) | |
download | mediagoblin-1ba4556b90730f94e8b173bf6282373d85a3e69e.tar.lz mediagoblin-1ba4556b90730f94e8b173bf6282373d85a3e69e.tar.xz mediagoblin-1ba4556b90730f94e8b173bf6282373d85a3e69e.zip |
Removed ast and fixed comments
Diffstat (limited to 'mediagoblin/tools')
-rw-r--r-- | mediagoblin/tools/subtitles.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/mediagoblin/tools/subtitles.py b/mediagoblin/tools/subtitles.py index bfb4a7ea..2888fe99 100644 --- a/mediagoblin/tools/subtitles.py +++ b/mediagoblin/tools/subtitles.py @@ -1,26 +1,14 @@ -import ast,os +import os def get_path(path): - """ - Converting the path of the form - x = u'[ "A","B","C" ," D"]' - to - x = ["A", "B", "C", "D"] - """ - return ast.literal_eval(path) + return eval(path) def open_subtitle(path): temp = ['user_dev','media','public'] path = list(get_path(path)) file_path = os.path.abspath(__file__).split('/') # Path of current file as dictionary - """ - Creating the absolute path for the subtitle file - """ - subtitle_path = file_path[:-3] + temp + path + subtitle_path = file_path[:-3] + temp + path # Creating the absolute path for the subtitle file subtitle_path = "/" + os.path.join(*subtitle_path) - """ - Opening the file using the absolute path - """ - subtitle = open(subtitle_path,"r") + subtitle = open(subtitle_path,"r") # Opening the file using the absolute path text = subtitle.read() return text
\ No newline at end of file |