"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/tmpy/graph/graph.py" between
TeXmacs-2.1.1-src.tar.gz and TeXmacs-2.1.2-src.tar.gz

About: GNU TeXmacs is a scientific editing platform designed to create beautiful technical documents using a wysiwyg interface.

graph.py  (TeXmacs-2.1.1-src):graph.py  (TeXmacs-2.1.2-src)
skipping to change at line 24 skipping to change at line 24
import shutil import shutil
import time import time
from ..protocol import * from ..protocol import *
from ..compat import * from ..compat import *
class Graph(object): class Graph(object):
name = "" name = ""
message = "" message = ""
pre_code = "" pre_code = ""
post_code = "" post_code = ""
height = 0 height = ""
width = 0 width = ""
default_output = "eps"
output = "" output = ""
default_width = "0px"
default_height = "0px"
default_output = "eps"
def greet(self): def greet(self):
for x in self.message.split("\n"): for x in self.message.split("\n"):
if len(x) == 0: if len(x) == 0:
pass pass
else: else:
flush_verbatim (x + "\n") flush_verbatim (x + "\n")
flush_prompt (self.name + "] ") flush_prompt (self.name + "] ")
def available(self): def available(self):
return which(self.name) is not None return which(self.name) is not None
def reset_options(self): def reset_options(self):
self.height = "0px" self.height = self.default_height
self.width = "0px" self.width = self.default_width
self.output = self.default_output self.output = self.default_output
def apply_magic(self, magic_line): def apply_magic(self, magic_line):
args = list(filter(lambda x: len(x)!=0, magic_line.split(" ")[1:])) args = list(filter(lambda x: len(x)!=0, magic_line.split(" ")[1:]))
while (len(args) > 1): while (len(args) > 1):
option = args[0] option = args[0]
value = args[1] value = args[1]
if (option == '-width'): if (option == '-width'):
self.width = value self.width = value
elif (option == '-height'): elif (option == '-height'):
skipping to change at line 97 skipping to change at line 99
if not line: if not line:
continue continue
if line[0] == DATA_COMMAND: if line[0] == DATA_COMMAND:
# TODO: Handle completions # TODO: Handle completions
continue continue
else: else:
lines = [line] lines = [line]
while line != "<EOF>": while line != "<EOF>":
line = tm_input() line = tm_input()
lines.append(line) lines.append(line)
text='\n'.join(lines[:-1]) text = '\n'.join(lines[:-1])
self.eval(text) self.eval(text)
def get_tmp_dir(self): def get_tmp_dir(self):
dir = "graph_" + self.name + "_" + str(os.getpid()) dir = "graph_" + self.name + "_" + str(os.getpid())
if (platform.system() == "Windows"): if (platform.system() == "Windows"):
return os.getenv("TEXMACS_HOME_PATH") + "\\system\\tmp\\" + dir + "\ \" return os.getenv("TEXMACS_HOME_PATH") + "\\system\\tmp\\" + dir + "\ \"
else: else:
return os.getenv("TEXMACS_HOME_PATH") + "/system/tmp/" + dir + "/" return os.getenv("TEXMACS_HOME_PATH") + "/system/tmp/" + dir + "/"
def remove_tmp_dir(self): def remove_tmp_dir(self):
 End of changes. 4 change blocks. 
6 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)