File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ import  csv 
12import  os 
23import  pkgutil 
34import  json 
45
5- from  BaseClasses  import  MultiWorld , Item ,  Location 
6+ from  BaseClasses  import  MultiWorld , Item 
67from  typing  import  Optional , List , TYPE_CHECKING 
78from  worlds .AutoWorld  import  World 
89from  .hooks .Helpers  import  before_is_category_enabled , before_is_item_enabled , before_is_location_enabled 
@@ -24,6 +25,17 @@ def load_data_file(*args) -> dict:
2425
2526    return  filedata 
2627
28+ def  load_data_csv (* args ) ->  list [dict ]:
29+     fname  =  os .path .join ("data" , * args )
30+ 
31+     try :
32+         lines  =  pkgutil .get_data (__name__ , fname ).decode ().splitlines ()
33+     except :
34+         lines  =  []
35+     filedata  =  list (csv .DictReader (lines ))
36+ 
37+     return  filedata 
38+ 
2739def  is_option_enabled (multiworld : MultiWorld , player : int , name : str ) ->  bool :
2840    return  get_option_value (multiworld , player , name ) >  0 
2941
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments