예제 #1
0
 def handle(self, *args, **options):
     include_apps = exclude_apps = exclude_packages = None
     if options['include_apps']:
         include_apps = options['include_apps'].split(',')
     if options['exclude_apps']:
         exclude_apps = options['exclude_apps'].split(',')
     if options['exclude_packages']:
         exclude_packages = options['exclude_packages'].split(',')
     verbosity = int(options['verbosity'])
     remove_isolate_nodes = options['remove_isolate_nodes']
     remove_sink_nodes = options['remove_sink_nodes']
     remove_source_nodes = options['remove_source_nodes']
     only_cyclic = options['only_cyclic']
     show_modules = options['show_modules']
     file_name = options['file_name']
     use_colors = options['use_colors']
     dotted_scope_local = options['dotted_scope_local']
     scope_global = options['scope_global']
     scope = scope_global and SCOPE_GLOBAL or None
     if not compatible_scope(dotted_scope_local, scope_global):
         raise InvalidOptions("The dotted-scope-local and scope-global are incompatibles")
     create_graph_apps_dependence(file_name=file_name,
                                  include_apps=include_apps,
                                  exclude_apps=exclude_apps,
                                  exclude_packages=exclude_packages,
                                  verbosity=verbosity,
                                  show_modules=show_modules,
                                  remove_isolate_nodes=remove_isolate_nodes,
                                  remove_sink_nodes=remove_sink_nodes,
                                  remove_source_nodes=remove_source_nodes,
                                  only_cyclic=only_cyclic,
                                  scope=scope,
                                  use_colors=use_colors,
                                  dotted_scope_local=dotted_scope_local)
예제 #2
0
 def handle(self, *args, **options):
     include_apps = exclude_apps = exclude_packages = None
     if options['include_apps']:
         include_apps = options['include_apps'].split(',')
     if options['exclude_apps']:
         exclude_apps = options['exclude_apps'].split(',')
     if options['exclude_packages']:
         exclude_packages = options['exclude_packages'].split(',')
     verbosity = int(options['verbosity'])
     remove_isolate_nodes = options['remove_isolate_nodes']
     remove_sink_nodes = options['remove_sink_nodes']
     remove_source_nodes = options['remove_source_nodes']
     only_cyclic = options['only_cyclic']
     show_modules = options['show_modules']
     file_name = options['file_name']
     use_colors = options['use_colors']
     dotted_scope_local = options['dotted_scope_local']
     scope_global = options['scope_global']
     scope = scope_global and SCOPE_GLOBAL or None
     if not compatible_scope(dotted_scope_local, scope_global):
         raise InvalidOptions(
             "The dotted-scope-local and scope-global are incompatibles")
     create_graph_apps_dependence(file_name=file_name,
                                  include_apps=include_apps,
                                  exclude_apps=exclude_apps,
                                  exclude_packages=exclude_packages,
                                  verbosity=verbosity,
                                  show_modules=show_modules,
                                  remove_isolate_nodes=remove_isolate_nodes,
                                  remove_sink_nodes=remove_sink_nodes,
                                  remove_source_nodes=remove_source_nodes,
                                  only_cyclic=only_cyclic,
                                  scope=scope,
                                  use_colors=use_colors,
                                  dotted_scope_local=dotted_scope_local)
예제 #3
0
 def detect_cyclic(self):
     applications = self.cleaned_data['applications']
     exclude_packages = self.cleaned_data['exclude_packages']
     verbosity = 1
     if settings.DEBUG:
         verbosity = 2
     show_modules = self.cleaned_data['show_modules']
     remove_isolate_nodes = self.cleaned_data['remove_isolate_nodes']
     remove_sink_nodes = self.cleaned_data['remove_sink_nodes']
     remove_source_nodes = self.cleaned_data['remove_source_nodes']
     only_cyclic = self.cleaned_data['only_cyclic']
     scope_global = self.cleaned_data['scope_global']
     layout = self.cleaned_data['layout']
     scope = None
     if scope_global:
         scope = SCOPE_GLOBAL
     use_colors = self.cleaned_data['use_colors']
     dotted_scope_local = self.cleaned_data['dotted_scope_local']
     file_name = self.cleaned_data['file_name']
     if file_name:
         graph_dir = os.path.join(settings.MEDIA_ROOT, 'graph')
         if not os.path.isdir(graph_dir):
             os.mkdir(graph_dir)
         format_path = self.cleaned_data['format']
         if format_path == FORMAT_SPECIAL:
             format_path = 'svg'
         file_name = str(
             os.path.join(graph_dir, '%s.%s' % (file_name, format_path)))
     else:
         use_colors = True
     gr = create_graph_apps_dependence(
         file_name=file_name,
         include_apps=applications,
         exclude_apps=None,
         exclude_packages=exclude_packages,
         verbosity=verbosity,
         show_modules=show_modules,
         remove_isolate_nodes=remove_isolate_nodes,
         remove_sink_nodes=remove_sink_nodes,
         remove_source_nodes=remove_source_nodes,
         only_cyclic=only_cyclic,
         scope=scope,
         use_colors=use_colors,
         dotted_scope_local=dotted_scope_local,
         layout=layout)
     return (gr, file_name)
예제 #4
0
 def detect_cyclic(self):
     applications = self.cleaned_data['applications']
     exclude_packages = self.cleaned_data['exclude_packages']
     verbosity = 1
     if settings.DEBUG:
         verbosity = 2
     show_modules = self.cleaned_data['show_modules']
     remove_isolate_nodes = self.cleaned_data['remove_isolate_nodes']
     remove_sink_nodes = self.cleaned_data['remove_sink_nodes']
     remove_source_nodes = self.cleaned_data['remove_source_nodes']
     only_cyclic = self.cleaned_data['only_cyclic']
     scope_global = self.cleaned_data['scope_global']
     layout = self.cleaned_data['layout']
     scope = None
     if scope_global:
         scope = SCOPE_GLOBAL
     use_colors = self.cleaned_data['use_colors']
     dotted_scope_local = self.cleaned_data['dotted_scope_local']
     file_name = self.cleaned_data['file_name']
     if file_name:
         graph_dir = os.path.join(settings.MEDIA_ROOT, 'graph')
         if not os.path.isdir(graph_dir):
             os.mkdir(graph_dir)
         format_path = self.cleaned_data['format']
         if format_path == FORMAT_SPECIAL:
             format_path = 'svg'
         file_name = str(os.path.join(graph_dir,
                         '%s.%s' % (file_name, format_path)))
     else:
         use_colors = True
     gr = create_graph_apps_dependence(file_name=file_name, include_apps=applications,
                                     exclude_apps=None, exclude_packages=exclude_packages,
                                     verbosity=verbosity, show_modules=show_modules,
                                     remove_isolate_nodes=remove_isolate_nodes,
                                     remove_sink_nodes=remove_sink_nodes,
                                     remove_source_nodes=remove_source_nodes,
                                     only_cyclic=only_cyclic, scope=scope,
                                     use_colors=use_colors,
                                     dotted_scope_local=dotted_scope_local,
                                     layout=layout)
     return (gr, file_name)