Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. @staticmethod
  2.     def create_attachments(api, type=None, user_id=None):
  3.         photo_count = 6
  4.         attachments = ''
  5.  
  6.         if type != None and user_id != None:
  7.             if type == 'video':
  8.                 for i in range(1, photo_count):
  9.                     attachments += MainView.get_video(api) + ','
  10.                 attachments += MainView.get_video(api)
  11.  
  12.             else:
  13.                 for i in range(1, photo_count):
  14.                     attachments += MainView.get_photo(api, type, user_id) + ','
  15.                 attachments += MainView.get_photo(api, type)
  16.  
  17.         else:
  18.             for i in range(1, photo_count):
  19.                 attachments += MainView.get_photo(api) + ','
  20.  
  21.             attachments += MainView.get_video(api)
  22.  
  23.         print(attachments)
  24.         return attachments
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement