kmisc 2.1.97__tar.gz → 2.1.99__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,11 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kmisc
3
- Version: 2.1.97
3
+ Version: 2.1.99
4
4
  Summary: Enginering useful library
5
5
  Home-page: https://github.com/kagepark/kmisc
6
6
  Author: Kage Park
7
7
  License: MIT
8
- Platform: UNKNOWN
9
8
  Classifier: Programming Language :: Python :: 2
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: MIT License
@@ -266,5 +265,3 @@ ls : similar as linux ls command
266
265
  IsSame: check both data is same or not
267
266
 
268
267
  etc...
269
-
270
-
@@ -1545,6 +1545,10 @@ class EMAIL:
1545
1545
  if not isinstance(receivers,list):
1546
1546
  print('To mailing list issue')
1547
1547
  return False
1548
+ if not filename:
1549
+ filename=[]
1550
+ elif not isinstance(filename,(list,tuple)):
1551
+ filename=[filename]
1548
1552
  if filename:
1549
1553
  _body=MIMEMultipart()
1550
1554
  if isinstance(sender,tuple) and len(sender) == 2:
@@ -1562,12 +1566,15 @@ class EMAIL:
1562
1566
  _body.attach(MIMEText(msg, "html"))
1563
1567
  else:
1564
1568
  _body.attach(MIMEText(msg, "plain"))
1565
- with open(filename,'rb') as attachment:
1566
- part=MIMEBase("application", "octet-stream")
1567
- part.set_payload(attachment.read())
1568
- encoders.encode_base64(part)
1569
- part.add_header('Content-Disposition','attachment; filename="{}"'.format(filename))
1570
- _body.attach(part)
1569
+ for fn in filename:
1570
+ if isinstance(fn,str) and os.path.isfile(fn):
1571
+ with open(fn,'rb') as attachment:
1572
+ part=MIMEBase("application", "octet-stream")
1573
+ part.set_payload(attachment.read())
1574
+ encoders.encode_base64(part)
1575
+ #part.add_header('Content-Disposition','attachment; filename="{}"'.format(os.path.basename(fn)))
1576
+ part.add_header('Content-Disposition','attachment',filename=('utf-8','',os.path.basename(fn)))
1577
+ _body.attach(part)
1571
1578
  else:
1572
1579
  if html:
1573
1580
  _body=MIMEMultipart('alternative')
@@ -1690,7 +1697,7 @@ class SCREEN:
1690
1697
  print('Already has the title at {}'.format(scr_id))
1691
1698
  return False
1692
1699
 
1693
- if not IP(ip).IsBmcIp(port=(623,664,443)):
1700
+ if not IpV4(ip,port=(623,664,443)):
1694
1701
  print('{} is not ipmi ip'.format(ip))
1695
1702
  return False
1696
1703
 
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kmisc
3
- Version: 2.1.97
3
+ Version: 2.1.99
4
4
  Summary: Enginering useful library
5
5
  Home-page: https://github.com/kagepark/kmisc
6
6
  Author: Kage Park
7
7
  License: MIT
8
- Platform: UNKNOWN
9
8
  Classifier: Programming Language :: Python :: 2
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: MIT License
@@ -266,5 +265,3 @@ ls : similar as linux ls command
266
265
  IsSame: check both data is same or not
267
266
 
268
267
  etc...
269
-
270
-
File without changes
File without changes
File without changes
File without changes
File without changes