mine 4.1__tar.gz → 4.2__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.
Files changed (32) hide show
  1. {mine-4.1 → mine-4.2}/PKG-INFO +1 -1
  2. {mine-4.1 → mine-4.2}/mine/models/application.py +1 -8
  3. {mine-4.1 → mine-4.2}/mine/models/data.py +7 -3
  4. {mine-4.1 → mine-4.2}/mine/services.py +2 -1
  5. {mine-4.1 → mine-4.2}/mine/tests/test_models_data.py +3 -5
  6. {mine-4.1 → mine-4.2}/pyproject.toml +1 -1
  7. {mine-4.1 → mine-4.2}/LICENSE.md +0 -0
  8. {mine-4.1 → mine-4.2}/README.md +0 -0
  9. {mine-4.1 → mine-4.2}/mine/__init__.py +0 -0
  10. {mine-4.1 → mine-4.2}/mine/cli.py +0 -0
  11. {mine-4.1 → mine-4.2}/mine/common.py +0 -0
  12. {mine-4.1 → mine-4.2}/mine/daemon.py +0 -0
  13. {mine-4.1 → mine-4.2}/mine/manager.py +0 -0
  14. {mine-4.1 → mine-4.2}/mine/models/__init__.py +0 -0
  15. {mine-4.1 → mine-4.2}/mine/models/computer.py +0 -0
  16. {mine-4.1 → mine-4.2}/mine/models/config.py +0 -0
  17. {mine-4.1 → mine-4.2}/mine/models/status.py +0 -0
  18. {mine-4.1 → mine-4.2}/mine/models/timestamp.py +0 -0
  19. {mine-4.1 → mine-4.2}/mine/settings.py +0 -0
  20. {mine-4.1 → mine-4.2}/mine/tests/__init__.py +0 -0
  21. {mine-4.1 → mine-4.2}/mine/tests/conftest.py +0 -0
  22. {mine-4.1 → mine-4.2}/mine/tests/files/.gitignore +0 -0
  23. {mine-4.1 → mine-4.2}/mine/tests/files/mine-in.yml +0 -0
  24. {mine-4.1 → mine-4.2}/mine/tests/files/mine-out.yml +0 -0
  25. {mine-4.1 → mine-4.2}/mine/tests/test_cli.py +0 -0
  26. {mine-4.1 → mine-4.2}/mine/tests/test_manager.py +0 -0
  27. {mine-4.1 → mine-4.2}/mine/tests/test_models_application.py +0 -0
  28. {mine-4.1 → mine-4.2}/mine/tests/test_models_computer.py +0 -0
  29. {mine-4.1 → mine-4.2}/mine/tests/test_models_config.py +0 -0
  30. {mine-4.1 → mine-4.2}/mine/tests/test_models_status.py +0 -0
  31. {mine-4.1 → mine-4.2}/mine/tests/test_models_timestamp.py +0 -0
  32. {mine-4.1 → mine-4.2}/mine/tests/test_services.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mine
3
- Version: 4.1
3
+ Version: 4.2
4
4
  Summary: Share application state across computers using Dropbox.
5
5
  Home-page: https://pypi.org/project/mine
6
6
  License: MIT
@@ -18,6 +18,7 @@ class Properties:
18
18
 
19
19
  auto_queue: bool = False
20
20
  single_instance: bool = False
21
+ keep_running: bool = False
21
22
 
22
23
 
23
24
  @dataclass
@@ -39,11 +40,3 @@ class Application:
39
40
 
40
41
  def __lt__(self, other):
41
42
  return str(self).lower() < str(other).lower()
42
-
43
- @property
44
- def auto_queue(self):
45
- return self.properties.auto_queue
46
-
47
- @property
48
- def no_wait(self):
49
- return not self.properties.single_instance
@@ -54,7 +54,7 @@ class Data:
54
54
  """Queue applications for launch."""
55
55
  log.info("Queuing applications for launch...")
56
56
  for application in self.config.applications:
57
- if application.auto_queue:
57
+ if application.properties.auto_queue:
58
58
  log.debug("Queuing %s on %s...", application, computer)
59
59
  self.status.queue(application, computer)
60
60
 
@@ -67,7 +67,10 @@ class Data:
67
67
  print(crayons.yellow(f"{application} is queued for {status.next}"))
68
68
  if status.next == computer:
69
69
  latest = self.status.get_latest(application)
70
- if latest in (computer, None) or application.no_wait:
70
+ if (
71
+ latest in (computer, None)
72
+ or not application.properties.single_instance
73
+ ):
71
74
  if not manager.is_running(application):
72
75
  manager.start(application)
73
76
  status.next = None
@@ -84,7 +87,8 @@ class Data:
84
87
  """Close all applications running on this computer."""
85
88
  log.info("Closing all applications on this computer...")
86
89
  for application in self.config.applications:
87
- manager.stop(application)
90
+ if not application.properties.keep_running:
91
+ manager.stop(application)
88
92
 
89
93
  def update_status(self, computer: Computer, manager: Manager):
90
94
  """Update each application's status."""
@@ -74,7 +74,8 @@ def delete_conflicts(root=None, config_only=False, force=False) -> int:
74
74
  path = os.path.join(dirname, filename)
75
75
  if force:
76
76
  os.remove(path)
77
- print(path)
77
+ if not config_only:
78
+ print(path)
78
79
 
79
80
  if count and not force:
80
81
  print(f"\nRun again with '--force' to delete these {count} conflict(s)")
@@ -10,7 +10,7 @@ def describe_data():
10
10
  @pytest.fixture
11
11
  def data(monkeypatch):
12
12
  monkeypatch.setattr(datafiles.settings, "HOOKS_ENABLED", False)
13
- return Data("../../tests/files/mine.yml")
13
+ return Data("tmp/mine.yml")
14
14
 
15
15
  def describe_repr():
16
16
  def it_should_always_be_a_simple_name(data: Data):
@@ -34,13 +34,11 @@ def describe_data():
34
34
 
35
35
  def describe_prune_status():
36
36
  def it_can_preserve_counter(data: Data):
37
- data.datafile.load() # type: ignore
38
- assert data.status.counter > 0
37
+ data.status.counter = 1
39
38
  data.prune_status()
40
39
  assert data.status.counter > 0
41
40
 
42
41
  def it_can_reset_counter(data: Data):
43
- data.datafile.load() # type: ignore
44
- assert data.status.counter > 0
42
+ data.status.counter = 1
45
43
  data.prune_status(reset_counter=True)
46
44
  assert data.status.counter == 0
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
 
3
3
  name = "mine"
4
- version = "4.1"
4
+ version = "4.2"
5
5
  description = "Share application state across computers using Dropbox."
6
6
 
7
7
  license = "MIT"
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
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
File without changes