missionpanel 1.2.6__tar.gz → 1.2.7__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 (24) hide show
  1. {missionpanel-1.2.6 → missionpanel-1.2.7}/PKG-INFO +1 -1
  2. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/example/subprocess.py +14 -7
  3. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel.egg-info/PKG-INFO +1 -1
  4. {missionpanel-1.2.6 → missionpanel-1.2.7}/setup.py +1 -1
  5. {missionpanel-1.2.6 → missionpanel-1.2.7}/LICENSE +0 -0
  6. {missionpanel-1.2.6 → missionpanel-1.2.7}/README.md +0 -0
  7. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/__init__.py +0 -0
  8. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/example/__init__.py +0 -0
  9. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/example/rsshub.py +0 -0
  10. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/example/ttrss.py +0 -0
  11. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/handler/__init__.py +0 -0
  12. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/handler/handler.py +0 -0
  13. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/orm/__init__.py +0 -0
  14. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/orm/core.py +0 -0
  15. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/orm/handler.py +0 -0
  16. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/submitter/__init__.py +0 -0
  17. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/submitter/abc.py +0 -0
  18. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/submitter/asynchronous.py +0 -0
  19. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel/submitter/submitter.py +0 -0
  20. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel.egg-info/SOURCES.txt +0 -0
  21. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel.egg-info/dependency_links.txt +0 -0
  22. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel.egg-info/requires.txt +0 -0
  23. {missionpanel-1.2.6 → missionpanel-1.2.7}/missionpanel.egg-info/top_level.txt +0 -0
  24. {missionpanel-1.2.6 → missionpanel-1.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: missionpanel
3
- Version: 1.2.6
3
+ Version: 1.2.7
4
4
  Summary: A mission panel
5
5
  Home-page: https://github.com/yindaheng98/missionpanel
6
6
  Author: yindaheng98
@@ -1,6 +1,7 @@
1
1
  import abc
2
2
  import asyncio
3
3
  import logging
4
+ import chardet
4
5
  from typing import List, Callable
5
6
  from missionpanel.handler import AsyncHandler
6
7
  from missionpanel.orm.core import Mission
@@ -13,21 +14,27 @@ class SubprocessAsyncHandler(AsyncHandler, abc.ABC):
13
14
 
14
15
  async def __readline_info(self, f):
15
16
  async for line in f:
16
- self.getLogger().info(
17
- 'stdout | %s' % line.strip())
17
+ try:
18
+ line = line.decode(chardet.detect(line)['encoding']).strip()
19
+ except UnicodeDecodeError:
20
+ line = line.strip()
21
+ self.getLogger().info('stdout | %s' % line)
18
22
 
19
23
  async def __readline_debug(self, f):
20
24
  async for line in f:
21
- self.getLogger().info(
22
- 'stderr | %s' % line.strip())
25
+ try:
26
+ line = line.decode(chardet.detect(line)['encoding']).strip()
27
+ except UnicodeDecodeError:
28
+ line = line.strip()
29
+ self.getLogger().info('stderr | %s' % line)
23
30
 
24
31
  @abc.abstractmethod
25
- async def construct_command(self, mission: Mission, attempt: Attempt) -> str:
32
+ async def construct_command(self, mission: Mission, attempt: Attempt) -> List[str]:
26
33
  raise NotImplementedError("Subclasses must implement construct_command")
27
34
 
28
35
  async def execute_mission(self, mission: Mission, attempt: Attempt) -> bool:
29
- proc = await asyncio.create_subprocess_shell(
30
- await self.construct_command(mission, attempt),
36
+ proc = await asyncio.create_subprocess_exec(
37
+ *(await self.construct_command(mission, attempt)),
31
38
  stdout=asyncio.subprocess.PIPE,
32
39
  stderr=asyncio.subprocess.PIPE)
33
40
  await asyncio.gather(self.__readline_info(proc.stdout), self.__readline_debug(proc.stderr))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: missionpanel
3
- Version: 1.2.6
3
+ Version: 1.2.7
4
4
  Summary: A mission panel
5
5
  Home-page: https://github.com/yindaheng98/missionpanel
6
6
  Author: yindaheng98
@@ -12,7 +12,7 @@ package_dir = {
12
12
 
13
13
  setup(
14
14
  name='missionpanel',
15
- version='1.2.6',
15
+ version='1.2.7',
16
16
  author='yindaheng98',
17
17
  author_email='yindaheng98@gmail.com',
18
18
  url='https://github.com/yindaheng98/missionpanel',
File without changes
File without changes
File without changes