Module Expr Str Import alias Import alias alias Assign NameStore ListLoad ListLoad Str ListLoad Str Str ListLoad Str Str ListLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Break If BoolOpOr CompareGt Call NameLoad NameLoad Num CompareGt Call NameLoad NameLoad Num body Return NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num orelse Print BinOpMod Str SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Num If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Print BinOpMod Str NameLoad Assign NameStore NameLoad orelse If Call NameLoad NameLoad body Print BinOpMod Str NameLoad Assign NameStore NameLoad orelse Print BinOpMod Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Print BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Assign NameStore NameLoad If UnaryOpNot NameLoad body Print Str For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Print Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Print BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Print Str orelse Print Str Expr Call AttributeLoad NameLoad attr Num
N/A N/A  This will create the media_dir directory structure required by vistrails
server when used as a remote server with crowdlabs (www.crowdlabs.org) 

usage: python create_server_media_dir_structure.py /path/to/media_dir

If media_dir does not exist, it will be created.

 N/A sys N/A os os.path N/A folders N/A N/A wf_execution N/A graphs workflows N/A graphs vistrails N/A medleys images path_exists_and_not_empty N/A N/A path N/A N/A N/A path_exists_and_not_empty(path:str) -> boolean 
    Returns True if given path exists and it's not empty, otherwise returns 
    False.
    
     N/A N/A N/A N/A os path exists path N/A N/A N/A root dirs file_names N/A N/A os walk path N/A N/A N/A N/A N/A N/A len file_names 0 N/A N/A len dirs 0 N/A N/A True N/A False N/A N/A N/A __name__ __main__ N/A N/A args N/A sys argv N/A error False N/A N/A N/A len args 2 N/A N/A media_dir N/A args N/A 1 N/A N/A N/A Usage: %s /path/to/media_dir N/A args N/A 0 N/A N/A N/A sys exit 0 N/A N/A N/A N/A os path exists media_dir N/A N/A N/A N/A N/A N/A os path isdir media_dir N/A N/A N/A Error: %s exists and it is not a directory. media_dir N/A error True N/A N/A N/A path_exists_and_not_empty media_dir N/A N/A N/A Error: %s exists and it is not empty.  media_dir N/A error True N/A N/A N/A %s does not exist. Trying to create directory... media_dir N/A N/A N/A N/A N/A os mkdir media_dir N/A N/A N/A Exception N/A e N/A N/A N/A Error creating %s directory: %s N/A media_dir N/A str e N/A error True N/A N/A error N/A N/A Creating inner structure...  N/A path_list folders N/A N/A folder N/A N/A N/A os path join media_dir N/A N/A N/A os path join path_list N/A folder N/A N/A N/A N/A N/A os makedirs folder N/A N/A N/A Exception N/A e N/A N/A N/A Error creating %s directory: %s N/A folder N/A str e N/A Done. N/A N/A There was an error. Please check the messages above.  N/A N/A N/A sys exit 1