jemole / drScratch

drScratch is an analytical tool that evaluates your Scratch projects in a variety of computational areas to provide feedback on aspects such as abstraction, logical thinking, synchronization, parallelization, flow control, user interactivity and data representation. This analyzer is a helpful tool to evaluate your own projects, or those of your Scratch students.
35 stars 27 forks source link

[ V-Offline(Progracademy) ] - problem with the function os.popen().read() #6

Closed BenjDeveloper closed 6 years ago

BenjDeveloper commented 6 years ago

os.popen().read() returns an empty string which generates an error in the "procMastery()" function when accessing a memory location in a vector that has a size of 0.

function call in ( app/view.py -> line 1067 ) dictionary.update(procMastery(request,resultMastery, fileName))

def procMastery (request, lines, fileName):      "" "Mastery" ""      dic = {}      lLines = lines.split ('\ n') # lines is empty      d = {}      d = ast.literal_eval (lLines [1]) #ERROR position not exist, len(lLines) == 0 ( app/view.py -> line 1122 ) ....

Development environment

gregoriorobles commented 6 years ago

This is a problem with the hairball output.

What is the output of running "hairball -p mastery.Mastery filename" where filename is the zip as returned from "http://drscratch.cloudapp.net:8080/" + idProject?

BenjDeveloper commented 6 years ago

thanks @gregoriorobles for your contribution now using the version of hairball - 0.1rc2 kurt - 2.0.0

the answer when running the next command in console just to test hairball $ hairball -p mastery.Mastery C:\Users\Ben\15832807.sb2

Traceback (most recent call last):    File "C: \ Python27 \ Scripts \ hairball-script.py", line 11, in      load_entry_point ('hairball == 0.1rc2', 'console_scripts', 'hairball') ()    File "c: \ python27 \ lib \ site-packages \ hairball \ init.py", line 151, in main      hairball = Hairball (sys.argv [1:])    File "c: \ python27 \ lib \ site-packages \ hairball \ init.py", line 63, in init      for kurt_plugin in self.options.kurt_plugin: TypeError: 'NoneType' object is not iterable

how i should pass the command or if you know of a tutorial for those technical details would be very helpful

gregoriorobles commented 6 years ago

The Hairball version we use in Dr. Scratch's web is this fork: https://github.com/jemole/hairball

Let me know if the problem persists (and in that case, the output of running hairball).

BenjDeveloper commented 6 years ago

with this version (https://github.com/jemole/hairball) hairball-0.3 kurt-2.0.7

when I use the command: $ hairball -p mastery.Mastery C:\Users\Ben\15832807.sb2

the answer

Can not find plugin mastery.Mastery No plugins loaded. Goodbye!

for this reason it was that I tried to try other versions even though reviewing that fork of hairball I saw these details which confuse me a bit

Available Plugins Below are a list of available plugins that can be used as the -p PLUGIN_NAME option: blocks.BlockCounts blocks.DeadCode checks.Animation (not fully tested) checks.BroadcastReceive checks.SaySoundSync (not fully tested) initialization.AttributeInitialization initialization.VariableInitialization (not fully tested) Note: The output for each plugin is not yet completely standardized. Please feel free to file any issues or make improvements and send pull requests.

jemole commented 6 years ago

Solution to this issue in https://github.com/jemole/drScratch/issues/7