File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
p = c .p
6
6
if not p .h .startswith ('@bk ' ):
7
- nd = p .insertAfter ()
7
+ nd = g .findNodeAnywhere (c , '@backup-nodes' )
8
+ if nd :
9
+ nd = nd .insertAsNthChild (0 )
10
+ else :
11
+ nd = p .insertAfter ()
8
12
ts = time .strftime ("%Y-%m-%d %H:%M:%S" )
9
13
nd .h = "@bk %s %s" % (p .h , ts )
10
14
s = '\n ' .join (textwrap .wrap (
11
15
base64 .b64encode (p .b ),
12
16
break_long_words = True
13
17
))
14
- nd .b = "# backup %s - %s\n \n %s" % (ts , p .h , s )
18
+ nd .b = "# backup %s - %s\n # %s\n \n %s" % (
19
+ ts , p .h , p .get_UNL (with_proto = True ), s )
20
+ g .es ("%s - backed up" % ts )
15
21
c .redraw ()
16
22
c .bodyWantsFocusNow ()
17
23
18
24
else :
19
25
20
- hdr , s = p .b .split ('\n ' , 1 )
26
+ hdr , s = p .b .split ('\n \n ' , 1 )
21
27
if hdr .startswith ("# backup" ): # decode
22
28
hdr = hdr .replace ('backup' , 'BACKUP' )
23
29
p .b = "%s\n \n %s" % (
You can’t perform that action at this time.
0 commit comments