Browse Source

minor changes

Dave Schuyler 21 years ago
parent
commit
82f428a60c
1 changed files with 25 additions and 43 deletions
  1. 25 43
      doc/makepanda/makepanda.py

+ 25 - 43
doc/makepanda/makepanda.py

@@ -101,27 +101,28 @@ else:
   def backslashify(exp):
   def backslashify(exp):
     return(exp)
     return(exp)
 
 
-def oslocalcmd(cd, cmd):
-  if (cd != "."):
-    print "cd "+cd+" ; "+cmd
-    base=os.getcwd()
-    os.chdir(cd)
-  else:
-    print cmd
-  sys.stdout.flush()
-  if (sys.platform == "win32"):
-    exe = cmd.split()[0]
-    if (os.path.isfile(exe)==0):
-      for i in os.environ["PATH"].split(";"):
-        if os.path.isfile(os.path.join(i, exe)):
-          exe = os.path.join(i, exe)
-          break
+if 0:
+  def oslocalcmd(cd, cmd):
+    if (cd != "."):
+      print "cd "+cd+" ; "+cmd
+      base=os.getcwd()
+      os.chdir(cd)
+    else:
+      print cmd
+    sys.stdout.flush()
+    if (sys.platform == "win32"):
+      exe = cmd.split()[0]
       if (os.path.isfile(exe)==0):
       if (os.path.isfile(exe)==0):
-        sys.exit("Cannot find "+exe+" on search path")
-    os.spawnl(os.P_WAIT, exe, cmd)
-  else: os.system(cmd)
-  if (cd != "."):
-    os.chdir(base)
+        for i in os.environ["PATH"].split(";"):
+          if os.path.isfile(os.path.join(i, exe)):
+            exe = os.path.join(i, exe)
+            break
+        if (os.path.isfile(exe)==0):
+          sys.exit("Cannot find "+exe+" on search path")
+      os.spawnl(os.P_WAIT, exe, cmd)
+    else: os.system(cmd)
+    if (cd != "."):
+      os.chdir(base)
 
 
 if 1:
 if 1:
   def getExecutablePath(cmd):
   def getExecutablePath(cmd):
@@ -212,24 +213,6 @@ def WriteFile(wfile,data):
     dsthandle.close()
     dsthandle.close()
   except: sys.exit("Cannot write "+wfile)
   except: sys.exit("Cannot write "+wfile)
 
 
-
-
-
-def ConditionalWriteFile(dest,desiredcontents):
-  try:
-    rfile = open(dest, 'rb');
-    contents = rfile.read(-1);
-    rfile.close();
-  except: contents=0;
-  if (contents != desiredcontents):
-    print "Regenerating file: "+dest
-    sys.stdout.flush()
-    try:
-      wfile = open(dest, 'wb');
-      wfile.write(desiredcontents);
-      wfile.close();
-    except: sys.exit("Cannot write to "+dest);
-
 ########################################################################
 ########################################################################
 ##
 ##
 ## Default options:
 ## Default options:
@@ -777,7 +760,7 @@ if (OMIT.count("MILES")==0):
   WARNINGS.append("Miles audio not yet supported by makepanda")
   WARNINGS.append("Miles audio not yet supported by makepanda")
   WARNINGS.append("I have automatically added this command-line option: --no-miles")
   WARNINGS.append("I have automatically added this command-line option: --no-miles")
   OMIT.append("MILES")
   OMIT.append("MILES")
-  
+
 ##########################################################################################
 ##########################################################################################
 #
 #
 # Enable or Disable runtime debugging mechanisms based on optimize level.
 # Enable or Disable runtime debugging mechanisms based on optimize level.
@@ -1059,16 +1042,15 @@ def CxxCalcDependenciesAll(srcfiles, ipath):
 ########################################################################
 ########################################################################
 
 
 def ConditionalWriteFile(dest,desiredcontents):
 def ConditionalWriteFile(dest,desiredcontents):
-  wdest = backslashify(dest)
   try:
   try:
-    rfile = open(wdest, 'rb');
+    rfile = open(dest, 'rb');
     contents = rfile.read(-1);
     contents = rfile.read(-1);
     rfile.close();
     rfile.close();
   except: contents=0;
   except: contents=0;
   if (contents != desiredcontents):
   if (contents != desiredcontents):
     print "Regenerating file: "+dest
     print "Regenerating file: "+dest
     sys.stdout.flush()
     sys.stdout.flush()
-    WriteFile(wdest,desiredcontents)
+    WriteFile(dest,desiredcontents)
 
 
 ########################################################################
 ########################################################################
 ##
 ##
@@ -4118,7 +4100,7 @@ InterrogateModule(outc='libpanda_module.cxx', module='panda', library='libpanda'
 CompileC(ipath=IPATH, opts=OPTS, src='panda.cxx', obj='panda_panda.obj')
 CompileC(ipath=IPATH, opts=OPTS, src='panda.cxx', obj='panda_panda.obj')
 CompileC(ipath=IPATH, opts=OPTS, src='libpanda_module.cxx', obj='libpanda_module.obj')
 CompileC(ipath=IPATH, opts=OPTS, src='libpanda_module.cxx', obj='libpanda_module.obj')
 CompileLink(opts=['ADVAPI', 'WINSOCK2', 'WINUSER', 'WINMM', 'HELIX', 'VRPN', 'NSPR',
 CompileLink(opts=['ADVAPI', 'WINSOCK2', 'WINUSER', 'WINMM', 'HELIX', 'VRPN', 'NSPR',
-		  'ZLIB', 'JPEG', 'PNG', 'TIFF', 'FFTW', 'FREETYPE'],
+                  'ZLIB', 'JPEG', 'PNG', 'TIFF', 'FFTW', 'FREETYPE'],
             xdep=['built/tmp/dtool_have_helix.dat'],  dll='libpanda.dll', obj=OBJFILES)
             xdep=['built/tmp/dtool_have_helix.dat'],  dll='libpanda.dll', obj=OBJFILES)
 
 
 #
 #