From 8abe26f3ad17dcabc143fab4c93b9025700d52ef Mon Sep 17 00:00:00 2001 From: Dan North Date: Wed, 23 Nov 2011 10:02:44 +0000 Subject: [PATCH 1/2] [dn] Fixed up backslashes --- ryppi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ryppi.py b/ryppi.py index 0cf61f9..c224fb6 100644 --- a/ryppi.py +++ b/ryppi.py @@ -55,7 +55,7 @@ def my_nts(s, encoding, errors): return return s.decode(encoding, errors) -modules_dir = r'.\node_modules' +modules_dir = 'node_modules' tmp_dir = os.path.join(modules_dir, '.tmp') def cleanupDir(cleanPath): @@ -118,7 +118,7 @@ def saveAndExtractPackage(metaData): def installDependencies(pkgDir, dependencies='dependencies'): # Recursive install dependencies - print('Checking %s for %s ...' % (dependencies, pkgDir.split('\\')[-1])) + print 'Checking %s for %s ...' % (dependencies, os.path.basename(pkgDir)) metaData = json.loads(open(os.path.join(pkgDir, 'package.json'), 'r').read()) for dep in metaData.get(dependencies, []): install(dep) @@ -137,7 +137,7 @@ def get_installed(): return meta def install(pkg): - # Installs pkg(s) into .\node_modules + # Installs pkg(s) into node_modules meta = getMetaDataForPkg(pkg) destPath = saveAndExtractPackage(meta) installDependencies(destPath) From 8e80153ca1974eb886bd7ff7896f5f2dd114bd54 Mon Sep 17 00:00:00 2001 From: Dan North Date: Wed, 23 Nov 2011 11:01:32 +0000 Subject: [PATCH 2/2] [dn] oops - print is a function in python 3 --- ryppi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ryppi.py b/ryppi.py index c224fb6..53a943a 100644 --- a/ryppi.py +++ b/ryppi.py @@ -118,7 +118,7 @@ def saveAndExtractPackage(metaData): def installDependencies(pkgDir, dependencies='dependencies'): # Recursive install dependencies - print 'Checking %s for %s ...' % (dependencies, os.path.basename(pkgDir)) + print('Checking %s for %s ...' % (dependencies, os.path.basename(pkgDir))) metaData = json.loads(open(os.path.join(pkgDir, 'package.json'), 'r').read()) for dep in metaData.get(dependencies, []): install(dep) @@ -158,7 +158,7 @@ def update(): install(pkg['name']) def usage(): - print (""" + print(""" Usage: python ryppi.py deps - Install dependencies from package.json file. python ryppi.py devDeps - Install development dependencies from package.json file.