Skip to content

Commit 3b6199f

Browse files
committed
Update README, define xcloud-client script entry-point
1 parent f9af632 commit 3b6199f

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# XCloud, XHome and SmartGlass
22

3+
## Status
4+
5+
Work-in-progress research codebase
6+
37
## Preparation
48

59
As usual, create a python venv
@@ -13,14 +17,15 @@ And install the dependencies
1317

1418
```sh
1519
pip install -r requirements.txt
20+
pip install .
1621
```
1722

1823
## Usage
1924

2025
You can invoke 3 different parts of the script
2126

2227
```sh
23-
python -m main smartglass
24-
python -m main xhome
25-
python -m main xcloud
28+
xcloud-client smartglass
29+
xcloud-client xhome
30+
xcloud-client xcloud
2631
```

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
author_email='noreply@openxbox.org',
1111
url='https://github.com/OpenXbox/xcloud-python',
1212
packages=find_packages(),
13-
entry_points={'console_scripts': ['xcloud-pcap-reader=xcloud.scripts.pcap_reader:main']},
13+
entry_points={
14+
'console_scripts': [
15+
'xcloud-pcap-reader=xcloud.scripts.pcap_reader:main',
16+
'xcloud-client=xcloud.scripts.client:main'
17+
]
18+
},
1419
install_requires=[
1520
"ecdsa",
1621
"ms_cv",

xcloud/main.py renamed to xcloud/scripts/client.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import time
55
import asyncio
66

7-
from .common import AppConfiguration
7+
from ..common import AppConfiguration
88

9-
from .auth.constants import IOS_XBOXBETA_APP_PARAMS, ANDROID_GAMEPASS_BETA_PARAMS
10-
from .auth.models import XalClientParameters, XSTSResponse
11-
from .auth.xal_auth import XalAuthenticator
12-
from .auth.request_signer import RequestSigner
9+
from ..auth.constants import IOS_XBOXBETA_APP_PARAMS, ANDROID_GAMEPASS_BETA_PARAMS
10+
from ..auth.models import XalClientParameters, XSTSResponse
11+
from ..auth.xal_auth import XalAuthenticator
12+
from ..auth.request_signer import RequestSigner
1313

14-
from .smartglass_api import SmartglassApi
15-
from .xcloud_api import XCloudApi
16-
from .xhomestreaming_api import XHomeStreamingApi
14+
from ..smartglass_api import SmartglassApi
15+
from ..xcloud_api import XCloudApi
16+
from ..xhomestreaming_api import XHomeStreamingApi
1717

1818
APP_CONFIG_XBOXBETA_FILE = "appconfig.xboxbeta.json"
1919
APP_CONFIG_XBOXGAMEPASS_FILE = "appconfig.xboxgamepass.json"
@@ -96,7 +96,7 @@ async def test_xcloud_streaming(
9696
await xhome_api.session.aclose()
9797

9898

99-
async def main(command: str):
99+
async def async_main(command: str):
100100
"""
101101
Prepare needed values
102102
"""
@@ -165,8 +165,7 @@ async def main(command: str):
165165
elif command == 'xcloud':
166166
await test_xcloud_streaming(config)
167167

168-
169-
if __name__ == '__main__':
168+
def main():
170169
if len(sys.argv) < 2:
171170
print(':: Please provide a command! Choices: smartglass, xhome, xcloud')
172171
sys.exit(1)
@@ -176,4 +175,7 @@ async def main(command: str):
176175
print(':: You provided an invalid command!')
177176
sys.exit(2)
178177

179-
asyncio.run(main(command))
178+
asyncio.run(async_main(command))
179+
180+
if __name__ == '__main__':
181+
main()

0 commit comments

Comments
 (0)