MCPcopy Index your code
hub / github.com/geekcomputers/Python / selectPictures

Method selectPictures

image2pdf/image2pdf.py:43–67  ·  view source on GitHub ↗

Allow user to manually pick each picture or merge all

(self, pictures)

Source from the content-addressed store, hash-verified

41 return pictures
42
43 def selectPictures(self, pictures):
44 """Allow user to manually pick each picture or merge all"""
45
46 listedPictures = {}
47 for index, pic in enumerate(pictures):
48 listedPictures[index + 1] = pic
49 print(f"{index + 1}: {pic}")
50
51 userInput = (
52 input(
53 "\n Enter the number(s) - (comma seperated/no spaces) or (A or a) to merge All \nChoice: "
54 )
55 .strip()
56 .lower()
57 )
58
59 if userInput != "a":
60 # Convert user input (number) into corresponding (image title)
61 pictures = (
62 listedPictures.get(int(number)) for number in userInput.split(",")
63 )
64
65 self.isMergePDF = False
66
67 return pictures
68
69 def convertPictures(self):
70 """

Callers 1

convertPicturesMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected