Login | Register
My pages Projects Community openCollabNet

Discussions > Commits > svn commit: r137 - trunk/repoguard/setup.py

repoguard
Discussion topic

Back to topic list

svn commit: r137 - trunk/repoguard/setup.py

Author schlauch
Full name Tobias Schlauch
Date 2012-09-23 07:19:53 PDT
Message Author: schlauch
Date: 2012-09-23 07:19:53-0700
New Revision: 137

Modified:
   trunk/repoguard/setup.py

Log:
Fixes ISSUE #50:
In some cases the written constants.py module contained Syntax errors. This has been fixed.
On Windows the "\" character has not been escaped. Fixed.

Modified: trunk/repoguard/setup.py
Url: http://repoguard.tig​ris.org/source/brows​e/repoguard/trunk/re​poguard/setup.py?vie​w=diff&pathrev=1​37&r1=136&r2​=137
====================​====================​====================​==================
--- trunk/repoguard/setup.py (original)
+++ trunk/repoguard/setup.py 2012-09-23 07:19:53-0700
@@ -259,15 +259,19 @@
 
 def _write_config_home_c​onstant(config_home)​:
     constants_file_path = "src/repoguard/core/​constants.py"
- file_object = open(constants_file_path, "r+b")
+ file_object = open(constants_file_path, "rb")
     try:
         content = list()
         for line in file_object.readlines():
             if line.startswith("CONFIG_HOME ="):
- content.append("CONFIG_HOME = \"%s\"\n" % config_home)
+ content.append("CONFIG_HOME = '%s'\n" % config_home)
             else:
                 content.append(line)
- file_object.seek(0)
+ finally:
+ file_object.close()
+
+ file_object = open(constants_file_path, "wb")
+ try:
         file_object.write(""​.join(content))
     finally:
         file_object.close()

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r137 - trunk/repoguard/setup.py schlauch Tobias Schlauch 2012-09-23 07:19:53 PDT
Messages per page: