Эх сурвалжийг харах

[pylint] Fix bad-whitespace and long lines issues

Harshg999 4 жил өмнө
parent
commit
af1b300f8f

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 31 - 19
apps/filebrowser/src/filebrowser/views_test.py


+ 9 - 4
desktop/libs/aws/src/aws/s3/s3fs.py

@@ -48,7 +48,8 @@ else:
   from django.utils.translation import ugettext as _
 
 DEFAULT_READ_SIZE = 1024 * 1024  # 1MB
-BUCKET_NAME_PATTERN = re.compile("^((?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9])\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_\-]*[A-Za-z0-9]))$")
+BUCKET_NAME_PATTERN = re.compile(
+  "^((?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9])\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_\-]*[A-Za-z0-9]))$")
 
 LOG = logging.getLogger(__name__)
 
@@ -110,7 +111,9 @@ class S3FileSystem(object):
       return self._s3_connection.get_bucket(name, headers=self.header_values)
     except S3ResponseError as e:
       if e.status == 301 or e.status == 400:
-        raise S3FileSystemException(_('Failed to retrieve bucket "%s" in region "%s" with "%s". Your bucket is in region "%s"') % (name, self._get_location(), e.message or e.reason, self.get_bucket_location(name)))
+        raise S3FileSystemException(
+          _('Failed to retrieve bucket "%s" in region "%s" with "%s". Your bucket is in region "%s"') % 
+          (name, self._get_location(), e.message or e.reason, self.get_bucket_location(name)))
       else:
         raise e
 
@@ -308,12 +311,14 @@ class S3FileSystem(object):
 
     if S3FileSystem.isroot(path):
       try:
-        return sorted([S3Stat.from_bucket(b, self.fs) for b in self._s3_connection.get_all_buckets(headers=self.header_values)], key=lambda x: x.name)
+        return sorted(
+          [S3Stat.from_bucket(b, self.fs) for b in self._s3_connection.get_all_buckets(headers=self.header_values)], key=lambda x: x.name)
       except S3FileSystemException as e:
         raise e
       except S3ResponseError as e:
         if 'Forbidden' in str(e) or (hasattr(e, 'status') and e.status == 403):
-          raise S3ListAllBucketsException(_('You do not have permissions to list all buckets. Please specify a bucket name you have access to.'))
+          raise S3ListAllBucketsException(
+            _('You do not have permissions to list all buckets. Please specify a bucket name you have access to.'))
         else:
           raise S3FileSystemException(_('Failed to retrieve buckets: %s') % e.reason)
       except Exception as e:

+ 7 - 5
desktop/libs/azure/src/azure/abfs/__init__.py

@@ -32,7 +32,9 @@ from filebrowser.conf import REMOTE_STORAGE_HOME
 
 LOG = logging.getLogger(__name__)
 
-ABFS_PATH_RE = re.compile('^/*[aA][bB][fF][sS]{1,2}://([$a-z0-9](?!.*--)[-a-z0-9]{1,61}[a-z0-9])(@[^.]*?\.dfs\.core\.windows\.net)?(/(.*?)/?)?$') #check this first for problems
+#check this first for problems
+ABFS_PATH_RE = re.compile(
+  '^/*[aA][bB][fF][sS]{1,2}://([$a-z0-9](?!.*--)[-a-z0-9]{1,61}[a-z0-9])(@[^.]*?\.dfs\.core\.windows\.net)?(/(.*?)/?)?$')
 ABFS_ROOT_S = 'abfss://'
 ABFS_ROOT = 'abfs://'
 ABFSACCOUNT_NAME = re.compile('^/*[aA][bB][fF][sS]{1,2}://[$a-z0-9](?!.*--)[-a-z0-9]{1,61}[a-z0-9](@.*?)$')
@@ -115,14 +117,14 @@ def parent_path(path):
     return ABFS_ROOT
   else:
     x = only_filesystem_and_account_name(path)
-    if x !=path:
+    if x != path:
       filesystem = x
     parent = '/'.join(directory_name.split('/')[:-1])
   if path.lower().startswith(ABFS_ROOT):
     return normpath(ABFS_ROOT + filesystem + '/' + parent)
   return normpath(ABFS_ROOT_S + filesystem + '/' + parent)
 
-def join(first,*complist):
+def join(first, *complist):
   """
   Join a path on to another path
   """
@@ -142,7 +144,7 @@ def join(first,*complist):
   return joined
 
 
-def abfspath(path, fs_defaultfs = None):
+def abfspath(path, fs_defaultfs=None):
   """
   Converts a path to a path that the ABFS driver can use
   """
@@ -152,7 +154,7 @@ def abfspath(path, fs_defaultfs = None):
     except:
       LOG.warning("Configuration for ABFS is not set, may run into errors")
       return path
-  filesystem, dir_name = ("","")
+  filesystem, dir_name = ("", "")
   try:
     filesystem, dir_name = parse_uri(path)[:2]
   except:

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно