ソースを参照

HUE-8758 [notebook] Format Python style of base module

Romain 5 年 前
コミット
c23a0ff4ba
1 ファイル変更7 行追加6 行削除
  1. 7 6
      desktop/libs/notebook/src/notebook/connectors/base.py

+ 7 - 6
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -138,7 +138,7 @@ class Notebook(object):
         p2 = match.group(2)
         variable = variables[p2]
         value = smart_str(variable['value'])
-        return smart_str(p1) + smart_str(value if value is not None else variable['meta'].get('placeholder',''))
+        return smart_str(p1) + smart_str(value if value is not None else variable['meta'].get('placeholder', ''))
 
       return re.sub(
           "([^\\\\])\\$" + (
@@ -176,7 +176,7 @@ class Notebook(object):
     _data['snippets'].append(self._make_snippet({
         u'type': u'java',
         u'status': u'running',
-        u'properties':  {
+        u'properties': {
           u'files': files,
           u'class': clazz,
           u'app_jar': app_jar,
@@ -194,7 +194,7 @@ class Notebook(object):
     _data['snippets'].append(self._make_snippet({
         u'type': u'sqoop1',
         u'status': u'running',
-        u'properties':  {
+        u'properties': {
           u'files': files,
           u'arguments': arguments,
           u'archives': [],
@@ -211,7 +211,7 @@ class Notebook(object):
     _data['snippets'].append(self._make_snippet({
         u'type': u'spark',
         u'status': u'running',
-        u'properties':  {
+        u'properties': {
           u'files': files,
           u'class': clazz,
           u'app_jar': jars,
@@ -224,7 +224,8 @@ class Notebook(object):
 
     self.data = json.dumps(_data)
 
-  def add_shell_snippet(self, shell_command, arguments=None, archives=None, files=None, env_var=None, last_executed=None, capture_output=True):
+  def add_shell_snippet(self, shell_command, arguments=None, archives=None, files=None, env_var=None, last_executed=None,
+        capture_output=True):
     _data = json.loads(self.data)
 
     if arguments is None:
@@ -239,7 +240,7 @@ class Notebook(object):
     _data['snippets'].append(self._make_snippet({
         u'type': u'shell',
         u'status': u'running',
-        u'properties':  {
+        u'properties': {
           u'files': files,
           u'shell_command': shell_command,
           u'arguments': arguments,