

try:
    import flask_script
except ImportError:
    raise ImportError('Missing flask-script library (pip install flask-script)')


import subprocess

from flask_script import Command


class GenerateApiDoc(Command):
    def __init__(self, input_path=None, output_path=None, template_path=None):
        super().__init__()
        self.input_path = input_path
        self.output_path = output_path
        self.template_path = template_path

    def run(self):
        cmd = ['apidoc']

        if self.input_path:
            cmd.append('--input')
            cmd.append(self.input_path)

        if self.output_path:
            cmd.append('--output')
            cmd.append(self.output_path)

        if self.template_path:
            cmd.append('--template')
            cmd.append(self.template_path)

        return subprocess.call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)



try:
    import flask_script
except ImportError:
    raise ImportError('Missing flask-script library (pip install flask-script)')


import subprocess

from flask_script import Command


class GenerateApiDoc(Command):
    def __init__(self, input_path=None, output_path=None, template_path=None):
        super().__init__()
        self.input_path = input_path
        self.output_path = output_path or 'static/docs'
        self.template_path = template_path

    def run(self):
        cmd = ['apidoc']

        if self.input_path:
            cmd.append('--input')
            cmd.append(self.input_path)

        if self.output_path:
            cmd.append('--output')
            cmd.append(self.output_path)

        if self.template_path:
            cmd.append('--template')
            cmd.append(self.template_path)

        return subprocess.call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)

Set static/docs as the default folder to generate the apidoc's files
Set static/docs as the default folder to generate the apidoc's files

  
  
  try:
      import flask_script
  except ImportError:
      raise ImportError('Missing flask-script library (pip install flask-script)')
  
  
  import subprocess
  
  from flask_script import Command
  
  
  class GenerateApiDoc(Command):
      def __init__(self, input_path=None, output_path=None, template_path=None):
          super().__init__()
          self.input_path = input_path
-         self.output_path = output_path
+         self.output_path = output_path or 'static/docs'
          self.template_path = template_path
  
      def run(self):
          cmd = ['apidoc']
  
          if self.input_path:
              cmd.append('--input')
              cmd.append(self.input_path)
  
          if self.output_path:
              cmd.append('--output')
              cmd.append(self.output_path)
  
          if self.template_path:
              cmd.append('--template')
              cmd.append(self.template_path)
  
          return subprocess.call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
  
Set static/docs as the default folder to generate the apidoc's files
## Code Before:


try:
    import flask_script
except ImportError:
    raise ImportError('Missing flask-script library (pip install flask-script)')


import subprocess

from flask_script import Command


class GenerateApiDoc(Command):
    def __init__(self, input_path=None, output_path=None, template_path=None):
        super().__init__()
        self.input_path = input_path
        self.output_path = output_path
        self.template_path = template_path

    def run(self):
        cmd = ['apidoc']

        if self.input_path:
            cmd.append('--input')
            cmd.append(self.input_path)

        if self.output_path:
            cmd.append('--output')
            cmd.append(self.output_path)

        if self.template_path:
            cmd.append('--template')
            cmd.append(self.template_path)

        return subprocess.call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)

## Instruction:
Set static/docs as the default folder to generate the apidoc's files
## Code After:


try:
    import flask_script
except ImportError:
    raise ImportError('Missing flask-script library (pip install flask-script)')


import subprocess

from flask_script import Command


class GenerateApiDoc(Command):
    def __init__(self, input_path=None, output_path=None, template_path=None):
        super().__init__()
        self.input_path = input_path
        self.output_path = output_path or 'static/docs'
        self.template_path = template_path

    def run(self):
        cmd = ['apidoc']

        if self.input_path:
            cmd.append('--input')
            cmd.append(self.input_path)

        if self.output_path:
            cmd.append('--output')
            cmd.append(self.output_path)

        if self.template_path:
            cmd.append('--template')
            cmd.append(self.template_path)

        return subprocess.call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
