{"action":"created","comment":{"url":"https://api.github.com/repos/geier/khal/pulls/comments/31020307","id":31020307,"diff_hunk":"@@ -139,6 +139,20 @@ def generate_random_uid():\n     choice = string.ascii_uppercase + string.digits\n     return ''.join([random.choice(choice) for _ in range(36)])\n \n+def construct_event_list_from_string(ics_as_string):\n+    \"\"\"Construct a list with icalendar.event types with a random UID\"\"\"\n+    try:\n+        events = icalendar.Calendar.from_ical(ics_as_string)\n+    except ValueError:\n+        logger.fatal(\"Please specify a ics file\")","path":"khal/aux.py","position":9,"original_position":9,"commit_id":"c8977880c73b37158cfd3736f5ea5e7e89600137","original_commit_id":"c8977880c73b37158cfd3736f5ea5e7e89600137","user":{"login":"libre-man","id":12597247,"avatar_url":"https://avatars.githubusercontent.com/u/12597247?v=3","gravatar_id":"","url":"https://api.github.com/users/libre-man","html_url":"https://github.com/libre-man","followers_url":"https://api.github.com/users/libre-man/followers","following_url":"https://api.github.com/users/libre-man/following{/other_user}","gists_url":"https://api.github.com/users/libre-man/gists{/gist_id}","starred_url":"https://api.github.com/users/libre-man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libre-man/subscriptions","organizations_url":"https://api.github.com/users/libre-man/orgs","repos_url":"https://api.github.com/users/libre-man/repos","events_url":"https://api.github.com/users/libre-man/events{/privacy}","received_events_url":"https://api.github.com/users/libre-man/received_events","type":"User","site_admin":false},"body":"But how would you recognize and/or correct a slightly malformed ICS file? And wouldn't that be the job of the icalendar module? ","created_at":"2015-05-26T10:16:11Z","updated_at":"2015-05-26T10:16:11Z","html_url":"https://github.com/geier/khal/pull/202#discussion_r31020307","pull_request_url":"https://api.github.com/repos/geier/khal/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/geier/khal/pulls/comments/31020307"},"html":{"href":"https://github.com/geier/khal/pull/202#discussion_r31020307"},"pull_request":{"href":"https://api.github.com/repos/geier/khal/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/geier/khal/pulls/202","id":36160208,"html_url":"https://github.com/geier/khal/pull/202","diff_url":"https://github.com/geier/khal/pull/202.diff","patch_url":"https://github.com/geier/khal/pull/202.patch","issue_url":"https://api.github.com/repos/geier/khal/issues/202","number":202,"state":"open","locked":false,"title":"Importing ICS files","user":{"login":"libre-man","id":12597247,"avatar_url":"https://avatars.githubusercontent.com/u/12597247?v=3","gravatar_id":"","url":"https://api.github.com/users/libre-man","html_url":"https://github.com/libre-man","followers_url":"https://api.github.com/users/libre-man/followers","following_url":"https://api.github.com/users/libre-man/following{/other_user}","gists_url":"https://api.github.com/users/libre-man/gists{/gist_id}","starred_url":"https://api.github.com/users/libre-man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libre-man/subscriptions","organizations_url":"https://api.github.com/users/libre-man/orgs","repos_url":"https://api.github.com/users/libre-man/repos","events_url":"https://api.github.com/users/libre-man/events{/privacy}","received_events_url":"https://api.github.com/users/libre-man/received_events","type":"User","site_admin":false},"body":"I made a fix to import ics  files with one or more VEVENT. Everything seems alright. I have not made tests because I didn't have the time just yet.\r\n\r\nThe fix is working for me, but I didn't test with strange data.\r\n\r\nedit: this would solve #111","created_at":"2015-05-25T22:33:23Z","updated_at":"2015-05-26T10:16:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ac28aa33bc199aedc708bd554cb7f2df6a0c87f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geier/khal/pulls/202/commits","review_comments_url":"https://api.github.com/repos/geier/khal/pulls/202/comments","review_comment_url":"https://api.github.com/repos/geier/khal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geier/khal/issues/202/comments","statuses_url":"https://api.github.com/repos/geier/khal/statuses/c8977880c73b37158cfd3736f5ea5e7e89600137","head":{"label":"libre-man:master","ref":"master","sha":"c8977880c73b37158cfd3736f5ea5e7e89600137","user":{"login":"libre-man","id":12597247,"avatar_url":"https://avatars.githubusercontent.com/u/12597247?v=3","gravatar_id":"","url":"https://api.github.com/users/libre-man","html_url":"https://github.com/libre-man","followers_url":"https://api.github.com/users/libre-man/followers","following_url":"https://api.github.com/users/libre-man/following{/other_user}","gists_url":"https://api.github.com/users/libre-man/gists{/gist_id}","starred_url":"https://api.github.com/users/libre-man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libre-man/subscriptions","organizations_url":"https://api.github.com/users/libre-man/orgs","repos_url":"https://api.github.com/users/libre-man/repos","events_url":"https://api.github.com/users/libre-man/events{/privacy}","received_events_url":"https://api.github.com/users/libre-man/received_events","type":"User","site_admin":false},"repo":{"id":36236045,"name":"khal","full_name":"libre-man/khal","owner":{"login":"libre-man","id":12597247,"avatar_url":"https://avatars.githubusercontent.com/u/12597247?v=3","gravatar_id":"","url":"https://api.github.com/users/libre-man","html_url":"https://github.com/libre-man","followers_url":"https://api.github.com/users/libre-man/followers","following_url":"https://api.github.com/users/libre-man/following{/other_user}","gists_url":"https://api.github.com/users/libre-man/gists{/gist_id}","starred_url":"https://api.github.com/users/libre-man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libre-man/subscriptions","organizations_url":"https://api.github.com/users/libre-man/orgs","repos_url":"https://api.github.com/users/libre-man/repos","events_url":"https://api.github.com/users/libre-man/events{/privacy}","received_events_url":"https://api.github.com/users/libre-man/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/libre-man/khal","description":"CLI calendar application","fork":true,"url":"https://api.github.com/repos/libre-man/khal","forks_url":"https://api.github.com/repos/libre-man/khal/forks","keys_url":"https://api.github.com/repos/libre-man/khal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libre-man/khal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libre-man/khal/teams","hooks_url":"https://api.github.com/repos/libre-man/khal/hooks","issue_events_url":"https://api.github.com/repos/libre-man/khal/issues/events{/number}","events_url":"https://api.github.com/repos/libre-man/khal/events","assignees_url":"https://api.github.com/repos/libre-man/khal/assignees{/user}","branches_url":"https://api.github.com/repos/libre-man/khal/branches{/branch}","tags_url":"https://api.github.com/repos/libre-man/khal/tags","blobs_url":"https://api.github.com/repos/libre-man/khal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libre-man/khal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libre-man/khal/git/refs{/sha}","trees_url":"https://api.github.com/repos/libre-man/khal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libre-man/khal/statuses/{sha}","languages_url":"https://api.github.com/repos/libre-man/khal/languages","stargazers_url":"https://api.github.com/repos/libre-man/khal/stargazers","contributors_url":"https://api.github.com/repos/libre-man/khal/contributors","subscribers_url":"https://api.github.com/repos/libre-man/khal/subscribers","subscription_url":"https://api.github.com/repos/libre-man/khal/subscription","commits_url":"https://api.github.com/repos/libre-man/khal/commits{/sha}","git_commits_url":"https://api.github.com/repos/libre-man/khal/git/commits{/sha}","comments_url":"https://api.github.com/repos/libre-man/khal/comments{/number}","issue_comment_url":"https://api.github.com/repos/libre-man/khal/issues/comments{/number}","contents_url":"https://api.github.com/repos/libre-man/khal/contents/{+path}","compare_url":"https://api.github.com/repos/libre-man/khal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libre-man/khal/merges","archive_url":"https://api.github.com/repos/libre-man/khal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libre-man/khal/downloads","issues_url":"https://api.github.com/repos/libre-man/khal/issues{/number}","pulls_url":"https://api.github.com/repos/libre-man/khal/pulls{/number}","milestones_url":"https://api.github.com/repos/libre-man/khal/milestones{/number}","notifications_url":"https://api.github.com/repos/libre-man/khal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libre-man/khal/labels{/name}","releases_url":"https://api.github.com/repos/libre-man/khal/releases{/id}","created_at":"2015-05-25T14:35:43Z","updated_at":"2015-05-25T14:35:44Z","pushed_at":"2015-05-25T22:28:51Z","git_url":"git://github.com/libre-man/khal.git","ssh_url":"git@github.com:libre-man/khal.git","clone_url":"https://github.com/libre-man/khal.git","svn_url":"https://github.com/libre-man/khal","homepage":"http://lostpackets.de/khal/","size":1399,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"geier:master","ref":"master","sha":"a1e2924518d4b1c8040bc2a8d1de50da05cca023","user":{"login":"geier","id":275330,"avatar_url":"https://avatars.githubusercontent.com/u/275330?v=3","gravatar_id":"","url":"https://api.github.com/users/geier","html_url":"https://github.com/geier","followers_url":"https://api.github.com/users/geier/followers","following_url":"https://api.github.com/users/geier/following{/other_user}","gists_url":"https://api.github.com/users/geier/gists{/gist_id}","starred_url":"https://api.github.com/users/geier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geier/subscriptions","organizations_url":"https://api.github.com/users/geier/orgs","repos_url":"https://api.github.com/users/geier/repos","events_url":"https://api.github.com/users/geier/events{/privacy}","received_events_url":"https://api.github.com/users/geier/received_events","type":"User","site_admin":false},"repo":{"id":12357974,"name":"khal","full_name":"geier/khal","owner":{"login":"geier","id":275330,"avatar_url":"https://avatars.githubusercontent.com/u/275330?v=3","gravatar_id":"","url":"https://api.github.com/users/geier","html_url":"https://github.com/geier","followers_url":"https://api.github.com/users/geier/followers","following_url":"https://api.github.com/users/geier/following{/other_user}","gists_url":"https://api.github.com/users/geier/gists{/gist_id}","starred_url":"https://api.github.com/users/geier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geier/subscriptions","organizations_url":"https://api.github.com/users/geier/orgs","repos_url":"https://api.github.com/users/geier/repos","events_url":"https://api.github.com/users/geier/events{/privacy}","received_events_url":"https://api.github.com/users/geier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geier/khal","description":"CLI calendar application","fork":false,"url":"https://api.github.com/repos/geier/khal","forks_url":"https://api.github.com/repos/geier/khal/forks","keys_url":"https://api.github.com/repos/geier/khal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geier/khal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geier/khal/teams","hooks_url":"https://api.github.com/repos/geier/khal/hooks","issue_events_url":"https://api.github.com/repos/geier/khal/issues/events{/number}","events_url":"https://api.github.com/repos/geier/khal/events","assignees_url":"https://api.github.com/repos/geier/khal/assignees{/user}","branches_url":"https://api.github.com/repos/geier/khal/branches{/branch}","tags_url":"https://api.github.com/repos/geier/khal/tags","blobs_url":"https://api.github.com/repos/geier/khal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geier/khal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geier/khal/git/refs{/sha}","trees_url":"https://api.github.com/repos/geier/khal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geier/khal/statuses/{sha}","languages_url":"https://api.github.com/repos/geier/khal/languages","stargazers_url":"https://api.github.com/repos/geier/khal/stargazers","contributors_url":"https://api.github.com/repos/geier/khal/contributors","subscribers_url":"https://api.github.com/repos/geier/khal/subscribers","subscription_url":"https://api.github.com/repos/geier/khal/subscription","commits_url":"https://api.github.com/repos/geier/khal/commits{/sha}","git_commits_url":"https://api.github.com/repos/geier/khal/git/commits{/sha}","comments_url":"https://api.github.com/repos/geier/khal/comments{/number}","issue_comment_url":"https://api.github.com/repos/geier/khal/issues/comments{/number}","contents_url":"https://api.github.com/repos/geier/khal/contents/{+path}","compare_url":"https://api.github.com/repos/geier/khal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geier/khal/merges","archive_url":"https://api.github.com/repos/geier/khal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geier/khal/downloads","issues_url":"https://api.github.com/repos/geier/khal/issues{/number}","pulls_url":"https://api.github.com/repos/geier/khal/pulls{/number}","milestones_url":"https://api.github.com/repos/geier/khal/milestones{/number}","notifications_url":"https://api.github.com/repos/geier/khal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geier/khal/labels{/name}","releases_url":"https://api.github.com/repos/geier/khal/releases{/id}","created_at":"2013-08-25T11:22:27Z","updated_at":"2015-05-25T15:15:35Z","pushed_at":"2015-05-25T22:33:24Z","git_url":"git://github.com/geier/khal.git","ssh_url":"git@github.com:geier/khal.git","clone_url":"https://github.com/geier/khal.git","svn_url":"https://github.com/geier/khal","homepage":"http://lostpackets.de/khal/","size":3588,"stargazers_count":338,"watchers_count":338,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":34,"forks":33,"open_issues":34,"watchers":338,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geier/khal/pulls/202"},"html":{"href":"https://github.com/geier/khal/pull/202"},"issue":{"href":"https://api.github.com/repos/geier/khal/issues/202"},"comments":{"href":"https://api.github.com/repos/geier/khal/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/geier/khal/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/geier/khal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geier/khal/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/geier/khal/statuses/c8977880c73b37158cfd3736f5ea5e7e89600137"}}}}