Skip to content

Commit cfe2450

Browse files
committed
Auto upload
1 parent ed7b4bc commit cfe2450

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
beepher.py
21
__pycache__/

jdt.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def update(self, new_done, symbol = '*', getSuffix = None):
5858
suffix = getSuffix(new_done, progress)
5959
msg_and_bar_width = terminal_width - len(suffix)
6060
msg_width = min(len(self.msg), int(msg_and_bar_width / 2))
61-
msg_to_print = self.msg[:msg_width]
61+
msg_to_print = self.msg[-msg_width:]
6262
bar_width = msg_and_bar_width - msg_width
6363
if bar_width < self.MIN_BAR_WIDTH:
6464
bar_width = terminal_width - 2
@@ -78,8 +78,9 @@ def acc(self):
7878
def complete(self):
7979
def getSuffix(done, progress):
8080
return 'Complete! Total: %d' % self.goal
81-
self.update(self.goal), symbol = '#', getSuffix = getSuffix)
81+
self.update(self.goal, symbol = '#', getSuffix = getSuffix)
8282
self.active = False
83+
print()
8384

8485
class CommJdt(Jdt):
8586
def __init__(self, *argv, **kw):
@@ -97,7 +98,7 @@ def update(self, new_done, *argv, **kw):
9798
speed = delta_done / delta_time
9899
def getSuffix(done, progress):
99100
nonlocal speed
100-
return '%s Total: %s Done: %s Speed: %s' % (
101+
return '%s Total: %s Done: %s Speed: %s/s' % (
101102
format(progress, '4.0%'),
102103
smartUnit(self.goal),
103104
smartUnit(done),
@@ -108,9 +109,14 @@ def getSuffix(done, progress):
108109

109110
if __name__=='__main__':
110111
from time import sleep
111-
j=CommJdt(10240000)
112+
j=CommJdt(10240000, '/sdcard/download/browser/file.jpg')
112113
for i in range(0,10240000,32345):
113114
j.update(i)
114115
sleep(0.01)
115116
j.complete()
117+
j=Jdt(500, 'launching game')
118+
for i in range(500):
119+
j.acc()
120+
sleep(0.01)
121+
j.complete()
116122
input('Enter..')

macro.py renamed to macro/__main__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
import pickle
1515
import sys
1616

17-
DATA = path.join(path.dirname(__file__),
18-
'data_' + path.basename(__file__).rstrip('.py'))
17+
SAVED = path.join(path.dirname(__file__), 'saved')
1918

2019
def main():
2120
print(__all__)
@@ -188,7 +187,7 @@ def play(macro):
188187

189188
def save(macro):
190189
name = input('Give your macro a name: ')
191-
path_name = path.join(DATA, name)
190+
path_name = path.join(SAVED, name)
192191
if path.isfile(path_name):
193192
print(name, 'already exists.')
194193
return
@@ -200,18 +199,18 @@ def load():
200199
'''
201200
* to load all.
202201
'''
203-
list_dir = listdir(DATA)
202+
list_dir = listdir(SAVED)
204203
print('Your macros: {')
205204
[print(' ', x) for x in list_dir]
206205
name = input('} which to load? ')
207206
if name == '*':
208207
result = {}
209208
for name in list_dir:
210-
with open(path.join(DATA, name), 'rb') as f:
209+
with open(path.join(SAVED, name), 'rb') as f:
211210
macro = pickle.load(f)
212211
result[name] = macro
213212
else:
214-
with open(path.join(DATA, name), 'rb') as f:
213+
with open(path.join(SAVED, name), 'rb') as f:
215214
result = pickle.load(f)
216215
load.last = result
217216
return result
File renamed without changes.

recvfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def recvFile(socket,file_len,to_filename):
55
assert type(socket) is Socket
6-
j=jdt.CommJdt(file_len,msg=to_filename[-10:])
6+
j=jdt.CommJdt(file_len, msg = to_filename)
77
with open(to_filename,'wb+') as to_file:
88
left=file_len
99
while left:

0 commit comments

Comments
 (0)