Ticket #12299: trac_12299-jhp.patch

File trac_12299-jhp.patch, 2.4 KB (added by jhpalmieri, 9 years ago)

minor cleanup of paths in jmoldata.py

  • sage/interfaces/jmoldata.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1339954546 25200
    # Node ID 849ded8c02d1e65774df7d4efe517da888eb8c2b
    # Parent  70442d34b14ac524ed1f8922b5f62ac91b73d6e3
    jmoldata.py: minor clean-up
    
    diff --git a/sage/interfaces/jmoldata.py b/sage/interfaces/jmoldata.py
    a b AUTHORS: 
    2222from sage.structure.sage_object import SageObject
    2323
    2424from sage.misc.misc import tmp_filename
    25 from sage.misc.misc import SAGE_LOCAL
     25from sage.misc.misc import SAGE_LOCAL, DOT_SAGE, sage_makedirs
    2626
    2727import subprocess
    2828import os
    class JmolData(SageObject): 
    8181            <type 'bool'>
    8282        """
    8383        #scratch file for  Jmol errors and status
    84         jmolscratch = os.path.expanduser("~/.sage/sage_notebook.sagenb/jmol_scratch")
     84        jmolscratch = os.path.join(DOT_SAGE, "sage_notebook.sagenb", "jmol_scratch")
    8585        if not os.path.exists(jmolscratch):
    86             os.mkdir(jmolscratch)
     86            sage_makedirs(jmolscratch)
    8787        scratchout = os.path.join(jmolscratch,"jmolout.txt")
    8888        jout=open(scratchout,'w')
    89         testjavapath = os.path.join(SAGE_LOCAL, "share/jmol/testjava.sh")
     89        testjavapath = os.path.join(SAGE_LOCAL, "share", "jmol", "testjava.sh")
    9090        result = subprocess.call([testjavapath],stdout=jout)
    9191        jout.close()
    9292        if (result == 0):
    class JmolData(SageObject): 
    168168         """
    169169        if (self.is_jvm_available()):
    170170            # Set up paths, file names and scripts
    171             jmolpath = os.path.join(SAGE_LOCAL, "share/jmol/JmolData.jar")
     171            jmolpath = os.path.join(SAGE_LOCAL, "share", "jmol", "JmolData.jar")
    172172            launchscript = ""
    173173            if (datafile_cmd!='script'):
    174174                launchscript = "load "
    class JmolData(SageObject): 
    179179
    180180            sizeStr = "%sx%s" %(figsize*100,figsize*100)
    181181            #scratch file for  Jmol errors and status
    182             jmolscratch = os.path.expanduser("~/.sage/sage_notebook.sagenb/jmol_scratch")
     182            jmolscratch = os.path.join(DOT_SAGE, "sage_notebook.sagenb", "jmol_scratch")
    183183            if not os.path.exists(jmolscratch):
    184                 os.mkdir(jmolscratch)
     184                sage_makedirs(jmolscratch)
    185185            scratchout = os.path.join(jmolscratch,"jmolout.txt")
    186186            jout=open(scratchout,'w')
    187187            #now call the java application and write the file.