Bug fixed. Added tests.

This commit is contained in:
utahta
2010-12-10 01:26:11 +09:00
parent 7b2ae023bf
commit 966fa577f7
18 changed files with 105 additions and 15 deletions
+3 -9
View File
@@ -1,8 +1,8 @@
import os
import sys
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, PATH_BIN, PATH_ETC_CURRENT
from pythonbrew.util import Package
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
from pythonbrew.util import Package, set_current_path
from pythonbrew.log import logger
class SwitchCommand(Command):
@@ -22,14 +22,8 @@ class SwitchCommand(Command):
sys.exit(1)
pkgbin = os.path.join(pkgdir,'bin')
self._set_current('%s:%s' % (PATH_BIN, pkgbin))
set_current_path('%s:%s' % (PATH_BIN, pkgbin))
logger.info("Switched to %s" % pkgname)
def _set_current(self, path):
fp = open(PATH_ETC_CURRENT, 'w')
fp.write('PATH_PYTHONBREW="%s"\n' % (path))
fp.close()
SwitchCommand()