aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools
diff options
context:
space:
mode:
authorsaksham1115 <saksham115@gmail.com>2016-07-11 06:46:12 +0000
committersaksham1115 <saksham115@gmail.com>2016-07-19 17:29:09 +0000
commita8902a5edb973a0c3ab444a02d51b1108f32d207 (patch)
tree9a06c39831cee01be8573b60cfb810fd6931f36e /mediagoblin/tools
parent1ba4556b90730f94e8b173bf6282373d85a3e69e (diff)
downloadmediagoblin-a8902a5edb973a0c3ab444a02d51b1108f32d207.tar.lz
mediagoblin-a8902a5edb973a0c3ab444a02d51b1108f32d207.tar.xz
mediagoblin-a8902a5edb973a0c3ab444a02d51b1108f32d207.zip
Saing subtitle after edit
Diffstat (limited to 'mediagoblin/tools')
-rw-r--r--mediagoblin/tools/subtitles.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mediagoblin/tools/subtitles.py b/mediagoblin/tools/subtitles.py
index 2888fe99..7fcf5f11 100644
--- a/mediagoblin/tools/subtitles.py
+++ b/mediagoblin/tools/subtitles.py
@@ -11,4 +11,13 @@ def open_subtitle(path):
subtitle_path = "/" + os.path.join(*subtitle_path)
subtitle = open(subtitle_path,"r") # Opening the file using the absolute path
text = subtitle.read()
- return text \ No newline at end of file
+ return text
+
+def save_subtitle(path,text):
+ temp = ['user_dev','media','public']
+ path = list(get_path(path))
+ file_path = os.path.abspath(__file__).split('/') # Path of current file as dictionary
+ subtitle_path = file_path[:-3] + temp + path # Creating the absolute path for the subtitle file
+ subtitle_path = "/" + os.path.join(*subtitle_path)
+ subtitle = open(subtitle_path,"w") # Opening the file using the absolute path
+ subtitle.write(text) \ No newline at end of file