28
28
29
29
logger = logging .getLogger (__name__ )
30
30
31
- DEFAULT_FORMATS = dict ( html = " svg" , latex = " pdf" , text = None )
31
+ DEFAULT_FORMATS = { " html" : " svg" , " latex" : " pdf" , " text" : None }
32
32
33
33
34
34
def merge_dict (dst , src ):
@@ -58,21 +58,21 @@ class AafigDirective(images.Image):
58
58
59
59
has_content = True
60
60
required_arguments = 0
61
- own_option_spec = dict (
62
- line_width = float ,
63
- background = str ,
64
- foreground = str ,
65
- fill = str ,
66
- aspect = nonnegative_int ,
67
- textual = flag ,
68
- proportional = flag ,
69
- )
61
+ own_option_spec = {
62
+ " line_width" : float ,
63
+ " background" : str ,
64
+ " foreground" : str ,
65
+ " fill" : str ,
66
+ " aspect" : nonnegative_int ,
67
+ " textual" : flag ,
68
+ " proportional" : flag ,
69
+ }
70
70
option_spec = images .Image .option_spec .copy ()
71
71
option_spec .update (own_option_spec )
72
72
73
73
def run (self ):
74
- aafig_options = dict ()
75
- own_options_keys = [self .own_option_spec .keys ()] + [ "scale" ]
74
+ aafig_options = {}
75
+ own_options_keys = [self .own_option_spec .keys (), "scale" ]
76
76
for (k , v ) in self .options .items ():
77
77
if k in own_options_keys :
78
78
# convert flags to booleans
@@ -88,7 +88,7 @@ def run(self):
88
88
if isinstance (image_node , nodes .system_message ):
89
89
return [image_node ]
90
90
text = "\n " .join (self .content )
91
- image_node .aafig = dict ( options = aafig_options , text = text )
91
+ image_node .aafig = { " options" : aafig_options , " text" : text }
92
92
return [image_node ]
93
93
94
94
@@ -206,7 +206,7 @@ def setup(app):
206
206
app .add_directive ("aafig" , AafigDirective )
207
207
app .connect ("doctree-read" , render_aafig_images )
208
208
app .add_config_value ("aafig_format" , DEFAULT_FORMATS , "html" )
209
- app .add_config_value ("aafig_default_options" , dict () , "html" )
209
+ app .add_config_value ("aafig_default_options" , {} , "html" )
210
210
211
211
212
212
# vim: set expandtab shiftwidth=4 softtabstop=4 :
0 commit comments