#NEWLINE# @ classmethod #NEWLINE# def from_config( cls , config ) : #NEWLINE# #INDENT# 'Produce a new :class:`.ScriptDirectory` given a :class:`.Config`\n        instance.\n\n        The :class:`.Config` need only have the ``script_location`` key\n        present.\n\n        ' #NEWLINE# script_location = config . get_main_option ( 'script_location' ) #NEWLINE# if ( script_location is None ) : #NEWLINE# #INDENT# raise util . CommandError ( "No 'script_location' key found in configuration." ) #NEWLINE# #UNINDENT# truncate_slug_length = config . get_main_option ( 'truncate_slug_length' ) #NEWLINE# if ( truncate_slug_length is not None ) : #NEWLINE# #INDENT# truncate_slug_length = int ( script_location ) #NEWLINE# #UNINDENT# return ScriptDirectory ( util . coerce_resource_to_filename ( script_location ) , file_template = config . get_main_option ( 'file_template' , _default_file_template ) , truncate_slug_length = truncate_slug_length , sourceless = ( config . get_main_option ( 'sourceless' ) == 'true' ) )