Beispiel #1
0
    def get_host(self):
        from conf import settings

        if (
            "publicly_accessible" not in settings()["redshift_create_cluster"]
            or settings()["redshift_create_cluster"]["publicly_accessible"]
        ):
            return self.public_host
        else:
            return self.private_host
Beispiel #2
0
  def prompt(self):
    view = self.window.active_view()

    # Try to retrieve selected text or text around cursor
    selection = view.sel()
    issue_text = view.substr(view.word(selection[0]))

    # default hint is project prefix
    project_prefix = '{}-'.format(settings().get('jira_default_project', ''))
    issue_key_hint = project_prefix

    # But if there is some text under selected or under the cursor
    if issue_text:

      # And it starts with project prefix
      if (issue_text.startswith(project_prefix)
          and issue_text[len(project_prefix):].isdigit()):
        issue_key_hint = issue_text

      # Or is a number
      elif issue_text.isdigit():
        issue_key_hint = project_prefix + issue_text

    callback = lambda v: self.window.run_command('get_jira_issue',
                                                 {'issue_key': v})
    self.window.show_input_panel('Issue key', issue_key_hint, callback, None, None)
Beispiel #3
0
    def prompt(self):
        view = self.window.active_view()

        # Try to retrieve selected text or text around cursor
        selection = view.sel()
        issue_text = view.substr(view.word(selection[0]))

        # default hint is project prefix
        project_prefix = '{}-'.format(settings().get('jira_default_project',
                                                     ''))
        issue_key_hint = project_prefix

        # But if there is some text under selected or under the cursor
        if issue_text:

            # And it starts with project prefix
            if (issue_text.startswith(project_prefix)
                    and issue_text[len(project_prefix):].isdigit()):
                issue_key_hint = issue_text

            # Or is a number
            elif issue_text.isdigit():
                issue_key_hint = project_prefix + issue_text

        callback = lambda v: self.window.run_command('get_jira_issue',
                                                     {'issue_key': v})
        self.window.show_input_panel('Issue key', issue_key_hint, callback,
                                     None, None)
Beispiel #4
0
    def prompt(self, project, summary):

        if not project:
            self.window.show_input_panel(
                'Project',
                settings().get('jira_default_project', ''),
                lambda project: self.run(project=project), None, None)

        elif not summary:
            self.window.show_input_panel(
                'Summary', 'no summary',
                lambda summary: self.run(project=project, summary=summary),
                None, None)
Beispiel #5
0
    def prompt(self, project, summary):

        if not project:
            self.window.show_input_panel(
                "Project",
                settings().get("jira_default_project", ""),
                lambda project: self.run(project=project),
                None,
                None,
            )

        elif not summary:
            self.window.show_input_panel(
                "Summary", "no summary", lambda summary: self.run(project=project, summary=summary), None, None
            )
Beispiel #6
0
def runtests():
    """
    The test runner for setup.py test usage. This sets up
    a memory database with sqlite3 and runs the tests via
    the django test command.
    """
    from conf import settings
    settings = settings(
        DATABASE_ENGINE='sqlite3',
        DATABASE_NAME=':memory:',
    )

    from django.test.utils import get_runner
    test_runner = get_runner(settings)
    failures = test_runner([], verbosity=1, interactive=True)
    raise SystemExit(failures)
Beispiel #7
0
def runtests():
    """
    The test runner for setup.py test usage. This sets up
    a memory database with sqlite3 and runs the tests via
    the django test command.
    """
    from conf import settings
    settings = settings(
        DATABASE_ENGINE='sqlite3',
        DATABASE_NAME=':memory:',
    )

    from django.test.utils import get_runner
    test_runner = get_runner(settings)
    failures = test_runner([], verbosity=1, interactive=True)
    raise SystemExit(failures)
Beispiel #8
0
  def prompt(self, project, summary):

    if not project:
      self.window.show_input_panel(
        'Project',
        settings().get('jira_default_project', ''),
        lambda project: self.run(project=project),
        None,
        None      )

    elif not summary:
      self.window.show_input_panel(
        'Summary',
        'no summary',
        lambda summary: self.run(project=project, summary=summary),
        None,
        None
      )
Beispiel #9
0
 def load_config(self):
   return (
     settings().get('jira_login'),
     settings().get('jira_password'),
     {'server': settings().get('jira_server')}
   )
Beispiel #10
0
 def prompt(self):
     issue_key_hint = "{}-".format(settings().get("jira_default_project", ""))
     callback = lambda v: self.window.run_command("get_jira_issue", {"issue_key": v})
     self.window.show_input_panel("Issue key", issue_key_hint, callback, None, None)
Beispiel #11
0
 def load_config(self):
     return (settings().get('jira_login'), settings().get('jira_password'),
             {
                 'server': settings().get('jira_server')
             })
Beispiel #12
0
 def load_config(self):
     return (settings().get('jira_login'), settings().get('jira_password'),
             {
                 'server': settings().get('jira_server'),
                 'verify': settings().get('jira_verify') != 'False'
             })