Modified python scripts to support both python2.7 and python3 natively
This commit is contained in:
parent
eb3f57ce34
commit
3351bfce2f
8 changed files with 58 additions and 30 deletions
scripts/devSetup
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
__author__ = u'schmatz'
|
||||
import configuration
|
||||
import errors
|
||||
|
@ -36,11 +37,11 @@ class RepositoryInstaller():
|
|||
else:
|
||||
return False
|
||||
def cloneRepository(self):
|
||||
print u"Cloning repository..."
|
||||
print(u"Cloning repository...")
|
||||
#TODO: CHANGE THIS BEFORE LAUNCH
|
||||
return_code = True
|
||||
git_folder = self.config.directory.root_install_directory + os.sep + "coco"
|
||||
print "Installing into " + git_folder
|
||||
print("Installing into " + git_folder)
|
||||
return_code = subprocess.call("git clone " + self.config.repository_url +" coco",cwd=self.config.directory.root_install_directory,shell=True)
|
||||
#TODO: remove this on windos
|
||||
subprocess.call("chown -R " +git_folder + " 0777",shell=True)
|
||||
|
@ -51,15 +52,15 @@ class RepositoryInstaller():
|
|||
#sys.stdout.flush()
|
||||
raw_input(u"Copy it now")
|
||||
#shutil.copytree(u"/Users/schmatz/coco",self.config.directory.root_install_directory + os.sep + u"coco")
|
||||
print u"Copied tree just for you"
|
||||
print(u"Copied tree just for you")
|
||||
#print("FAILED TO CLONE GIT REPOSITORY")
|
||||
#input("Clone the repository and click any button to continue")
|
||||
elif self.config.system.operating_system == u"windows":
|
||||
raise errors.CoCoError(u"Windows doesn't support automated installations of npm at this point.")
|
||||
else:
|
||||
print u"Cloned git repository"
|
||||
print(u"Cloned git repository")
|
||||
def install_node_packages(self):
|
||||
print u"Installing node packages..."
|
||||
print(u"Installing node packages...")
|
||||
#TODO: "Replace npm with more robust package
|
||||
#npm_location = self.config.directory.bin_directory + os.sep + "node" + os.sep + "bin" + os.sep + "npm"
|
||||
npm_location = u"npm"
|
||||
|
@ -67,4 +68,4 @@ class RepositoryInstaller():
|
|||
if return_code:
|
||||
raise errors.CoCoError(u"Failed to install node packages")
|
||||
else:
|
||||
print u"Installed node packages!"
|
||||
print(u"Installed node packages!")
|
||||
|
|
Reference in a new issue