codexctl 0.4.0__tar.gz → 1.0.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,97 @@
1
+ Metadata-Version: 2.1
2
+ Name: codexctl
3
+ Version: 1.0.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
+ ## Caveat for downgrading to a version below 3.11
27
+
28
+ 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.
29
+
30
+ ## Installation
31
+
32
+ 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.
33
+
34
+ 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.
35
+
36
+ ## General useage
37
+
38
+ ```
39
+ ❯ codexctl --help
40
+ usage: Codexctl [-h] [--verbose] [--address ADDRESS] [--password PASSWORD]
41
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list} ...
42
+
43
+ positional arguments:
44
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list}
45
+ install Install the specified version (will download if not available on the device)
46
+ download Download the specified version firmware file
47
+ backup Download remote files to local directory
48
+ cat Cat the contents of a file inside a firmware image
49
+ ls List files inside a firmware image
50
+ extract Extract the specified version firmware file
51
+ mount Mount the specified version firmware filesystem
52
+ upload Upload folder/files to device (pdf only)
53
+ status Get the current version of the device and other information
54
+ restore Restores to previous version installed on device
55
+ list List all available versions
56
+
57
+ options:
58
+ -h, --help show this help message and exit
59
+ --verbose, -v Enable verbose logging
60
+ --address ADDRESS, -a ADDRESS
61
+ Specify the address of the device
62
+ --password PASSWORD, -p PASSWORD
63
+ Specify password or path to SSH key for remote access
64
+ ```
65
+
66
+ ## Examples
67
+ - Installing the latest for device (will automatically figure out the version)
68
+ ```
69
+ codexctl install latest
70
+ ```
71
+ - Downloading rmpp version 3.15.4.2 to a folder named `out` and then installing it
72
+ ```
73
+ codexctl download 3.0.4.1305 -hw rmpp -o out
74
+ codexctl install ./out/remarkable-ct-prototype-image-3.15.4.2-ferrari-public.swu
75
+ ```
76
+ - Backing up all documents to the cwd
77
+ ```
78
+ codexctl backup
79
+ ```
80
+ - Backing up only documents in a folder named "FM" to cwd, without overwriting any current files
81
+ ```
82
+ codexctl backup -l root -r FM --no-recursion --no-overwrite
83
+ ```
84
+ - Getting the version of the device and then switching to previous version (restore only for rm1/rm2)
85
+ ```
86
+ codexctl status
87
+ codexctl restore
88
+ ```
89
+ - Download 3.8.0.1944 for rm2, then cat the /etc/version file from it
90
+ ```
91
+ codexctl download 3.8.0.1944 --hardware rm2
92
+ codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version
93
+ ```
94
+
95
+
96
+
97
+
@@ -0,0 +1,77 @@
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
+ ## Caveat for downgrading to a version below 3.11
8
+
9
+ 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.
10
+
11
+ ## Installation
12
+
13
+ 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.
14
+
15
+ 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.
16
+
17
+ ## General useage
18
+
19
+ ```
20
+ ❯ codexctl --help
21
+ usage: Codexctl [-h] [--verbose] [--address ADDRESS] [--password PASSWORD]
22
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list} ...
23
+
24
+ positional arguments:
25
+ {install,download,backup,cat,ls,extract,mount,upload,status,restore,list}
26
+ install Install the specified version (will download if not available on the device)
27
+ download Download the specified version firmware file
28
+ backup Download remote files to local directory
29
+ cat Cat the contents of a file inside a firmware image
30
+ ls List files inside a firmware image
31
+ extract Extract the specified version firmware file
32
+ mount Mount the specified version firmware filesystem
33
+ upload Upload folder/files to device (pdf only)
34
+ status Get the current version of the device and other information
35
+ restore Restores to previous version installed on device
36
+ list List all available versions
37
+
38
+ options:
39
+ -h, --help show this help message and exit
40
+ --verbose, -v Enable verbose logging
41
+ --address ADDRESS, -a ADDRESS
42
+ Specify the address of the device
43
+ --password PASSWORD, -p PASSWORD
44
+ Specify password or path to SSH key for remote access
45
+ ```
46
+
47
+ ## Examples
48
+ - Installing the latest for device (will automatically figure out the version)
49
+ ```
50
+ codexctl install latest
51
+ ```
52
+ - Downloading rmpp version 3.15.4.2 to a folder named `out` and then installing it
53
+ ```
54
+ codexctl download 3.0.4.1305 -hw rmpp -o out
55
+ codexctl install ./out/remarkable-ct-prototype-image-3.15.4.2-ferrari-public.swu
56
+ ```
57
+ - Backing up all documents to the cwd
58
+ ```
59
+ codexctl backup
60
+ ```
61
+ - Backing up only documents in a folder named "FM" to cwd, without overwriting any current files
62
+ ```
63
+ codexctl backup -l root -r FM --no-recursion --no-overwrite
64
+ ```
65
+ - Getting the version of the device and then switching to previous version (restore only for rm1/rm2)
66
+ ```
67
+ codexctl status
68
+ codexctl restore
69
+ ```
70
+ - Download 3.8.0.1944 for rm2, then cat the /etc/version file from it
71
+ ```
72
+ codexctl download 3.8.0.1944 --hardware rm2
73
+ codexctl cat 3.8.0.1944_reMarkable2-7eGpAv7sYB.signed /etc/version
74
+ ```
75
+
76
+
77
+
@@ -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
 
@@ -202,6 +202,8 @@ class Manager:
202
202
  )
203
203
 
204
204
  elif function == "restore":
205
+ if remarkable.hardware == "ferrari":
206
+ raise SystemError("Restore not available for rmpro.")
205
207
  remarkable.restore_previous_version()
206
208
  print(
207
209
  f"Device restored to previous version [{remarkable.get_device_status()[1]}]"
@@ -381,13 +383,13 @@ def main() -> None:
381
383
 
382
384
  ### Cat subcommand
383
385
  cat = subparsers.add_parser(
384
- "cat", help="Cat the contents of a file inside an update image"
386
+ "cat", help="Cat the contents of a file inside a firmwareimage"
385
387
  )
386
388
  cat.add_argument("file", help="Path to update file to cat", default=None)
387
389
  cat.add_argument("target_path", help="Path inside the image to list", default=None)
388
390
 
389
391
  ### Ls subcommand
390
- ls = subparsers.add_parser("ls", help="List files inside an update image")
392
+ ls = subparsers.add_parser("ls", help="List files inside a firmware image")
391
393
  ls.add_argument("file", help="Path to update file to extract", default=None)
392
394
  ls.add_argument("target_path", help="Path inside the image to list", default=None)
393
395
 
@@ -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.0.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