libjam 0.0.7__tar.gz → 0.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libjam
3
- Version: 0.0.7
3
+ Version: 0.0.8
4
4
  Summary: A library jam for Python.
5
5
  Project-URL: Homepage, https://github.com/philippkosarev/libjam
6
6
  Project-URL: Issues, https://github.com/philippkosarev/libjam/issues
@@ -1,11 +1,13 @@
1
1
  # Imports
2
2
  import os, sys, shutil, send2trash, platform, tempfile, pathlib
3
- import zipfile, patoolib, rarfile
3
+ import zipfile, patoolib, rarfile, subprocess
4
4
  from .typewriter import Typewriter
5
5
  from .clipboard import Clipboard
6
6
  typewriter = Typewriter()
7
7
  clipboard = Clipboard()
8
8
 
9
+ PLATFORM = platform.system()
10
+
9
11
  # Internal functions
10
12
  joinpath = os.path.join
11
13
  def realpath(path: str or list):
@@ -348,6 +350,7 @@ class Drawer:
348
350
  try:
349
351
  size = 0
350
352
  if self.is_file(path):
353
+ path = realpath(path)
351
354
  size += os.path.getsize(path)
352
355
  elif self.is_folder(path):
353
356
  subfiles = self.get_files_recursive(path)
@@ -357,3 +360,15 @@ class Drawer:
357
360
  except KeyboardInterrupt:
358
361
  typewriter.print('Program aborted while gathering size of files.')
359
362
  sys.exit(1)
363
+
364
+ def open_path(self, path: str):
365
+ path = realpath(path)
366
+ if PLATFORM == 'Linux':
367
+ subprocess.run(['xdg-open', path])
368
+ elif PLATFORM == 'Windows':
369
+ subprocess.run(['start', path])
370
+ elif PLATFORM == 'Darwin':
371
+ subprocess.run(['open', path])
372
+ else:
373
+ return 1
374
+ return 0
@@ -14,7 +14,7 @@ include = [
14
14
 
15
15
  [project]
16
16
  name = "libjam"
17
- version = "0.0.7"
17
+ version = "0.0.8"
18
18
  authors = [
19
19
  { name="Philipp Kosarev", email="philipp.kosarev@gmail.com" },
20
20
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes