cmsend 0.3.0__tar.gz → 0.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmsend
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: ping messages between chatmail relays
5
5
  Project-URL: Repository, https://github.com/chatmail/cmsend
6
6
  Project-URL: Changelog, https://github.com/chatmail/cmsend/blob/master/CHANGELOG.md
@@ -21,13 +21,17 @@ To send and receive from a single chatmail relay:
21
21
 
22
22
  cmsend --init nine.testrun.org # <-- substitute with the domain you want to set as origin
23
23
 
24
- To setup a chat using an invite link:
24
+ To setup a genesis chat using an invite link:
25
25
 
26
- cmsend --join INVITELINK
26
+ cmsend --join "INVITELINK" # <-- quotes are neccessary because links contain "&"
27
27
 
28
- To send a message to a group:
28
+ To send a message to the genesis chat:
29
29
 
30
- echo "hello" | cmsend --grp 11
30
+ echo "hello" | cmsend
31
+
32
+ To send a message to the genesis chat with an attachment:
33
+
34
+ cmsend -m "here is the file" -a README.md
31
35
 
32
36
  To show help:
33
37
 
@@ -8,13 +8,17 @@ To send and receive from a single chatmail relay:
8
8
 
9
9
  cmsend --init nine.testrun.org # <-- substitute with the domain you want to set as origin
10
10
 
11
- To setup a chat using an invite link:
11
+ To setup a genesis chat using an invite link:
12
12
 
13
- cmsend --join INVITELINK
13
+ cmsend --join "INVITELINK" # <-- quotes are neccessary because links contain "&"
14
14
 
15
- To send a message to a group:
15
+ To send a message to the genesis chat:
16
16
 
17
- echo "hello" | cmsend --grp 11
17
+ echo "hello" | cmsend
18
+
19
+ To send a message to the genesis chat with an attachment:
20
+
21
+ cmsend -m "here is the file" -a README.md
18
22
 
19
23
  To show help:
20
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmsend
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: ping messages between chatmail relays
5
5
  Project-URL: Repository, https://github.com/chatmail/cmsend
6
6
  Project-URL: Changelog, https://github.com/chatmail/cmsend/blob/master/CHANGELOG.md
@@ -21,13 +21,17 @@ To send and receive from a single chatmail relay:
21
21
 
22
22
  cmsend --init nine.testrun.org # <-- substitute with the domain you want to set as origin
23
23
 
24
- To setup a chat using an invite link:
24
+ To setup a genesis chat using an invite link:
25
25
 
26
- cmsend --join INVITELINK
26
+ cmsend --join "INVITELINK" # <-- quotes are neccessary because links contain "&"
27
27
 
28
- To send a message to a group:
28
+ To send a message to the genesis chat:
29
29
 
30
- echo "hello" | cmsend --grp 11
30
+ echo "hello" | cmsend
31
+
32
+ To send a message to the genesis chat with an attachment:
33
+
34
+ cmsend -m "here is the file" -a README.md
31
35
 
32
36
  To show help:
33
37
 
@@ -17,10 +17,12 @@ def main():
17
17
  parser.add_argument(
18
18
  "--init",
19
19
  type=str,
20
+ dest="relay",
20
21
  help="initialize a profile with the specified chatmail relay",
21
22
  )
22
23
  parser.add_argument(
23
24
  "--join",
25
+ dest="invitelink",
24
26
  type=str,
25
27
  help="setup a chat using the specified invite link",
26
28
  )
@@ -51,11 +53,15 @@ def perform_main(args):
51
53
  with Rpc(accounts_dir=accounts_dir) as rpc:
52
54
  dc = DeltaChat(rpc)
53
55
  profile = Profile(dc, verbosity=args.verbose)
54
- if args.init:
55
- profile.perform_init(domain=args.init)
56
- elif args.join:
57
- profile.perform_join(invitelink=args.join)
56
+ if args.relay:
57
+ profile.perform_init(domain=args.relay)
58
+ elif args.invitelink:
59
+ profile.perform_join(invitelink=args.invitelink)
58
60
  else:
61
+ if not profile._account:
62
+ print("profile is not configured, run --init")
63
+ raise SystemExit(2)
64
+
59
65
  if args.msg is None:
60
66
  args.msg = sys.stdin.read()
61
67
  profile.perform_send(args.msg, filename=args.filename)
@@ -123,7 +129,7 @@ class Profile:
123
129
  print(f"message {msg.id} was queued, waiting for delivery")
124
130
  msg.wait_until_delivered()
125
131
  return 0
126
- print(f"No chat usable for sending on {self!r}")
132
+ print("No chat usable for sending on {self!r}, use --join 'https://i.delta.chat/...'")
127
133
  raise SystemExit(5)
128
134
 
129
135
  def wait_for_event(self, check_event=lambda ev: None):
File without changes
File without changes
File without changes