Explorar el Código

rmd_reader: Fix for python3

Python3 doesn't have has_key() for dict anymore, should use key in dict instead.
Jari Karppinen hace 9 años
padre
commit
9fb7987781
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      rmd_reader/rmd_reader.py

+ 3 - 3
rmd_reader/rmd_reader.py

@@ -32,15 +32,15 @@ def initsignal(pelicanobj):
         idx = knitr.opts_chunk.names.index('set')
         knitroptschunk = pelicanobj.settings.get('RMD_READER_KNITR_OPTS_CHUNK', None)
         if knitroptschunk:
-            fig_path = knitroptschunk['fig.path'] if knitroptschunk.has_key('fig.path') else 'figure/'
+            fig_path = knitroptschunk['fig.path'] if 'fig.path' in knitroptschunk else 'figure/'
             knitr.opts_chunk[idx](**{str(k): v for k,v in knitroptschunk.items()})
         rmd = True
     except ImportError as ex:
         rmd = False
-    
+
 class RmdReader(readers.BaseReader):
     file_extensions = ['Rmd', 'rmd']
-    
+
     @property
     def enabled():
         return rmd