Exemple #1
0
 def on_complete(self):
   self.animation_loader.on_complete()
   self.interval_animation.stop()
   if os.path.isfile(self.NODE_JS_BINARY_TARFILE_FULL_PATH) : 
     os.remove(self.NODE_JS_BINARY_TARFILE_FULL_PATH)
   node_js = NodeJS()
   npm = NPM()
   self.animation_loader = AnimationLoader(["[=     ]", "[ =    ]", "[   =  ]", "[    = ]", "[     =]", "[    = ]", "[   =  ]", "[ =    ]"], 0.067, "Installing npm dependencies ")
   self.interval_animation = RepeatedTimer(self.animation_loader.sec, self.animation_loader.animate)
   try :
     npm.getCurrentNPMVersion(True) 
   except Exception as e:
     print("Error: "+traceback.format_exc())
   try :
     npm.install_all() 
   except Exception as e :
     #print("Error: "+traceback.format_exc())
     pass
   self.animation_loader.on_complete()
   self.interval_animation.stop()
   if node_js.getCurrentNodeJSVersion(True) == self.NODE_JS_VERSION :
     sublime.active_window().status_message("Node.js "+self.NODE_JS_VERSION+" installed correctly! NPM version: "+npm.getCurrentNPMVersion(True))
   else :
     sublime.active_window().status_message("Can't install Node.js! Something went wrong during installation.")
Exemple #2
0
def updateNPMDependencies():
    npm = NPM()
    try:
        npm.getCurrentNPMVersion(True)
    except Exception as e:
        if node_variables.NODE_JS_OS == "win":
            sublime.active_window().status_message(
                "Can't use \"npm\"! To use features that requires \"npm\", you must install it! Download it from https://nodejs.org site"
            )
        print("Error: " + traceback.format_exc())
        return

    animation_loader = AnimationLoader([
        "[=     ]", "[ =    ]", "[   =  ]", "[    = ]", "[     =]", "[    = ]",
        "[   =  ]", "[ =    ]"
    ], 0.067, "Updating npm dependencies ")
    interval_animation = RepeatedTimer(animation_loader.sec,
                                       animation_loader.animate)
    try:
        npm.update_all(False)
    except Exception as e:
        pass
    animation_loader.on_complete()
    interval_animation.stop()
Exemple #3
0
 def on_complete(self):
     self.animation_loader.on_complete()
     self.interval_animation.stop()
     if os.path.isfile(self.NODE_JS_BINARY_TARFILE_FULL_PATH):
         os.remove(self.NODE_JS_BINARY_TARFILE_FULL_PATH)
     node_js = NodeJS()
     npm = NPM()
     self.animation_loader = AnimationLoader([
         "[=     ]", "[ =    ]", "[   =  ]", "[    = ]", "[     =]",
         "[    = ]", "[   =  ]", "[ =    ]"
     ], 0.067, "Installing npm dependencies ")
     self.interval_animation = RepeatedTimer(self.animation_loader.sec,
                                             self.animation_loader.animate)
     try:
         npm.getCurrentNPMVersion()
     except Exception as e:
         if node_variables.NODE_JS_OS == "win":
             sublime.error_message(
                 "Can't use \"npm\"! To use features that requires \"npm\", you must install it! Download it from https://nodejs.org site"
             )
         print(e)
     try:
         npm.install_all()
     except Exception as e:
         pass
     self.animation_loader.on_complete()
     self.interval_animation.stop()
     if node_js.getCurrentNodeJSVersion() == self.NODE_JS_VERSION:
         sublime.active_window().status_message(
             "Node.js " + self.NODE_JS_VERSION +
             " installed correctly! NPM version: " +
             npm.getCurrentNPMVersion())
     else:
         sublime.active_window().status_message(
             "Can't install Node.js! Something went wrong during installation."
         )