codexctl 0.4.0__tar.gz → 1.1.0__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.
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.1
2
+ Name: codexctl
3
+ Version: 1.1.0
4
+ Summary: Automated update managment for the ReMarkable tablet
5
+ License: GPLv3
6
+ Author: Jayy001
7
+ Author-email: github@skii.dev
8
+ Requires-Python: >=3.12,<4.0
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: loguru (==0.7.2)
13
+ Requires-Dist: paramiko (==3.4.1)
14
+ Requires-Dist: psutil (==6.0.0)
15
+ Requires-Dist: remarkable-update-fuse (==1.1.2) ; sys_platform == "linux"
16
+ Requires-Dist: remarkable-update-image (==1.1.3) ; sys_platform != "linux"
17
+ Requires-Dist: requests (==2.31.0)
18
+ Description-Content-Type: text/markdown
19
+
20
+
21
+
22
+ # Codexctl
23
+ A utility program that helps to manage the remarkable device version utilizing [ddvks update server](https://github.com/ddvk/remarkable-update)
24
+
25
+ ## Caveat for downgrading to a version below 3.11
26
+
27
+ If your reMarkable device is above 3.11 and you want to downgrade to a version below 3.11, codexctl cannot do this currently. Please refer to #71 for manual instructions.
28
+
29
+ ## Installation
30
+
31
+ You can find pre-compiled binaries on the [releases](https://github.com/Jayy001/codexctl/releases/) page. This includes a build for the reMarkable itself, as well as well as builds for linux, macOS, and Windows. Alternatively, you can install directly from pypi with `pip install codexctl`. Codexctl currently only has support for a **command line interfaces** but a graphical interface is soon to come.
32
+
33
+ Finally, if you want to build it yourself, you can run `make executable` which requires python 3.11 or newer, python-venv and pip. Linux also requires libfuse-dev.
34
+
35
+ ## General useage
36
+
37
+ ```
38
+ ❯ codexctl --help
39
+ usage: Codexctl [-h] [--verbose] [--address ADDRESS] [--password PASSWORD]
40
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list} ...
41
+
42
+ positional arguments:
43
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list}
44
+ install Install the specified version (will download if not available on the device)
45
+ download Download the specified version firmware file
46
+ backup Download remote files to local directory
47
+ cat Cat the contents of a file inside a firmware image
48
+ ls List files inside a firmware image
49
+ extract Extract the specified version firmware file
50
+ mount Mount the specified version firmware filesystem
51
+ upload Upload folder/files to device (pdf only)
52
+ status Get the current version of the device and other information
53
+ restore Restores to previous version installed on device
54
+ list List all available versions
55
+
56
+ options:
57
+ -h, --help show this help message and exit
58
+ --verbose, -v Enable verbose logging
59
+ --address ADDRESS, -a ADDRESS
60
+ Specify the address of the device
61
+ --password PASSWORD, -p PASSWORD
62
+ Specify password or path to SSH key for remote access
63
+ ```
64
+
65
+ ## Examples
66
+ - Installing the latest for device (will automatically figure out the version)
67
+ ```
68
+ codexctl install latest
69
+ ```
70
+ - Downloading rmpp version 3.15.4.2 to a folder named `out` and then installing it
71
+ ```
72
+ codexctl download 3.15.4.2 -hw rmpp -o out
73
+ codexctl install ./out/remarkable-ct-prototype-image-3.15.4.2-ferrari-public.swu
74
+ ```
75
+ - Backing up all documents to the cwd
76
+ ```
77
+ codexctl backup
78
+ ```
79
+ - Backing up only documents in a folder named "FM" to cwd, without overwriting any current files
80
+ ```
81
+ codexctl backup -l root -r FM --no-recursion --no-overwrite
82
+ ```
83
+ - Getting the version of the device and then switching to previous version (restore only for rm1/rm2)
84
+ ```
85
+ codexctl status
86
+ codexctl restore
87
+ ```
88
+ - Download 3.8.0.1944 for rm2, then cat the /etc/version file from it
89
+ ```
90
+ codexctl download 3.8.0.1944 --hardware rm2
91
+ codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version
92
+ ```
93
+
94
+
95
+
96
+
@@ -0,0 +1,76 @@
1
+
2
+
3
+ # Codexctl
4
+ A utility program that helps to manage the remarkable device version utilizing [ddvks update server](https://github.com/ddvk/remarkable-update)
5
+
6
+ ## Caveat for downgrading to a version below 3.11
7
+
8
+ If your reMarkable device is above 3.11 and you want to downgrade to a version below 3.11, codexctl cannot do this currently. Please refer to #71 for manual instructions.
9
+
10
+ ## Installation
11
+
12
+ You can find pre-compiled binaries on the [releases](https://github.com/Jayy001/codexctl/releases/) page. This includes a build for the reMarkable itself, as well as well as builds for linux, macOS, and Windows. Alternatively, you can install directly from pypi with `pip install codexctl`. Codexctl currently only has support for a **command line interfaces** but a graphical interface is soon to come.
13
+
14
+ Finally, if you want to build it yourself, you can run `make executable` which requires python 3.11 or newer, python-venv and pip. Linux also requires libfuse-dev.
15
+
16
+ ## General useage
17
+
18
+ ```
19
+ ❯ codexctl --help
20
+ usage: Codexctl [-h] [--verbose] [--address ADDRESS] [--password PASSWORD]
21
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list} ...
22
+
23
+ positional arguments:
24
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list}
25
+ install Install the specified version (will download if not available on the device)
26
+ download Download the specified version firmware file
27
+ backup Download remote files to local directory
28
+ cat Cat the contents of a file inside a firmware image
29
+ ls List files inside a firmware image
30
+ extract Extract the specified version firmware file
31
+ mount Mount the specified version firmware filesystem
32
+ upload Upload folder/files to device (pdf only)
33
+ status Get the current version of the device and other information
34
+ restore Restores to previous version installed on device
35
+ list List all available versions
36
+
37
+ options:
38
+ -h, --help show this help message and exit
39
+ --verbose, -v Enable verbose logging
40
+ --address ADDRESS, -a ADDRESS
41
+ Specify the address of the device
42
+ --password PASSWORD, -p PASSWORD
43
+ Specify password or path to SSH key for remote access
44
+ ```
45
+
46
+ ## Examples
47
+ - Installing the latest for device (will automatically figure out the version)
48
+ ```
49
+ codexctl install latest
50
+ ```
51
+ - Downloading rmpp version 3.15.4.2 to a folder named `out` and then installing it
52
+ ```
53
+ codexctl download 3.15.4.2 -hw rmpp -o out
54
+ codexctl install ./out/remarkable-ct-prototype-image-3.15.4.2-ferrari-public.swu
55
+ ```
56
+ - Backing up all documents to the cwd
57
+ ```
58
+ codexctl backup
59
+ ```
60
+ - Backing up only documents in a folder named "FM" to cwd, without overwriting any current files
61
+ ```
62
+ codexctl backup -l root -r FM --no-recursion --no-overwrite
63
+ ```
64
+ - Getting the version of the device and then switching to previous version (restore only for rm1/rm2)
65
+ ```
66
+ codexctl status
67
+ codexctl restore
68
+ ```
69
+ - Download 3.8.0.1944 for rm2, then cat the /etc/version file from it
70
+ ```
71
+ codexctl download 3.8.0.1944 --hardware rm2
72
+ codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version
73
+ ```
74
+
75
+
76
+
@@ -135,7 +135,7 @@ class Manager:
135
135
  print(f"{args['target_path']}: No such file or directory")
136
136
  raise FileNotFoundError
137
137
 
138
- except OSError:
138
+ except OSError as e:
139
139
  print(f"{args['target_path']}: {os.strerror(e.errno)}")
140
140
  sys.exit(e.errno)
141
141
 
@@ -165,6 +165,16 @@ class Manager:
165
165
  else:
166
166
  rmWeb.upload(input_paths=args["paths"], remoteFolder=args["remote"])
167
167
 
168
+ ### Transfer & Download functionalities
169
+ elif function in ("transfer", "download"):
170
+ remarkable = DeviceManager(
171
+ remote=remote,
172
+ address=args["address"],
173
+ logger=self.logger,
174
+ authentication=args["password"],
175
+ )
176
+
177
+
168
178
  ### Update & Version functionalities
169
179
  elif function in ("install", "status", "restore"):
170
180
  remote = False
@@ -202,6 +212,8 @@ class Manager:
202
212
  )
203
213
 
204
214
  elif function == "restore":
215
+ if remarkable.hardware == "ferrari":
216
+ raise SystemError("Restore not available for rmpro.")
205
217
  remarkable.restore_previous_version()
206
218
  print(
207
219
  f"Device restored to previous version [{remarkable.get_device_status()[1]}]"
@@ -253,9 +265,6 @@ class Manager:
253
265
 
254
266
  #############################################################
255
267
 
256
- update_file_requires_new_engine = False
257
- device_version_uses_new_engine = False
258
-
259
268
  if not update_file_requires_new_engine:
260
269
  if update_file: # Check if file exists
261
270
  if not (os.path.dirname(os.path.abspath(update_file)) == os.path.abspath("updates")):
@@ -381,13 +390,13 @@ def main() -> None:
381
390
 
382
391
  ### Cat subcommand
383
392
  cat = subparsers.add_parser(
384
- "cat", help="Cat the contents of a file inside an update image"
393
+ "cat", help="Cat the contents of a file inside a firmwareimage"
385
394
  )
386
395
  cat.add_argument("file", help="Path to update file to cat", default=None)
387
396
  cat.add_argument("target_path", help="Path inside the image to list", default=None)
388
397
 
389
398
  ### Ls subcommand
390
- ls = subparsers.add_parser("ls", help="List files inside an update image")
399
+ ls = subparsers.add_parser("ls", help="List files inside a firmware image")
391
400
  ls.add_argument("file", help="Path to update file to extract", default=None)
392
401
  ls.add_argument("target_path", help="Path inside the image to list", default=None)
393
402
 
@@ -1,4 +1,7 @@
1
1
  import ext4
2
+ import warnings
3
+ import errno
4
+
2
5
  from remarkable_update_image import UpdateImage
3
6
  from remarkable_update_image import UpdateImageSignatureException
4
7
 
@@ -592,11 +592,11 @@ echo "fallback: ${OLDPART}"
592
592
 
593
593
  print("Trying to connect to device")
594
594
 
595
- while not self.check_is_address_reachable(address):
595
+ while not self.check_is_address_reachable(self.address):
596
596
  time.sleep(1)
597
597
 
598
598
  self.client = self.connect_to_device(
599
- remote_address=address, authentication=authentication
599
+ remote_address=self.address, authentication=self.authentication
600
600
  )
601
601
  self.client.exec_command("systemctl stop update-engine")
602
602
 
@@ -153,7 +153,7 @@ class RmWebInterfaceAPI: # TODO: Add docstrings
153
153
  folderId = self.__get_folder_id(remoteFolder)
154
154
 
155
155
  if folderId is None:
156
- raise SystemExit(f"Error: Folder {remoteFolder} does not exist!")
156
+ raise SystemError(f"Error: Folder {remoteFolder} does not exist!")
157
157
 
158
158
  self.__POST(f"documents/{folderId}") # Setting up for upload...
159
159
 
@@ -22,7 +22,7 @@ class UpdateManager:
22
22
 
23
23
  self.logger = logger
24
24
 
25
- if logging is None:
25
+ if self.logger is None:
26
26
  self.logger = logging
27
27
 
28
28
  (
@@ -47,7 +47,7 @@ class UpdateManager:
47
47
  else:
48
48
  if os.name == "nt": # Windows
49
49
  folder_location = os.getenv("APPDATA") + "/codexctl"
50
- elif os.name == "posix" or "darwin": # Linux or MacOS
50
+ elif os.name in ("posix", "darwin"): # Linux or MacOS
51
51
  folder_location = os.path.expanduser("~/.config/codexctl")
52
52
  else:
53
53
  raise SystemError("Unsupported OS")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "codexctl"
3
- version = "0.4.0"
3
+ version = "1.1.0"
4
4
  description = "Automated update managment for the ReMarkable tablet"
5
5
  authors = ["Jayy001 <github@skii.dev>"]
6
6
  license = "GPLv3"
@@ -21,4 +21,4 @@ build-backend = "poetry.core.masonry.api"
21
21
 
22
22
  [tool.poetry.scripts]
23
23
  codexctl = "codexctl.__main__:main"
24
- cxtl = "codexctl.__main__:main"
24
+ cxtl = "codexctl.__main__:main"
codexctl-0.4.0/PKG-INFO DELETED
@@ -1,105 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: codexctl
3
- Version: 0.4.0
4
- Summary: Automated update managment for the ReMarkable tablet
5
- License: GPLv3
6
- Author: Jayy001
7
- Author-email: github@skii.dev
8
- Requires-Python: >=3.12,<4.0
9
- Classifier: License :: Other/Proprietary License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.12
12
- Requires-Dist: loguru (==0.7.2)
13
- Requires-Dist: paramiko (==3.4.1)
14
- Requires-Dist: psutil (==6.0.0)
15
- Requires-Dist: remarkable-update-fuse (==1.1.2) ; sys_platform == "linux"
16
- Requires-Dist: remarkable-update-image (==1.1.3) ; sys_platform != "linux"
17
- Requires-Dist: requests (==2.31.0)
18
- Description-Content-Type: text/markdown
19
-
20
- <p align="center">
21
- <img src="media/demoLocal.gif">
22
-
23
- # Codexctl
24
- A utility program that helps to manage the remarkable device version utilizing [ddvks update server](https://github.com/ddvk/remarkable-update)
25
-
26
- ### Installation & Use
27
-
28
- You can find pre-compiled binaries on the [releases](https://github.com/Jayy001/codexctl/releases/) page. This includes a build for the reMarkable itself, as well as well as builds for linux, macOS, and Windows. It currently only has support for **command line interfaces** but a graphical interface is soon to come.
29
-
30
- ## Running from source
31
-
32
- Codexctl can be run from source on both the reMarkable, as well as on a remote device.
33
-
34
- ### Running on reMarkable
35
-
36
- ```
37
- git clone https://github.com/Jayy001/codexctl.git
38
- cd codexctl
39
- pip install -r requirements.txt
40
- python codexctl.py --help
41
- ```
42
-
43
- ### Running on a remote device
44
-
45
- This requires python 3.11 or newer.
46
-
47
- ```
48
- git clone https://github.com/Jayy001/codexctl.git
49
- cd codexctl
50
- pip install wheel
51
- pip install -r requirements.remote.txt
52
- python codexctl.py --help
53
- ```
54
-
55
- ## Building executables from source
56
-
57
- This requires python 3.11 or newer, python-venv, pip. Linux also requires libfuse-dev.
58
-
59
- ```
60
- make executable
61
- ```
62
-
63
- ## Usage
64
-
65
- The script is designed to have as little interactivity as possible, meaning arguments are directly taken from the command to run the script.
66
-
67
- ```
68
- ❯ codexctl --help
69
- usage: Codexctl app [-h] [--debug] [--rm1] [--auth AUTH] [--verbose] {install,download,backup,extract,mount,status,restore,list} ...
70
-
71
- positional arguments:
72
- {install,download,backup,extract,mount,status,restore,list}
73
- install Install the specified version (will download if not available on the device)
74
- download Download the specified version firmware file
75
- backup Download remote files to local directory
76
- extract Extract the specified version update file
77
- mount Mount the specified version firmware filesystem
78
- status Get the current version of the device and other information
79
- restore Restores to previous version installed on device
80
- list List all versions available for use
81
-
82
- options:
83
- -h, --help show this help message and exit
84
- --debug Print debug info
85
- --rm1 Use rm1
86
- --auth AUTH Specify password or SSH key for SSH
87
- --verbose Enable verbose logging
88
- ```
89
-
90
- # Examples
91
- ```
92
- codexctl install latest # Downloads and installs latest version
93
- codexctl download toltec # Downloads latest version that has full support for toltec
94
- codexctl download 3.0.4.1305 --rm1 # Downloads 3.0.4.1305 firmware file for remarkable 1
95
- codexctl status # Prints current & previous version (can only be used when running on device itself)
96
- codexctl list # Lists all available versions
97
- codexctl restore # Restores previous version
98
- codexctl --verbose # Enables logging
99
- codexctl --backup # Exports all files to local directory
100
- codexctl --backup -l root -r FM --no-recursion --no-overwrite # Exports all files from FM directory to root folder on localhost
101
- codexctl extract 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed # Extracts contents to filesystem named "extracted"
102
- codexctl mount extracted /opt/remarkable # Mounts extracted filesystem to /opt/remarkable
103
- codexctl ls 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed / # Lists the root directory of the update image
104
- codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version # Outputs the contents of /etc/version from the update image
105
- ```
codexctl-0.4.0/README.md DELETED
@@ -1,86 +0,0 @@
1
- <p align="center">
2
- <img src="media/demoLocal.gif">
3
-
4
- # Codexctl
5
- A utility program that helps to manage the remarkable device version utilizing [ddvks update server](https://github.com/ddvk/remarkable-update)
6
-
7
- ### Installation & Use
8
-
9
- You can find pre-compiled binaries on the [releases](https://github.com/Jayy001/codexctl/releases/) page. This includes a build for the reMarkable itself, as well as well as builds for linux, macOS, and Windows. It currently only has support for **command line interfaces** but a graphical interface is soon to come.
10
-
11
- ## Running from source
12
-
13
- Codexctl can be run from source on both the reMarkable, as well as on a remote device.
14
-
15
- ### Running on reMarkable
16
-
17
- ```
18
- git clone https://github.com/Jayy001/codexctl.git
19
- cd codexctl
20
- pip install -r requirements.txt
21
- python codexctl.py --help
22
- ```
23
-
24
- ### Running on a remote device
25
-
26
- This requires python 3.11 or newer.
27
-
28
- ```
29
- git clone https://github.com/Jayy001/codexctl.git
30
- cd codexctl
31
- pip install wheel
32
- pip install -r requirements.remote.txt
33
- python codexctl.py --help
34
- ```
35
-
36
- ## Building executables from source
37
-
38
- This requires python 3.11 or newer, python-venv, pip. Linux also requires libfuse-dev.
39
-
40
- ```
41
- make executable
42
- ```
43
-
44
- ## Usage
45
-
46
- The script is designed to have as little interactivity as possible, meaning arguments are directly taken from the command to run the script.
47
-
48
- ```
49
- ❯ codexctl --help
50
- usage: Codexctl app [-h] [--debug] [--rm1] [--auth AUTH] [--verbose] {install,download,backup,extract,mount,status,restore,list} ...
51
-
52
- positional arguments:
53
- {install,download,backup,extract,mount,status,restore,list}
54
- install Install the specified version (will download if not available on the device)
55
- download Download the specified version firmware file
56
- backup Download remote files to local directory
57
- extract Extract the specified version update file
58
- mount Mount the specified version firmware filesystem
59
- status Get the current version of the device and other information
60
- restore Restores to previous version installed on device
61
- list List all versions available for use
62
-
63
- options:
64
- -h, --help show this help message and exit
65
- --debug Print debug info
66
- --rm1 Use rm1
67
- --auth AUTH Specify password or SSH key for SSH
68
- --verbose Enable verbose logging
69
- ```
70
-
71
- # Examples
72
- ```
73
- codexctl install latest # Downloads and installs latest version
74
- codexctl download toltec # Downloads latest version that has full support for toltec
75
- codexctl download 3.0.4.1305 --rm1 # Downloads 3.0.4.1305 firmware file for remarkable 1
76
- codexctl status # Prints current & previous version (can only be used when running on device itself)
77
- codexctl list # Lists all available versions
78
- codexctl restore # Restores previous version
79
- codexctl --verbose # Enables logging
80
- codexctl --backup # Exports all files to local directory
81
- codexctl --backup -l root -r FM --no-recursion --no-overwrite # Exports all files from FM directory to root folder on localhost
82
- codexctl extract 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed # Extracts contents to filesystem named "extracted"
83
- codexctl mount extracted /opt/remarkable # Mounts extracted filesystem to /opt/remarkable
84
- codexctl ls 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed / # Lists the root directory of the update image
85
- codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version # Outputs the contents of /etc/version from the update image
86
- ```
File without changes
File without changes
File without changes