Skip to content

Commit

Permalink
Merge pull request #69 from rjsears/0.99
Browse files Browse the repository at this point in the history
Update to Version 0.99
  • Loading branch information
rjsears authored Jul 23, 2023
2 parents b22e497 + 1655370 commit eaa61a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 align="center">
<a name="chia_drive_logo" href="https://github.com/rjsears/chia_plot_manager"><img src="https://github.com/rjsears/chia_plot_manager/blob/main/images/chia_plot_manager_new.png" alt="Chia Plot Manager"></a><br>

Chia Plot, Drive Manager, Coin Monitor & Auto Drive (V0.98 - October 15th, 2021)
Chia Plot, Drive Manager, Coin Monitor & Auto Drive (V0.99 - July 22nd, 2023)
</h2>
<p align="center">
Multi Server Chia Plot and Drive Management Solution
Expand All @@ -18,7 +18,7 @@ Multi Server Chia Plot and Drive Management Solution
</div><br><br>
<b><em> Now fully supports pools and automatic removal of old plots on a one-by-one basis when replacing with new portable pool plots! Also includes a harvester-wide UUID search allowing you to locate any drive on any harvester by UUID and determine it's mountpoint! <br><br>

You must be running Chia Version 1.2.6 or higher for the reporting to work correctly!</b></em>
You must be running Chia Version 1.8.2 or higher for the reporting to work correctly!</b></em>
<br>
<p align="left"><font size="3">
Hopefully if you are reading this you know what Chia is and what a plot is. I am pretty new to Chia myself but I determined that I needed to come up with a way to manage my plots and hard drives that hold thse plots somewhat automatically since my job as a pilot keeps me gone a lot. I <em>am not</em> a programmer, so please, use this code with caution, test it yourself and provide feedback. This is a working version that is currently running and working for my setup which I will explain below. Hopefully it will be of some help to others, it is the least I can do to give back to the Chia community.
Expand Down Expand Up @@ -601,6 +601,9 @@ strategy above, it is super easy to add more drives.
<br><hr>

### <a name="changelog"></a>Changelog
<b>V0.99 2023-07-22</b>
- Updated to support new logging format for reports (current through 1.8.2)

<b>V0.98 2021-10-15</b>
- Rewrote reporting utilizing Python Rich (https://github.com/willmcgugan/rich)
- Begin Python typing addition to functions (work in progress)
Expand Down
29 changes: 7 additions & 22 deletions chianas/drive_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# -*- coding: utf-8 -*-

__author__ = 'Richard J. Sears'
VERSION = "0.98 (2021-10-15)"
VERSION = "0.99 (2023-07-22)"

"""
NOTE NOTE NOTE NOTE NOTE NOTE NOTE
Expand Down Expand Up @@ -46,6 +46,10 @@
Updates
v0.99 2023-07-22
- Updated reporting to meet the new log file output of 1.8.2 to correctly read
the number of plots currently being farmed.
v0.98 2021-10-15
- Rewrote reporting utilizing Python Rich (https://github.com/willmcgugan/rich)
- Begin Python typing addition to functions (work in progress)
Expand Down Expand Up @@ -1631,29 +1635,10 @@ def send_new_plot_notification() -> None:
notify('New Plot Received', 'New Plot Received')
os.remove('new_plot_received')

def check_plots_old() -> tuple: # new chia version changed the way they report things in the debug file!
with open(chianas.chia_log_file, 'rb', 0) as f:
m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
i = m.rfind(b'Loaded')
try:
m.seek(i)
except ValueError as e:
return 0, 0
line = m.readline()
newline = line.decode("utf-8")
x = newline.split()
try:
plots = x[4]
TiB = float(x[8])
except IndexError:
plots = 0
TiB = 0
return plots, f'{TiB:.0f}'

def check_plots() -> tuple:
def check_plots() -> tuple: # new chia version changed the way they report things in the debug file! (works with 1.8.2)
with open(chianas.chia_log_file, 'rb', 0) as f:
m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
i = m.rfind(b'Total')
i = m.rfind(b'plots:')
try:
m.seek(i)
except ValueError as e:
Expand Down

0 comments on commit eaa61a1

Please sign in to comment.