|
569 | 569 | " **kwargs\n", |
570 | 570 | "):\n", |
571 | 571 | " \"Convert GitHub repo to XML context and place in a new message\"\n", |
572 | | - " res = repo2ctx(owner, repo, out=out, types=types, exts=exts, **kwargs)\n", |
| 572 | + " res = await repo2ctx(owner, repo, out=out, types=types, exts=exts, **kwargs)\n", |
573 | 573 | " if exts: types=None\n", |
574 | 574 | " if not raw: res = f'```\\n{res}\\n```'\n", |
575 | 575 | " return await add_msg(res, msg_type='raw' if raw else 'note')" |
|
749 | 749 | { |
750 | 750 | "cell_type": "code", |
751 | 751 | "execution_count": null, |
752 | | - "id": "84868ea2", |
| 752 | + "id": "4d3e1b46", |
753 | 753 | "metadata": {}, |
754 | 754 | "outputs": [], |
755 | 755 | "source": [ |
|
762 | 762 | " create_msg:bool=False # Add a message that lists usable tools\n", |
763 | 763 | "):\n", |
764 | 764 | " \"Import gist directly from string without saving to disk\"\n", |
765 | | - " fil = GhApi().gist_file(gist_id)\n", |
| 765 | + " fil = GhApi(sync=True).gist_file(gist_id)\n", |
766 | 766 | " mod_name = mod_name or Path(fil['filename']).stem\n", |
767 | 767 | " module = import_string(fil['content'], mod_name)\n", |
768 | 768 | " glbs = currentframe().f_back.f_globals\n", |
|
781 | 781 | { |
782 | 782 | "cell_type": "code", |
783 | 783 | "execution_count": null, |
784 | | - "id": "aefee238", |
| 784 | + "id": "be823d4c", |
785 | 785 | "metadata": {}, |
786 | | - "outputs": [ |
787 | | - { |
788 | | - "data": { |
789 | | - "text/plain": [ |
790 | | - "'testbar'" |
791 | | - ] |
792 | | - }, |
793 | | - "execution_count": null, |
794 | | - "metadata": {}, |
795 | | - "output_type": "execute_result" |
796 | | - } |
797 | | - ], |
| 786 | + "outputs": [], |
798 | 787 | "source": [ |
799 | 788 | "gistid = 'jph00/e7cfd4ded593e8ef6217e78a0131960c'\n", |
800 | 789 | "import_gist(gistid)\n", |
|
804 | 793 | { |
805 | 794 | "cell_type": "code", |
806 | 795 | "execution_count": null, |
807 | | - "id": "4a4f7f89", |
| 796 | + "id": "d6c5b31a", |
808 | 797 | "metadata": {}, |
809 | | - "outputs": [ |
810 | | - { |
811 | | - "data": { |
812 | | - "text/plain": [ |
813 | | - "'Import gist directly from string without saving to disk'" |
814 | | - ] |
815 | | - }, |
816 | | - "execution_count": null, |
817 | | - "metadata": {}, |
818 | | - "output_type": "execute_result" |
819 | | - } |
820 | | - ], |
| 798 | + "outputs": [], |
821 | 799 | "source": [ |
822 | 800 | "import_gist.__doc__" |
823 | 801 | ] |
824 | 802 | }, |
825 | 803 | { |
826 | 804 | "cell_type": "code", |
827 | 805 | "execution_count": null, |
828 | | - "id": "e80a7944", |
| 806 | + "id": "b76ed687", |
829 | 807 | "metadata": {}, |
830 | | - "outputs": [ |
831 | | - { |
832 | | - "data": { |
833 | | - "text/plain": [ |
834 | | - "'testbar'" |
835 | | - ] |
836 | | - }, |
837 | | - "execution_count": null, |
838 | | - "metadata": {}, |
839 | | - "output_type": "execute_result" |
840 | | - } |
841 | | - ], |
| 808 | + "outputs": [], |
842 | 809 | "source": [ |
843 | 810 | "import_gist(gistid, import_wildcard=True)\n", |
844 | 811 | "importtest.testfoo" |
|
847 | 814 | { |
848 | 815 | "cell_type": "code", |
849 | 816 | "execution_count": null, |
850 | | - "id": "573abb48", |
| 817 | + "id": "1c62fa89", |
851 | 818 | "metadata": {}, |
852 | | - "outputs": [ |
853 | | - { |
854 | | - "data": { |
855 | | - "text/plain": [ |
856 | | - "'Hello Sarah'" |
857 | | - ] |
858 | | - }, |
859 | | - "execution_count": null, |
860 | | - "metadata": {}, |
861 | | - "output_type": "execute_result" |
862 | | - } |
863 | | - ], |
| 819 | + "outputs": [], |
864 | 820 | "source": [ |
865 | 821 | "hi(\"Sarah\")" |
866 | 822 | ] |
867 | 823 | }, |
868 | 824 | { |
869 | 825 | "cell_type": "code", |
870 | 826 | "execution_count": null, |
871 | | - "id": "392dc090", |
| 827 | + "id": "a32dd2d3", |
872 | 828 | "metadata": {}, |
873 | | - "outputs": [ |
874 | | - { |
875 | | - "data": { |
876 | | - "text/plain": [ |
877 | | - "['hi', 'whoami']" |
878 | | - ] |
879 | | - }, |
880 | | - "execution_count": null, |
881 | | - "metadata": {}, |
882 | | - "output_type": "execute_result" |
883 | | - } |
884 | | - ], |
| 829 | + "outputs": [], |
885 | 830 | "source": [ |
886 | 831 | "importtest.__all__" |
887 | 832 | ] |
|
0 commit comments