uv5r.py

Giovanni T., 09/18/2017 06:52 am

Download (85.7 kB)

 
1

    
2

    
3

    
4

    
5

    
6

    
7
<!DOCTYPE html>
8
<html lang="en">
9
  <head>
10
    <meta charset="utf-8">
11
  <link rel="dns-prefetch" href="https://assets-cdn.github.com">
12
  <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
13
  <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">
14
  <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">
15
  <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">
16
  <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
17
  <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
18

    
19

    
20

    
21
  <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-bedfc518345498ab3204d330c1727cde7e733526a09cd7df6867f6a231565091.css" integrity="sha256-vt/FGDRUmKsyBNMwwXJ83n5zNSagnNffaGf2ojFWUJE=" media="all" rel="stylesheet" />
22
  <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-e573184626eaab20e2f94261d3988b7b4e01cf474b05544601c1f4d78e91519e.css" integrity="sha256-5XMYRibqqyDi+UJh05iLe04Bz0dLBVRGAcH0146RUZ4=" media="all" rel="stylesheet" />
23
  
24
  
25
  <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/site-877643c520258c4fa15ac8d1664d84efd0e3db56f5e544ccac58da0e50489904.css" integrity="sha256-h3ZDxSAljE+hWsjRZk2E79Dj21b15UTMrFjaDlBImQQ=" media="all" rel="stylesheet" />
26
  
27

    
28
  <meta name="viewport" content="width=device-width">
29
  
30
  <title>nwfsmallutils/uv5r.py at master · nwf/nwfsmallutils · GitHub</title>
31
  <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
32
  <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
33
  <meta property="fb:app_id" content="1401488693436528">
34

    
35
    
36
    <meta content="https://avatars2.githubusercontent.com/u/156882?v=4&amp;s=400" property="og:image" /><meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="nwf/nwfsmallutils" property="og:title" /><meta content="https://github.com/nwf/nwfsmallutils" property="og:url" /><meta content="nwfsmallutils - Small utilities that I&#39;ve written over the years" property="og:description" />
37

    
38
  <link rel="assets" href="https://assets-cdn.github.com/">
39
  
40
  <meta name="pjax-timeout" content="1000">
41
  
42
  <meta name="request-id" content="C2F5:24AA:5BD0456:96B23D4:59B27511" data-pjax-transient>
43
  
44

    
45
  <meta name="selected-link" value="repo_source" data-pjax-transient>
46

    
47
  <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
48
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
49
    <meta name="google-analytics" content="UA-3769691-2">
50

    
51
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="https://collector.githubapp.com/github-external/browser_event" name="octolytics-event-url" /><meta content="C2F5:24AA:5BD0456:96B23D4:59B27511" name="octolytics-dimension-request_id" /><meta content="iad" name="octolytics-dimension-region_edge" /><meta content="iad" name="octolytics-dimension-region_render" />
52
<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-pjax-transient="true" name="analytics-location" />
53

    
54

    
55

    
56

    
57
  <meta class="js-ga-set" name="dimension1" content="Logged Out">
58

    
59

    
60
  
61

    
62
      <meta name="hostname" content="github.com">
63
  <meta name="user-login" content="">
64

    
65
      <meta name="expected-hostname" content="github.com">
66
    <meta name="js-proxy-site-detection-payload" content="NDY3ZGQyNGMwZTFkZjI0ZjdhNWI3OTkwMmM1NjUxOGE5NmM4MGI2N2UyNzk5ZmIzMjI3MTJkOTk1M2MyNzY1ZHx7InJlbW90ZV9hZGRyZXNzIjoiMTUxLjI4LjI1Mi4xNzIiLCJyZXF1ZXN0X2lkIjoiQzJGNToyNEFBOjVCRDA0NTY6OTZCMjNENDo1OUIyNzUxMSIsInRpbWVzdGFtcCI6MTUwNDg2NzYwMiwiaG9zdCI6ImdpdGh1Yi5jb20ifQ==">
67

    
68

    
69
  <meta name="html-safe-nonce" content="b1f6227eba116ffebea534b7da880e34d5b43044">
70

    
71
  <meta http-equiv="x-pjax-version" content="f5f46ee866be9c7db78d0e52c03c95e2">
72
  
73

    
74
      <link href="https://github.com/nwf/nwfsmallutils/commits/master.atom" rel="alternate" title="Recent Commits to nwfsmallutils:master" type="application/atom+xml">
75

    
76
  <meta name="description" content="nwfsmallutils - Small utilities that I&#39;ve written over the years">
77
  <meta name="go-import" content="github.com/nwf/nwfsmallutils git https://github.com/nwf/nwfsmallutils.git">
78

    
79
  <meta content="156882" name="octolytics-dimension-user_id" /><meta content="nwf" name="octolytics-dimension-user_login" /><meta content="17487974" name="octolytics-dimension-repository_id" /><meta content="nwf/nwfsmallutils" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="17487974" name="octolytics-dimension-repository_network_root_id" /><meta content="nwf/nwfsmallutils" name="octolytics-dimension-repository_network_root_nwo" /><meta content="false" name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" />
80

    
81

    
82
    <link rel="canonical" href="https://github.com/nwf/nwfsmallutils/blob/master/ham/uv5r.py" data-pjax-transient>
83

    
84

    
85
  <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
86

    
87
  <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
88

    
89
  <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000">
90
  <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
91

    
92
<meta name="theme-color" content="#1e2327">
93

    
94

    
95
  <meta name="u2f-support" content="true">
96

    
97
  </head>
98

    
99
  <body class="logged-out env-production page-blob">
100
    
101

    
102
  <div class="position-relative js-header-wrapper ">
103
    <a href="#start-of-content" tabindex="1" class="px-2 py-4 show-on-focus js-skip-to-content">Skip to content</a>
104
    <div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div>
105

    
106
    
107
    
108
    
109

    
110

    
111

    
112
        <header class="Header header-logged-out  position-relative f4 py-3" role="banner">
113
  <div class="container-lg d-flex px-3">
114
    <div class="d-flex flex-justify-between flex-items-center">
115
      <a class="header-logo-invertocat my-0" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
116
        <svg aria-hidden="true" class="octicon octicon-mark-github" height="32" version="1.1" viewBox="0 0 16 16" width="32"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
117
      </a>
118

    
119
    </div>
120

    
121
    <div class="HeaderMenu HeaderMenu--bright d-flex flex-justify-between flex-auto">
122
        <nav class="mt-0">
123
          <ul class="d-flex list-style-none">
124
              <li class="ml-2">
125
                <a href="/features" class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:features" data-selected-links="/features /features/project-management /features/code-review /features/project-management /features/integrations /features">
126
                  Features
127
</a>              </li>
128
              <li class="ml-4">
129
                <a href="/business" class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:business" data-selected-links="/business /business/security /business/customers /business">
130
                  Business
131
</a>              </li>
132

    
133
              <li class="ml-4">
134
                <a href="/explore" class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:explore" data-selected-links="/explore /trending /trending/developers /integrations /integrations/feature/code /integrations/feature/collaborate /integrations/feature/ship showcases showcases_search showcases_landing /explore">
135
                  Explore
136
</a>              </li>
137

    
138
              <li class="ml-4">
139
                    <a href="/marketplace" class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:marketplace" data-selected-links=" /marketplace">
140
                      Marketplace
141
</a>              </li>
142
              <li class="ml-4">
143
                <a href="/pricing" class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:pricing" data-selected-links="/pricing /pricing/developer /pricing/team /pricing/business-hosted /pricing/business-enterprise /pricing">
144
                  Pricing
145
</a>              </li>
146
          </ul>
147
        </nav>
148

    
149
      <div class="d-flex">
150
          <div class="d-lg-flex flex-items-center mr-3">
151
            <div class="header-search scoped-search site-scoped-search js-site-search" role="search">
152
  <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/nwf/nwfsmallutils/search" class="js-site-search-form" data-scoped-search-url="/nwf/nwfsmallutils/search" data-unscoped-search-url="/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
153
    <label class="form-control header-search-wrapper js-chromeless-input-container">
154
        <a href="/nwf/nwfsmallutils/blob/master/ham/uv5r.py" class="header-search-scope no-underline">This repository</a>
155
      <input type="text"
156
        class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable"
157
        data-hotkey="s"
158
        name="q"
159
        value=""
160
        placeholder="Search"
161
        aria-label="Search this repository"
162
        data-unscoped-placeholder="Search GitHub"
163
        data-scoped-placeholder="Search"
164
        autocapitalize="off">
165
        <input type="hidden" class="js-site-search-type-field" name="type" >
166
    </label>
167
</form></div>
168

    
169
          </div>
170

    
171
        <span class="d-inline-block">
172
            <div class="HeaderNavlink px-0 py-2 m-0">
173
              <a class="text-bold text-white no-underline" href="/login?return_to=%2Fnwf%2Fnwfsmallutils%2Fblob%2Fmaster%2Fham%2Fuv5r.py" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a>
174
                <span class="text-gray">or</span>
175
                <a class="text-bold text-white no-underline" href="/join?source=header-repo" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a>
176
            </div>
177
        </span>
178
      </div>
179
    </div>
180
  </div>
181
</header>
182

    
183

    
184
  </div>
185

    
186
  <div id="start-of-content" class="show-on-focus"></div>
187

    
188
    <div id="js-flash-container">
189
</div>
190

    
191

    
192

    
193
  <div role="main">
194
        <div itemscope itemtype="http://schema.org/SoftwareSourceCode">
195
    <div id="js-repo-pjax-container" data-pjax-container>
196
      
197

    
198

    
199

    
200

    
201

    
202
    <div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav">
203
      <div class="container repohead-details-container">
204

    
205
        <ul class="pagehead-actions">
206
  <li>
207
      <a href="/login?return_to=%2Fnwf%2Fnwfsmallutils"
208
    class="btn btn-sm btn-with-count tooltipped tooltipped-n"
209
    aria-label="You must be signed in to watch a repository" rel="nofollow">
210
    <svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
211
    Watch
212
  </a>
213
  <a class="social-count" href="/nwf/nwfsmallutils/watchers"
214
     aria-label="1 user is watching this repository">
215
    1
216
  </a>
217

    
218
  </li>
219

    
220
  <li>
221
      <a href="/login?return_to=%2Fnwf%2Fnwfsmallutils"
222
    class="btn btn-sm btn-with-count tooltipped tooltipped-n"
223
    aria-label="You must be signed in to star a repository" rel="nofollow">
224
    <svg aria-hidden="true" class="octicon octicon-star" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg>
225
    Star
226
  </a>
227

    
228
    <a class="social-count js-social-count" href="/nwf/nwfsmallutils/stargazers"
229
      aria-label="0 users starred this repository">
230
      0
231
    </a>
232

    
233
  </li>
234

    
235
  <li>
236
      <a href="/login?return_to=%2Fnwf%2Fnwfsmallutils"
237
        class="btn btn-sm btn-with-count tooltipped tooltipped-n"
238
        aria-label="You must be signed in to fork a repository" rel="nofollow">
239
        <svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
240
        Fork
241
      </a>
242

    
243
    <a href="/nwf/nwfsmallutils/network" class="social-count"
244
       aria-label="0 users forked this repository">
245
      0
246
    </a>
247
  </li>
248
</ul>
249

    
250
        <h1 class="public ">
251
  <svg aria-hidden="true" class="octicon octicon-repo" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
252
  <span class="author" itemprop="author"><a href="/nwf" class="url fn" rel="author">nwf</a></span><!--
253
--><span class="path-divider">/</span><!--
254
--><strong itemprop="name"><a href="/nwf/nwfsmallutils" data-pjax="#js-repo-pjax-container">nwfsmallutils</a></strong>
255

    
256
</h1>
257

    
258
      </div>
259
      <div class="container">
260
        
261
<nav class="reponav js-repo-nav js-sidenav-container-pjax"
262
     itemscope
263
     itemtype="http://schema.org/BreadcrumbList"
264
     role="navigation"
265
     data-pjax="#js-repo-pjax-container">
266

    
267
  <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
268
    <a href="/nwf/nwfsmallutils" class="js-selected-navigation-item selected reponav-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /nwf/nwfsmallutils" itemprop="url">
269
      <svg aria-hidden="true" class="octicon octicon-code" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg>
270
      <span itemprop="name">Code</span>
271
      <meta itemprop="position" content="1">
272
</a>  </span>
273

    
274
    <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
275
      <a href="/nwf/nwfsmallutils/issues" class="js-selected-navigation-item reponav-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /nwf/nwfsmallutils/issues" itemprop="url">
276
        <svg aria-hidden="true" class="octicon octicon-issue-opened" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg>
277
        <span itemprop="name">Issues</span>
278
        <span class="Counter">0</span>
279
        <meta itemprop="position" content="2">
280
</a>    </span>
281

    
282
  <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
283
    <a href="/nwf/nwfsmallutils/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /nwf/nwfsmallutils/pulls" itemprop="url">
284
      <svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
285
      <span itemprop="name">Pull requests</span>
286
      <span class="Counter">0</span>
287
      <meta itemprop="position" content="3">
288
</a>  </span>
289

    
290
    <a href="/nwf/nwfsmallutils/projects" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /nwf/nwfsmallutils/projects">
291
      <svg aria-hidden="true" class="octicon octicon-project" height="16" version="1.1" viewBox="0 0 15 16" width="15"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg>
292
      Projects
293
      <span class="Counter" >0</span>
294
</a>
295

    
296

    
297
    <div class="reponav-dropdown js-menu-container">
298
      <button type="button" class="btn-link reponav-item reponav-dropdown js-menu-target " data-no-toggle aria-expanded="false" aria-haspopup="true">
299
        Insights
300
        <svg aria-hidden="true" class="octicon octicon-triangle-down v-align-middle text-gray" height="11" version="1.1" viewBox="0 0 12 16" width="8"><path fill-rule="evenodd" d="M0 5l6 6 6-6z"/></svg>
301
      </button>
302
      <div class="dropdown-menu-content js-menu-content">
303
        <div class="dropdown-menu dropdown-menu-sw">
304
          <a class="dropdown-item" href="/nwf/nwfsmallutils/pulse" data-skip-pjax>
305
            <svg aria-hidden="true" class="octicon octicon-pulse" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8z"/></svg>
306
            Pulse
307
          </a>
308
          <a class="dropdown-item" href="/nwf/nwfsmallutils/graphs" data-skip-pjax>
309
            <svg aria-hidden="true" class="octicon octicon-graph" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg>
310
            Graphs
311
          </a>
312
        </div>
313
      </div>
314
    </div>
315
</nav>
316

    
317
      </div>
318
    </div>
319

    
320
<div class="container new-discussion-timeline experiment-repo-nav">
321
  <div class="repository-content">
322

    
323
    
324
  <a href="/nwf/nwfsmallutils/blob/a430e7eba0b83b422de12fe02b832028374a725a/ham/uv5r.py" class="d-none js-permalink-shortcut" data-hotkey="y">Permalink</a>
325

    
326
  <!-- blob contrib key: blob_contributors:v21:3c74556d79732225271a870feb9f4a5e -->
327

    
328
  <div class="file-navigation js-zeroclipboard-container">
329
    
330
<div class="select-menu branch-select-menu js-menu-container js-select-menu float-left">
331
  <button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w"
332
    
333
    type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true">
334
      <i>Branch:</i>
335
      <span class="js-select-button css-truncate-target">master</span>
336
  </button>
337

    
338
  <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax>
339

    
340
    <div class="select-menu-modal">
341
      <div class="select-menu-header">
342
        <svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
343
        <span class="select-menu-title">Switch branches/tags</span>
344
      </div>
345

    
346
      <div class="select-menu-filters">
347
        <div class="select-menu-text-filter">
348
          <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
349
        </div>
350
        <div class="select-menu-tabs">
351
          <ul>
352
            <li class="select-menu-tab">
353
              <a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a>
354
            </li>
355
            <li class="select-menu-tab">
356
              <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a>
357
            </li>
358
          </ul>
359
        </div>
360
      </div>
361

    
362
      <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu">
363

    
364
        <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
365

    
366

    
367
            <a class="select-menu-item js-navigation-item js-navigation-open selected"
368
               href="/nwf/nwfsmallutils/blob/master/ham/uv5r.py"
369
               data-name="master"
370
               data-skip-pjax="true"
371
               rel="nofollow">
372
              <svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
373
              <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text">
374
                master
375
              </span>
376
            </a>
377
        </div>
378

    
379
          <div class="select-menu-no-results">Nothing to show</div>
380
      </div>
381

    
382
      <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
383
        <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
384

    
385

    
386
        </div>
387

    
388
        <div class="select-menu-no-results">Nothing to show</div>
389
      </div>
390

    
391
    </div>
392
  </div>
393
</div>
394

    
395
    <div class="BtnGroup float-right">
396
      <a href="/nwf/nwfsmallutils/find/master"
397
            class="js-pjax-capture-input btn btn-sm BtnGroup-item"
398
            data-pjax
399
            data-hotkey="t">
400
        Find file
401
      </a>
402
      <button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm BtnGroup-item tooltipped tooltipped-s" data-copied-hint="Copied!" type="button">Copy path</button>
403
    </div>
404
    <div class="breadcrumb js-zeroclipboard-target">
405
      <span class="repo-root js-repo-root"><span class="js-path-segment"><a href="/nwf/nwfsmallutils"><span>nwfsmallutils</span></a></span></span><span class="separator">/</span><span class="js-path-segment"><a href="/nwf/nwfsmallutils/tree/master/ham"><span>ham</span></a></span><span class="separator">/</span><strong class="final-path">uv5r.py</strong>
406
    </div>
407
  </div>
408

    
409

    
410
  <include-fragment class="commit-tease" src="/nwf/nwfsmallutils/contributors/master/ham/uv5r.py">
411
    <div>
412
      Fetching contributors&hellip;
413
    </div>
414

    
415
    <div class="commit-tease-contributors">
416
      <img alt="" class="loader-loading float-left" height="16" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif" width="16" />
417
      <span class="loader-error">Cannot retrieve contributors at this time</span>
418
    </div>
419
</include-fragment>
420

    
421
  <div class="file">
422
    <div class="file-header">
423
  <div class="file-actions">
424

    
425
    <div class="BtnGroup">
426
      <a href="/nwf/nwfsmallutils/raw/master/ham/uv5r.py" class="btn btn-sm BtnGroup-item" id="raw-url">Raw</a>
427
        <a href="/nwf/nwfsmallutils/blame/master/ham/uv5r.py" class="btn btn-sm js-update-url-with-hash BtnGroup-item" data-hotkey="b">Blame</a>
428
      <a href="/nwf/nwfsmallutils/commits/master/ham/uv5r.py" class="btn btn-sm BtnGroup-item" rel="nofollow">History</a>
429
    </div>
430

    
431
        <a class="btn-octicon tooltipped tooltipped-nw"
432
           href="https://desktop.github.com"
433
           aria-label="Open this file in GitHub Desktop"
434
           data-ga-click="Repository, open with desktop, type:windows">
435
            <svg aria-hidden="true" class="octicon octicon-device-desktop" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"/></svg>
436
        </a>
437

    
438
        <button type="button" class="btn-octicon disabled tooltipped tooltipped-nw"
439
          aria-label="You must be signed in to make or propose changes">
440
          <svg aria-hidden="true" class="octicon octicon-pencil" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"/></svg>
441
        </button>
442
        <button type="button" class="btn-octicon btn-octicon-danger disabled tooltipped tooltipped-nw"
443
          aria-label="You must be signed in to make or propose changes">
444
          <svg aria-hidden="true" class="octicon octicon-trashcan" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg>
445
        </button>
446
  </div>
447

    
448
  <div class="file-info">
449
      <span class="file-mode" title="File mode">executable file</span>
450
      <span class="file-info-divider"></span>
451
      197 lines (150 sloc)
452
      <span class="file-info-divider"></span>
453
    4.95 KB
454
  </div>
455
</div>
456

    
457
    
458

    
459
  <div itemprop="text" class="blob-wrapper data type-python">
460
      <table class="highlight tab-size js-file-line-container" data-tab-size="8">
461
      <tr>
462
        <td id="L1" class="blob-num js-line-number" data-line-number="1"></td>
463
        <td id="LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span>!/usr/bin/env python</span></td>
464
      </tr>
465
      <tr>
466
        <td id="L2" class="blob-num js-line-number" data-line-number="2"></td>
467
        <td id="LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td>
468
      </tr>
469
      <tr>
470
        <td id="L3" class="blob-num js-line-number" data-line-number="3"></td>
471
        <td id="LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> A slightly more paranoid UV5R programmer.  I found that some combination</span></td>
472
      </tr>
473
      <tr>
474
        <td id="L4" class="blob-num js-line-number" data-line-number="4"></td>
475
        <td id="LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> of my radio and programming cable liked to crash mid-way through reads or</span></td>
476
      </tr>
477
      <tr>
478
        <td id="L5" class="blob-num js-line-number" data-line-number="5"></td>
479
        <td id="LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> writes, and so I created this brute-force solution.  It seems to work, and</span></td>
480
      </tr>
481
      <tr>
482
        <td id="L6" class="blob-num js-line-number" data-line-number="6"></td>
483
        <td id="LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> should produce CHIRP-compatible image files.</span></td>
484
      </tr>
485
      <tr>
486
        <td id="L7" class="blob-num js-line-number" data-line-number="7"></td>
487
        <td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td>
488
      </tr>
489
      <tr>
490
        <td id="L8" class="blob-num js-line-number" data-line-number="8"></td>
491
        <td id="LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Example usage:</span></td>
492
      </tr>
493
      <tr>
494
        <td id="L9" class="blob-num js-line-number" data-line-number="9"></td>
495
        <td id="LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span>  ./uv5r.py --read radio.img</span></td>
496
      </tr>
497
      <tr>
498
        <td id="L10" class="blob-num js-line-number" data-line-number="10"></td>
499
        <td id="LC10" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span>  # load radio.img into chirp, edit to your heart&#39;s content, save back</span></td>
500
      </tr>
501
      <tr>
502
        <td id="L11" class="blob-num js-line-number" data-line-number="11"></td>
503
        <td id="LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span>  ./uv5r.py --write radio.img</span></td>
504
      </tr>
505
      <tr>
506
        <td id="L12" class="blob-num js-line-number" data-line-number="12"></td>
507
        <td id="LC12" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td>
508
      </tr>
509
      <tr>
510
        <td id="L13" class="blob-num js-line-number" data-line-number="13"></td>
511
        <td id="LC13" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> You should probably re-&quot;--read&quot; your radio after programming to make sure</span></td>
512
      </tr>
513
      <tr>
514
        <td id="L14" class="blob-num js-line-number" data-line-number="14"></td>
515
        <td id="LC14" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> that everything seems to have gotten there.  e.g.:</span></td>
516
      </tr>
517
      <tr>
518
        <td id="L15" class="blob-num js-line-number" data-line-number="15"></td>
519
        <td id="LC15" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span>  ./uv5r.py --read radio2.img &amp;&amp; cmp radio.img radio2.img &amp;&amp; echo &quot;OK&quot;</span></td>
520
      </tr>
521
      <tr>
522
        <td id="L16" class="blob-num js-line-number" data-line-number="16"></td>
523
        <td id="LC16" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span></span></td>
524
      </tr>
525
      <tr>
526
        <td id="L17" class="blob-num js-line-number" data-line-number="17"></td>
527
        <td id="LC17" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> (C) 2014 Nathaniel Wesley Filardo</span></td>
528
      </tr>
529
      <tr>
530
        <td id="L18" class="blob-num js-line-number" data-line-number="18"></td>
531
        <td id="LC18" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Distributable under terms of GNU GPLv3</span></td>
532
      </tr>
533
      <tr>
534
        <td id="L19" class="blob-num js-line-number" data-line-number="19"></td>
535
        <td id="LC19" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> Most code here originally &quot;Copyright 2012 Dan Smith &lt;dsmith@danplanet.com&gt;&quot;</span></td>
536
      </tr>
537
      <tr>
538
        <td id="L20" class="blob-num js-line-number" data-line-number="20"></td>
539
        <td id="LC20" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">#</span> as part of the CHIRP project.</span></td>
540
      </tr>
541
      <tr>
542
        <td id="L21" class="blob-num js-line-number" data-line-number="21"></td>
543
        <td id="LC21" class="blob-code blob-code-inner js-file-line">
544
</td>
545
      </tr>
546
      <tr>
547
        <td id="L22" class="blob-num js-line-number" data-line-number="22"></td>
548
        <td id="LC22" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> sys, os, serial, time, struct</td>
549
      </tr>
550
      <tr>
551
        <td id="L23" class="blob-num js-line-number" data-line-number="23"></td>
552
        <td id="LC23" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> traceback</td>
553
      </tr>
554
      <tr>
555
        <td id="L24" class="blob-num js-line-number" data-line-number="24"></td>
556
        <td id="LC24" class="blob-code blob-code-inner js-file-line"><span class="pl-k">import</span> argparse</td>
557
      </tr>
558
      <tr>
559
        <td id="L25" class="blob-num js-line-number" data-line-number="25"></td>
560
        <td id="LC25" class="blob-code blob-code-inner js-file-line">
561
</td>
562
      </tr>
563
      <tr>
564
        <td id="L26" class="blob-num js-line-number" data-line-number="26"></td>
565
        <td id="LC26" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">hexprint</span>(<span class="pl-smi">data</span>):</td>
566
      </tr>
567
      <tr>
568
        <td id="L27" class="blob-num js-line-number" data-line-number="27"></td>
569
        <td id="LC27" class="blob-code blob-code-inner js-file-line">    <span class="pl-s"><span class="pl-pds">&quot;&quot;&quot;</span>Return a hexdump-like encoding of @data<span class="pl-pds">&quot;&quot;&quot;</span></span></td>
570
      </tr>
571
      <tr>
572
        <td id="L28" class="blob-num js-line-number" data-line-number="28"></td>
573
        <td id="LC28" class="blob-code blob-code-inner js-file-line">    line_sz <span class="pl-k">=</span> <span class="pl-c1">8</span></td>
574
      </tr>
575
      <tr>
576
        <td id="L29" class="blob-num js-line-number" data-line-number="29"></td>
577
        <td id="LC29" class="blob-code blob-code-inner js-file-line">
578
</td>
579
      </tr>
580
      <tr>
581
        <td id="L30" class="blob-num js-line-number" data-line-number="30"></td>
582
        <td id="LC30" class="blob-code blob-code-inner js-file-line">    lines <span class="pl-k">=</span> <span class="pl-c1">len</span>(data) <span class="pl-k">/</span> line_sz</td>
583
      </tr>
584
      <tr>
585
        <td id="L31" class="blob-num js-line-number" data-line-number="31"></td>
586
        <td id="LC31" class="blob-code blob-code-inner js-file-line">    </td>
587
      </tr>
588
      <tr>
589
        <td id="L32" class="blob-num js-line-number" data-line-number="32"></td>
590
        <td id="LC32" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">if</span> (<span class="pl-c1">len</span>(data) <span class="pl-k">%</span> line_sz) <span class="pl-k">!=</span> <span class="pl-c1">0</span>:</td>
591
      </tr>
592
      <tr>
593
        <td id="L33" class="blob-num js-line-number" data-line-number="33"></td>
594
        <td id="LC33" class="blob-code blob-code-inner js-file-line">        lines <span class="pl-k">+=</span> <span class="pl-c1">1</span></td>
595
      </tr>
596
      <tr>
597
        <td id="L34" class="blob-num js-line-number" data-line-number="34"></td>
598
        <td id="LC34" class="blob-code blob-code-inner js-file-line">        data <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-cce">\x00</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">*</span> ((lines <span class="pl-k">*</span> line_sz) <span class="pl-k">-</span> <span class="pl-c1">len</span>(data))</td>
599
      </tr>
600
      <tr>
601
        <td id="L35" class="blob-num js-line-number" data-line-number="35"></td>
602
        <td id="LC35" class="blob-code blob-code-inner js-file-line">
603
</td>
604
      </tr>
605
      <tr>
606
        <td id="L36" class="blob-num js-line-number" data-line-number="36"></td>
607
        <td id="LC36" class="blob-code blob-code-inner js-file-line">    out <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-pds">&quot;</span></span></td>
608
      </tr>
609
      <tr>
610
        <td id="L37" class="blob-num js-line-number" data-line-number="37"></td>
611
        <td id="LC37" class="blob-code blob-code-inner js-file-line">        </td>
612
      </tr>
613
      <tr>
614
        <td id="L38" class="blob-num js-line-number" data-line-number="38"></td>
615
        <td id="LC38" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1">0</span>, (<span class="pl-c1">len</span>(data)<span class="pl-k">/</span>line_sz)):</td>
616
      </tr>
617
      <tr>
618
        <td id="L39" class="blob-num js-line-number" data-line-number="39"></td>
619
        <td id="LC39" class="blob-code blob-code-inner js-file-line">        out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%03i</span>: <span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> (i <span class="pl-k">*</span> line_sz)</td>
620
      </tr>
621
      <tr>
622
        <td id="L40" class="blob-num js-line-number" data-line-number="40"></td>
623
        <td id="LC40" class="blob-code blob-code-inner js-file-line">
624
</td>
625
      </tr>
626
      <tr>
627
        <td id="L41" class="blob-num js-line-number" data-line-number="41"></td>
628
        <td id="LC41" class="blob-code blob-code-inner js-file-line">        left <span class="pl-k">=</span> <span class="pl-c1">len</span>(data) <span class="pl-k">-</span> (i <span class="pl-k">*</span> line_sz)</td>
629
      </tr>
630
      <tr>
631
        <td id="L42" class="blob-num js-line-number" data-line-number="42"></td>
632
        <td id="LC42" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">if</span> left <span class="pl-k">&lt;</span> line_sz:</td>
633
      </tr>
634
      <tr>
635
        <td id="L43" class="blob-num js-line-number" data-line-number="43"></td>
636
        <td id="LC43" class="blob-code blob-code-inner js-file-line">            limit <span class="pl-k">=</span> left</td>
637
      </tr>
638
      <tr>
639
        <td id="L44" class="blob-num js-line-number" data-line-number="44"></td>
640
        <td id="LC44" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">else</span>:</td>
641
      </tr>
642
      <tr>
643
        <td id="L45" class="blob-num js-line-number" data-line-number="45"></td>
644
        <td id="LC45" class="blob-code blob-code-inner js-file-line">            limit <span class="pl-k">=</span> line_sz</td>
645
      </tr>
646
      <tr>
647
        <td id="L46" class="blob-num js-line-number" data-line-number="46"></td>
648
        <td id="LC46" class="blob-code blob-code-inner js-file-line">            </td>
649
      </tr>
650
      <tr>
651
        <td id="L47" class="blob-num js-line-number" data-line-number="47"></td>
652
        <td id="LC47" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">for</span> j <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1">0</span>, limit):</td>
653
      </tr>
654
      <tr>
655
        <td id="L48" class="blob-num js-line-number" data-line-number="48"></td>
656
        <td id="LC48" class="blob-code blob-code-inner js-file-line">            out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%02x</span> <span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> <span class="pl-c1">ord</span>(data[(i <span class="pl-k">*</span> line_sz) <span class="pl-k">+</span> j])</td>
657
      </tr>
658
      <tr>
659
        <td id="L49" class="blob-num js-line-number" data-line-number="49"></td>
660
        <td id="LC49" class="blob-code blob-code-inner js-file-line">
661
</td>
662
      </tr>
663
      <tr>
664
        <td id="L50" class="blob-num js-line-number" data-line-number="50"></td>
665
        <td id="LC50" class="blob-code blob-code-inner js-file-line">        out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span>  <span class="pl-pds">&quot;</span></span></td>
666
      </tr>
667
      <tr>
668
        <td id="L51" class="blob-num js-line-number" data-line-number="51"></td>
669
        <td id="LC51" class="blob-code blob-code-inner js-file-line">
670
</td>
671
      </tr>
672
      <tr>
673
        <td id="L52" class="blob-num js-line-number" data-line-number="52"></td>
674
        <td id="LC52" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">for</span> j <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1">0</span>, limit):</td>
675
      </tr>
676
      <tr>
677
        <td id="L53" class="blob-num js-line-number" data-line-number="53"></td>
678
        <td id="LC53" class="blob-code blob-code-inner js-file-line">            char <span class="pl-k">=</span> data[(i <span class="pl-k">*</span> line_sz) <span class="pl-k">+</span> j]</td>
679
      </tr>
680
      <tr>
681
        <td id="L54" class="blob-num js-line-number" data-line-number="54"></td>
682
        <td id="LC54" class="blob-code blob-code-inner js-file-line">
683
</td>
684
      </tr>
685
      <tr>
686
        <td id="L55" class="blob-num js-line-number" data-line-number="55"></td>
687
        <td id="LC55" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">if</span> <span class="pl-c1">ord</span>(char) <span class="pl-k">&gt;</span> <span class="pl-c1"><span class="pl-k">0x</span>20</span> <span class="pl-k">and</span> <span class="pl-c1">ord</span>(char) <span class="pl-k">&lt;</span> <span class="pl-c1"><span class="pl-k">0x</span>7E</span>:</td>
688
      </tr>
689
      <tr>
690
        <td id="L56" class="blob-num js-line-number" data-line-number="56"></td>
691
        <td id="LC56" class="blob-code blob-code-inner js-file-line">                out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> char</td>
692
      </tr>
693
      <tr>
694
        <td id="L57" class="blob-num js-line-number" data-line-number="57"></td>
695
        <td id="LC57" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">else</span>:</td>
696
      </tr>
697
      <tr>
698
        <td id="L58" class="blob-num js-line-number" data-line-number="58"></td>
699
        <td id="LC58" class="blob-code blob-code-inner js-file-line">                out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span>.<span class="pl-pds">&quot;</span></span></td>
700
      </tr>
701
      <tr>
702
        <td id="L59" class="blob-num js-line-number" data-line-number="59"></td>
703
        <td id="LC59" class="blob-code blob-code-inner js-file-line">
704
</td>
705
      </tr>
706
      <tr>
707
        <td id="L60" class="blob-num js-line-number" data-line-number="60"></td>
708
        <td id="LC60" class="blob-code blob-code-inner js-file-line">        out <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-cce">\n</span><span class="pl-pds">&quot;</span></span></td>
709
      </tr>
710
      <tr>
711
        <td id="L61" class="blob-num js-line-number" data-line-number="61"></td>
712
        <td id="LC61" class="blob-code blob-code-inner js-file-line">
713
</td>
714
      </tr>
715
      <tr>
716
        <td id="L62" class="blob-num js-line-number" data-line-number="62"></td>
717
        <td id="LC62" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">return</span> out</td>
718
      </tr>
719
      <tr>
720
        <td id="L63" class="blob-num js-line-number" data-line-number="63"></td>
721
        <td id="LC63" class="blob-code blob-code-inner js-file-line">
722
</td>
723
      </tr>
724
      <tr>
725
        <td id="L64" class="blob-num js-line-number" data-line-number="64"></td>
726
        <td id="LC64" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">et</span>(<span class="pl-smi">ser</span>) :</td>
727
      </tr>
728
      <tr>
729
        <td id="L65" class="blob-num js-line-number" data-line-number="65"></td>
730
        <td id="LC65" class="blob-code blob-code-inner js-file-line">    ser.write(<span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-cce">\x06</span><span class="pl-pds">&quot;</span></span>)</td>
731
      </tr>
732
      <tr>
733
        <td id="L66" class="blob-num js-line-number" data-line-number="66"></td>
734
        <td id="LC66" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">assert</span> (ser.read(<span class="pl-c1">1</span>) <span class="pl-k">==</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\x06</span><span class="pl-pds">&#39;</span></span>)</td>
735
      </tr>
736
      <tr>
737
        <td id="L67" class="blob-num js-line-number" data-line-number="67"></td>
738
        <td id="LC67" class="blob-code blob-code-inner js-file-line">
739
</td>
740
      </tr>
741
      <tr>
742
        <td id="L68" class="blob-num js-line-number" data-line-number="68"></td>
743
        <td id="LC68" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">magic</span>(<span class="pl-smi">ser</span>) :</td>
744
      </tr>
745
      <tr>
746
        <td id="L69" class="blob-num js-line-number" data-line-number="69"></td>
747
        <td id="LC69" class="blob-code blob-code-inner js-file-line">    <span class="pl-c1">UV5R_MODEL_291</span>  <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-cce">\x50\xBB\xFF\x20\x12\x07\x25</span><span class="pl-pds">&quot;</span></span></td>
748
      </tr>
749
      <tr>
750
        <td id="L70" class="blob-num js-line-number" data-line-number="70"></td>
751
        <td id="LC70" class="blob-code blob-code-inner js-file-line">
752
</td>
753
      </tr>
754
      <tr>
755
        <td id="L71" class="blob-num js-line-number" data-line-number="71"></td>
756
        <td id="LC71" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">for</span> byte <span class="pl-k">in</span> <span class="pl-c1">UV5R_MODEL_291</span> :</td>
757
      </tr>
758
      <tr>
759
        <td id="L72" class="blob-num js-line-number" data-line-number="72"></td>
760
        <td id="LC72" class="blob-code blob-code-inner js-file-line">        ser.write(byte)</td>
761
      </tr>
762
      <tr>
763
        <td id="L73" class="blob-num js-line-number" data-line-number="73"></td>
764
        <td id="LC73" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">assert</span> (ser.read(<span class="pl-c1">1</span>) <span class="pl-k">==</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\x06</span><span class="pl-pds">&#39;</span></span>)</td>
765
      </tr>
766
      <tr>
767
        <td id="L74" class="blob-num js-line-number" data-line-number="74"></td>
768
        <td id="LC74" class="blob-code blob-code-inner js-file-line">
769
</td>
770
      </tr>
771
      <tr>
772
        <td id="L75" class="blob-num js-line-number" data-line-number="75"></td>
773
        <td id="LC75" class="blob-code blob-code-inner js-file-line">    ser.write(<span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\x02</span><span class="pl-pds">&#39;</span></span>)</td>
774
      </tr>
775
      <tr>
776
        <td id="L76" class="blob-num js-line-number" data-line-number="76"></td>
777
        <td id="LC76" class="blob-code blob-code-inner js-file-line">    ident <span class="pl-k">=</span> ser.read(<span class="pl-c1">8</span>)</td>
778
      </tr>
779
      <tr>
780
        <td id="L77" class="blob-num js-line-number" data-line-number="77"></td>
781
        <td id="LC77" class="blob-code blob-code-inner js-file-line">    et(ser)</td>
782
      </tr>
783
      <tr>
784
        <td id="L78" class="blob-num js-line-number" data-line-number="78"></td>
785
        <td id="LC78" class="blob-code blob-code-inner js-file-line">
786
</td>
787
      </tr>
788
      <tr>
789
        <td id="L79" class="blob-num js-line-number" data-line-number="79"></td>
790
        <td id="LC79" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">return</span> ident</td>
791
      </tr>
792
      <tr>
793
        <td id="L80" class="blob-num js-line-number" data-line-number="80"></td>
794
        <td id="LC80" class="blob-code blob-code-inner js-file-line">
795
</td>
796
      </tr>
797
      <tr>
798
        <td id="L81" class="blob-num js-line-number" data-line-number="81"></td>
799
        <td id="LC81" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">_readblk</span>(<span class="pl-smi">ser</span>, <span class="pl-smi">start</span>, <span class="pl-smi">size</span>) :</td>
800
      </tr>
801
      <tr>
802
        <td id="L82" class="blob-num js-line-number" data-line-number="82"></td>
803
        <td id="LC82" class="blob-code blob-code-inner js-file-line">    msg <span class="pl-k">=</span> struct.pack(<span class="pl-s"><span class="pl-pds">&quot;</span>&gt;BHB<span class="pl-pds">&quot;</span></span>, <span class="pl-c1">ord</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>S<span class="pl-pds">&quot;</span></span>), start, size)</td>
804
      </tr>
805
      <tr>
806
        <td id="L83" class="blob-num js-line-number" data-line-number="83"></td>
807
        <td id="LC83" class="blob-code blob-code-inner js-file-line">    ser.write(msg)</td>
808
      </tr>
809
      <tr>
810
        <td id="L84" class="blob-num js-line-number" data-line-number="84"></td>
811
        <td id="LC84" class="blob-code blob-code-inner js-file-line">
812
</td>
813
      </tr>
814
      <tr>
815
        <td id="L85" class="blob-num js-line-number" data-line-number="85"></td>
816
        <td id="LC85" class="blob-code blob-code-inner js-file-line">    answer <span class="pl-k">=</span> ser.read(<span class="pl-c1">4</span>)</td>
817
      </tr>
818
      <tr>
819
        <td id="L86" class="blob-num js-line-number" data-line-number="86"></td>
820
        <td id="LC86" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">assert</span> (<span class="pl-c1">4</span> <span class="pl-k">==</span> <span class="pl-c1">len</span>(answer))</td>
821
      </tr>
822
      <tr>
823
        <td id="L87" class="blob-num js-line-number" data-line-number="87"></td>
824
        <td id="LC87" class="blob-code blob-code-inner js-file-line">
825
</td>
826
      </tr>
827
      <tr>
828
        <td id="L88" class="blob-num js-line-number" data-line-number="88"></td>
829
        <td id="LC88" class="blob-code blob-code-inner js-file-line">    cmd, addr, length <span class="pl-k">=</span> struct.unpack(<span class="pl-s"><span class="pl-pds">&quot;</span>&gt;BHB<span class="pl-pds">&quot;</span></span>, answer)</td>
830
      </tr>
831
      <tr>
832
        <td id="L89" class="blob-num js-line-number" data-line-number="89"></td>
833
        <td id="LC89" class="blob-code blob-code-inner js-file-line">    <span class="pl-c"><span class="pl-c">#</span> print &quot;CMD: %s  ADDR: %04x  SIZE: %02x&quot; % (cmd, addr, length)</span></td>
834
      </tr>
835
      <tr>
836
        <td id="L90" class="blob-num js-line-number" data-line-number="90"></td>
837
        <td id="LC90" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">assert</span> (cmd <span class="pl-k">==</span> <span class="pl-c1">ord</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>X<span class="pl-pds">&quot;</span></span>) <span class="pl-k">and</span> addr <span class="pl-k">==</span> start <span class="pl-k">and</span> length <span class="pl-k">==</span> size)</td>
838
      </tr>
839
      <tr>
840
        <td id="L91" class="blob-num js-line-number" data-line-number="91"></td>
841
        <td id="LC91" class="blob-code blob-code-inner js-file-line">
842
</td>
843
      </tr>
844
      <tr>
845
        <td id="L92" class="blob-num js-line-number" data-line-number="92"></td>
846
        <td id="LC92" class="blob-code blob-code-inner js-file-line">    chunk <span class="pl-k">=</span> ser.read(size)</td>
847
      </tr>
848
      <tr>
849
        <td id="L93" class="blob-num js-line-number" data-line-number="93"></td>
850
        <td id="LC93" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">assert</span> (size <span class="pl-k">==</span> <span class="pl-c1">len</span>(chunk))</td>
851
      </tr>
852
      <tr>
853
        <td id="L94" class="blob-num js-line-number" data-line-number="94"></td>
854
        <td id="LC94" class="blob-code blob-code-inner js-file-line">    et(ser)</td>
855
      </tr>
856
      <tr>
857
        <td id="L95" class="blob-num js-line-number" data-line-number="95"></td>
858
        <td id="LC95" class="blob-code blob-code-inner js-file-line">
859
</td>
860
      </tr>
861
      <tr>
862
        <td id="L96" class="blob-num js-line-number" data-line-number="96"></td>
863
        <td id="LC96" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">return</span> chunk</td>
864
      </tr>
865
      <tr>
866
        <td id="L97" class="blob-num js-line-number" data-line-number="97"></td>
867
        <td id="LC97" class="blob-code blob-code-inner js-file-line">
868
</td>
869
      </tr>
870
      <tr>
871
        <td id="L98" class="blob-num js-line-number" data-line-number="98"></td>
872
        <td id="LC98" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">readblk</span>(<span class="pl-smi">ser</span>, <span class="pl-smi">start</span>, <span class="pl-smi">size</span>) :</td>
873
      </tr>
874
      <tr>
875
        <td id="L99" class="blob-num js-line-number" data-line-number="99"></td>
876
        <td id="LC99" class="blob-code blob-code-inner js-file-line">    needs_init <span class="pl-k">=</span> <span class="pl-c1">0</span></td>
877
      </tr>
878
      <tr>
879
        <td id="L100" class="blob-num js-line-number" data-line-number="100"></td>
880
        <td id="LC100" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">while</span> <span class="pl-c1">True</span>:</td>
881
      </tr>
882
      <tr>
883
        <td id="L101" class="blob-num js-line-number" data-line-number="101"></td>
884
        <td id="LC101" class="blob-code blob-code-inner js-file-line">        <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ATTEMPTING READ OF BLOCK <span class="pl-c1">%x</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> i</td>
885
      </tr>
886
      <tr>
887
        <td id="L102" class="blob-num js-line-number" data-line-number="102"></td>
888
        <td id="LC102" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">try</span>:</td>
889
      </tr>
890
      <tr>
891
        <td id="L103" class="blob-num js-line-number" data-line-number="103"></td>
892
        <td id="LC103" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">if</span> needs_init :</td>
893
      </tr>
894
      <tr>
895
        <td id="L104" class="blob-num js-line-number" data-line-number="104"></td>
896
        <td id="LC104" class="blob-code blob-code-inner js-file-line">                <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span>REINIT...<span class="pl-pds">&quot;</span></span></td>
897
      </tr>
898
      <tr>
899
        <td id="L105" class="blob-num js-line-number" data-line-number="105"></td>
900
        <td id="LC105" class="blob-code blob-code-inner js-file-line">                time.sleep(<span class="pl-c1">10</span>)</td>
901
      </tr>
902
      <tr>
903
        <td id="L106" class="blob-num js-line-number" data-line-number="106"></td>
904
        <td id="LC106" class="blob-code blob-code-inner js-file-line">                magic(ser)</td>
905
      </tr>
906
      <tr>
907
        <td id="L107" class="blob-num js-line-number" data-line-number="107"></td>
908
        <td id="LC107" class="blob-code blob-code-inner js-file-line">                needs_init <span class="pl-k">=</span> <span class="pl-c1">0</span></td>
909
      </tr>
910
      <tr>
911
        <td id="L108" class="blob-num js-line-number" data-line-number="108"></td>
912
        <td id="LC108" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">return</span> _readblk(ser, start, size)</td>
913
      </tr>
914
      <tr>
915
        <td id="L109" class="blob-num js-line-number" data-line-number="109"></td>
916
        <td id="LC109" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">except</span> <span class="pl-c1">Exception</span>:</td>
917
      </tr>
918
      <tr>
919
        <td id="L110" class="blob-num js-line-number" data-line-number="110"></td>
920
        <td id="LC110" class="blob-code blob-code-inner js-file-line">            traceback.print_exc()</td>
921
      </tr>
922
      <tr>
923
        <td id="L111" class="blob-num js-line-number" data-line-number="111"></td>
924
        <td id="LC111" class="blob-code blob-code-inner js-file-line">            needs_init <span class="pl-k">=</span> <span class="pl-c1">1</span></td>
925
      </tr>
926
      <tr>
927
        <td id="L112" class="blob-num js-line-number" data-line-number="112"></td>
928
        <td id="LC112" class="blob-code blob-code-inner js-file-line">
929
</td>
930
      </tr>
931
      <tr>
932
        <td id="L113" class="blob-num js-line-number" data-line-number="113"></td>
933
        <td id="LC113" class="blob-code blob-code-inner js-file-line"><span class="pl-k">def</span> <span class="pl-en">writeblk</span>(<span class="pl-smi">ser</span>, <span class="pl-smi">start</span>, <span class="pl-smi">chunk</span>) :</td>
934
      </tr>
935
      <tr>
936
        <td id="L114" class="blob-num js-line-number" data-line-number="114"></td>
937
        <td id="LC114" class="blob-code blob-code-inner js-file-line">    size <span class="pl-k">=</span> <span class="pl-c1">len</span>(chunk)</td>
938
      </tr>
939
      <tr>
940
        <td id="L115" class="blob-num js-line-number" data-line-number="115"></td>
941
        <td id="LC115" class="blob-code blob-code-inner js-file-line">    msg <span class="pl-k">=</span> struct.pack(<span class="pl-s"><span class="pl-pds">&quot;</span>&gt;BHB<span class="pl-pds">&quot;</span></span>, <span class="pl-c1">ord</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>X<span class="pl-pds">&quot;</span></span>), start, size)</td>
942
      </tr>
943
      <tr>
944
        <td id="L116" class="blob-num js-line-number" data-line-number="116"></td>
945
        <td id="LC116" class="blob-code blob-code-inner js-file-line">    needs_init <span class="pl-k">=</span> <span class="pl-c1">0</span></td>
946
      </tr>
947
      <tr>
948
        <td id="L117" class="blob-num js-line-number" data-line-number="117"></td>
949
        <td id="LC117" class="blob-code blob-code-inner js-file-line">    <span class="pl-k">while</span> <span class="pl-c1">True</span>:</td>
950
      </tr>
951
      <tr>
952
        <td id="L118" class="blob-num js-line-number" data-line-number="118"></td>
953
        <td id="LC118" class="blob-code blob-code-inner js-file-line">        <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span>ATTEMPTING WRITE TO BLOCK <span class="pl-c1">%x</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> start</td>
954
      </tr>
955
      <tr>
956
        <td id="L119" class="blob-num js-line-number" data-line-number="119"></td>
957
        <td id="LC119" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">try</span>:</td>
958
      </tr>
959
      <tr>
960
        <td id="L120" class="blob-num js-line-number" data-line-number="120"></td>
961
        <td id="LC120" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">if</span> needs_init :</td>
962
      </tr>
963
      <tr>
964
        <td id="L121" class="blob-num js-line-number" data-line-number="121"></td>
965
        <td id="LC121" class="blob-code blob-code-inner js-file-line">                <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span>REINIT...<span class="pl-pds">&quot;</span></span></td>
966
      </tr>
967
      <tr>
968
        <td id="L122" class="blob-num js-line-number" data-line-number="122"></td>
969
        <td id="LC122" class="blob-code blob-code-inner js-file-line">                time.sleep(<span class="pl-c1">10</span>)</td>
970
      </tr>
971
      <tr>
972
        <td id="L123" class="blob-num js-line-number" data-line-number="123"></td>
973
        <td id="LC123" class="blob-code blob-code-inner js-file-line">                magic(ser)</td>
974
      </tr>
975
      <tr>
976
        <td id="L124" class="blob-num js-line-number" data-line-number="124"></td>
977
        <td id="LC124" class="blob-code blob-code-inner js-file-line">                needs_init <span class="pl-k">=</span> <span class="pl-c1">0</span></td>
978
      </tr>
979
      <tr>
980
        <td id="L125" class="blob-num js-line-number" data-line-number="125"></td>
981
        <td id="LC125" class="blob-code blob-code-inner js-file-line">
982
</td>
983
      </tr>
984
      <tr>
985
        <td id="L126" class="blob-num js-line-number" data-line-number="126"></td>
986
        <td id="LC126" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">assert</span> (ser.write(msg) <span class="pl-k">==</span> <span class="pl-c1">len</span>(msg))</td>
987
      </tr>
988
      <tr>
989
        <td id="L127" class="blob-num js-line-number" data-line-number="127"></td>
990
        <td id="LC127" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">assert</span> (ser.write(chunk) <span class="pl-k">==</span> size)</td>
991
      </tr>
992
      <tr>
993
        <td id="L128" class="blob-num js-line-number" data-line-number="128"></td>
994
        <td id="LC128" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">assert</span> (ser.read(<span class="pl-c1">1</span>) <span class="pl-k">==</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\x06</span><span class="pl-pds">&#39;</span></span>)</td>
995
      </tr>
996
      <tr>
997
        <td id="L129" class="blob-num js-line-number" data-line-number="129"></td>
998
        <td id="LC129" class="blob-code blob-code-inner js-file-line">
999
</td>
1000
      </tr>
1001
      <tr>
1002
        <td id="L130" class="blob-num js-line-number" data-line-number="130"></td>
1003
        <td id="LC130" class="blob-code blob-code-inner js-file-line">            <span class="pl-k">return</span></td>
1004
      </tr>
1005
      <tr>
1006
        <td id="L131" class="blob-num js-line-number" data-line-number="131"></td>
1007
        <td id="LC131" class="blob-code blob-code-inner js-file-line">        <span class="pl-k">except</span> <span class="pl-c1">Exception</span>:</td>
1008
      </tr>
1009
      <tr>
1010
        <td id="L132" class="blob-num js-line-number" data-line-number="132"></td>
1011
        <td id="LC132" class="blob-code blob-code-inner js-file-line">            traceback.print_exc()</td>
1012
      </tr>
1013
      <tr>
1014
        <td id="L133" class="blob-num js-line-number" data-line-number="133"></td>
1015
        <td id="LC133" class="blob-code blob-code-inner js-file-line">            needs_init <span class="pl-k">=</span> <span class="pl-c1">1</span></td>
1016
      </tr>
1017
      <tr>
1018
        <td id="L134" class="blob-num js-line-number" data-line-number="134"></td>
1019
        <td id="LC134" class="blob-code blob-code-inner js-file-line">
1020
</td>
1021
      </tr>
1022
      <tr>
1023
        <td id="L135" class="blob-num js-line-number" data-line-number="135"></td>
1024
        <td id="LC135" class="blob-code blob-code-inner js-file-line">parser <span class="pl-k">=</span> argparse.ArgumentParser(<span class="pl-v">description</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>UV-5R image extractor<span class="pl-pds">&#39;</span></span>)</td>
1025
      </tr>
1026
      <tr>
1027
        <td id="L136" class="blob-num js-line-number" data-line-number="136"></td>
1028
        <td id="LC136" class="blob-code blob-code-inner js-file-line">parser.add_argument(<span class="pl-s"><span class="pl-pds">&#39;</span>--radio<span class="pl-pds">&#39;</span></span>, <span class="pl-v">dest</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>radio<span class="pl-pds">&#39;</span></span>, <span class="pl-v">default</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&quot;</span>/dev/ttyUSB0<span class="pl-pds">&quot;</span></span>)</td>
1029
      </tr>
1030
      <tr>
1031
        <td id="L137" class="blob-num js-line-number" data-line-number="137"></td>
1032
        <td id="LC137" class="blob-code blob-code-inner js-file-line">parser.add_argument(<span class="pl-s"><span class="pl-pds">&#39;</span>--read<span class="pl-pds">&#39;</span></span>, <span class="pl-v">dest</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>outfile<span class="pl-pds">&#39;</span></span>, <span class="pl-v">type</span><span class="pl-k">=</span>argparse.FileType(<span class="pl-s"><span class="pl-pds">&#39;</span>w<span class="pl-pds">&#39;</span></span>))</td>
1033
      </tr>
1034
      <tr>
1035
        <td id="L138" class="blob-num js-line-number" data-line-number="138"></td>
1036
        <td id="LC138" class="blob-code blob-code-inner js-file-line">parser.add_argument(<span class="pl-s"><span class="pl-pds">&#39;</span>--dump<span class="pl-pds">&#39;</span></span>, <span class="pl-v">dest</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>dump<span class="pl-pds">&#39;</span></span>, <span class="pl-v">action</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>store_true<span class="pl-pds">&#39;</span></span>)</td>
1037
      </tr>
1038
      <tr>
1039
        <td id="L139" class="blob-num js-line-number" data-line-number="139"></td>
1040
        <td id="LC139" class="blob-code blob-code-inner js-file-line">parser.add_argument(<span class="pl-s"><span class="pl-pds">&#39;</span>--write<span class="pl-pds">&#39;</span></span>, <span class="pl-v">dest</span><span class="pl-k">=</span><span class="pl-s"><span class="pl-pds">&#39;</span>infile<span class="pl-pds">&#39;</span></span>, <span class="pl-v">type</span><span class="pl-k">=</span>argparse.FileType(<span class="pl-s"><span class="pl-pds">&#39;</span>r<span class="pl-pds">&#39;</span></span>))</td>
1041
      </tr>
1042
      <tr>
1043
        <td id="L140" class="blob-num js-line-number" data-line-number="140"></td>
1044
        <td id="LC140" class="blob-code blob-code-inner js-file-line">
1045
</td>
1046
      </tr>
1047
      <tr>
1048
        <td id="L141" class="blob-num js-line-number" data-line-number="141"></td>
1049
        <td id="LC141" class="blob-code blob-code-inner js-file-line">args <span class="pl-k">=</span> parser.parse_args()</td>
1050
      </tr>
1051
      <tr>
1052
        <td id="L142" class="blob-num js-line-number" data-line-number="142"></td>
1053
        <td id="LC142" class="blob-code blob-code-inner js-file-line">
1054
</td>
1055
      </tr>
1056
      <tr>
1057
        <td id="L143" class="blob-num js-line-number" data-line-number="143"></td>
1058
        <td id="LC143" class="blob-code blob-code-inner js-file-line">ser <span class="pl-k">=</span> serial.Serial(args.radio, <span class="pl-c1">9600</span>, <span class="pl-v">timeout</span><span class="pl-k">=</span><span class="pl-c1">1</span>)</td>
1059
      </tr>
1060
      <tr>
1061
        <td id="L144" class="blob-num js-line-number" data-line-number="144"></td>
1062
        <td id="LC144" class="blob-code blob-code-inner js-file-line"><span class="pl-k">assert</span> (ser)</td>
1063
      </tr>
1064
      <tr>
1065
        <td id="L145" class="blob-num js-line-number" data-line-number="145"></td>
1066
        <td id="LC145" class="blob-code blob-code-inner js-file-line">
1067
</td>
1068
      </tr>
1069
      <tr>
1070
        <td id="L146" class="blob-num js-line-number" data-line-number="146"></td>
1071
        <td id="LC146" class="blob-code blob-code-inner js-file-line"><span class="pl-k">if</span> args.outfile <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> <span class="pl-k">or</span> args.dump :</td>
1072
      </tr>
1073
      <tr>
1074
        <td id="L147" class="blob-num js-line-number" data-line-number="147"></td>
1075
        <td id="LC147" class="blob-code blob-code-inner js-file-line">
1076
</td>
1077
      </tr>
1078
      <tr>
1079
        <td id="L148" class="blob-num js-line-number" data-line-number="148"></td>
1080
        <td id="LC148" class="blob-code blob-code-inner js-file-line">  blocks <span class="pl-k">=</span> {}</td>
1081
      </tr>
1082
      <tr>
1083
        <td id="L149" class="blob-num js-line-number" data-line-number="149"></td>
1084
        <td id="LC149" class="blob-code blob-code-inner js-file-line">  </td>
1085
      </tr>
1086
      <tr>
1087
        <td id="L150" class="blob-num js-line-number" data-line-number="150"></td>
1088
        <td id="LC150" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">try</span>:</td>
1089
      </tr>
1090
      <tr>
1091
        <td id="L151" class="blob-num js-line-number" data-line-number="151"></td>
1092
        <td id="LC151" class="blob-code blob-code-inner js-file-line">      ident <span class="pl-k">=</span> magic(ser)</td>
1093
      </tr>
1094
      <tr>
1095
        <td id="L152" class="blob-num js-line-number" data-line-number="152"></td>
1096
        <td id="LC152" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">except</span> <span class="pl-c1">Exception</span>:</td>
1097
      </tr>
1098
      <tr>
1099
        <td id="L153" class="blob-num js-line-number" data-line-number="153"></td>
1100
        <td id="LC153" class="blob-code blob-code-inner js-file-line">      traceback.print_exc()</td>
1101
      </tr>
1102
      <tr>
1103
        <td id="L154" class="blob-num js-line-number" data-line-number="154"></td>
1104
        <td id="LC154" class="blob-code blob-code-inner js-file-line">      <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span>Retrying initialization...<span class="pl-pds">&quot;</span></span></td>
1105
      </tr>
1106
      <tr>
1107
        <td id="L155" class="blob-num js-line-number" data-line-number="155"></td>
1108
        <td id="LC155" class="blob-code blob-code-inner js-file-line">      ident <span class="pl-k">=</span> magic(ser)</td>
1109
      </tr>
1110
      <tr>
1111
        <td id="L156" class="blob-num js-line-number" data-line-number="156"></td>
1112
        <td id="LC156" class="blob-code blob-code-inner js-file-line">  </td>
1113
      </tr>
1114
      <tr>
1115
        <td id="L157" class="blob-num js-line-number" data-line-number="157"></td>
1116
        <td id="LC157" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1">0</span>, <span class="pl-c1"><span class="pl-k">0x</span>1800</span>, <span class="pl-c1"><span class="pl-k">0x</span>40</span>):</td>
1117
      </tr>
1118
      <tr>
1119
        <td id="L158" class="blob-num js-line-number" data-line-number="158"></td>
1120
        <td id="LC158" class="blob-code blob-code-inner js-file-line">      blocks[i] <span class="pl-k">=</span> readblk(ser, i, <span class="pl-c1"><span class="pl-k">0x</span>40</span>)</td>
1121
      </tr>
1122
      <tr>
1123
        <td id="L159" class="blob-num js-line-number" data-line-number="159"></td>
1124
        <td id="LC159" class="blob-code blob-code-inner js-file-line">  </td>
1125
      </tr>
1126
      <tr>
1127
        <td id="L160" class="blob-num js-line-number" data-line-number="160"></td>
1128
        <td id="LC160" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1"><span class="pl-k">0x</span>1EC0</span>, <span class="pl-c1"><span class="pl-k">0x</span>2000</span>, <span class="pl-c1"><span class="pl-k">0x</span>40</span>):</td>
1129
      </tr>
1130
      <tr>
1131
        <td id="L161" class="blob-num js-line-number" data-line-number="161"></td>
1132
        <td id="LC161" class="blob-code blob-code-inner js-file-line">      blocks[i] <span class="pl-k">=</span> readblk(ser, i, <span class="pl-c1"><span class="pl-k">0x</span>40</span>)</td>
1133
      </tr>
1134
      <tr>
1135
        <td id="L162" class="blob-num js-line-number" data-line-number="162"></td>
1136
        <td id="LC162" class="blob-code blob-code-inner js-file-line">  </td>
1137
      </tr>
1138
      <tr>
1139
        <td id="L163" class="blob-num js-line-number" data-line-number="163"></td>
1140
        <td id="LC163" class="blob-code blob-code-inner js-file-line">  bitems <span class="pl-k">=</span> blocks.items()</td>
1141
      </tr>
1142
      <tr>
1143
        <td id="L164" class="blob-num js-line-number" data-line-number="164"></td>
1144
        <td id="LC164" class="blob-code blob-code-inner js-file-line">  bitems.sort()</td>
1145
      </tr>
1146
      <tr>
1147
        <td id="L165" class="blob-num js-line-number" data-line-number="165"></td>
1148
        <td id="LC165" class="blob-code blob-code-inner js-file-line">  sblocks <span class="pl-k">=</span> [blk <span class="pl-k">for</span> (_,blk) <span class="pl-k">in</span> bitems]</td>
1149
      </tr>
1150
      <tr>
1151
        <td id="L166" class="blob-num js-line-number" data-line-number="166"></td>
1152
        <td id="LC166" class="blob-code blob-code-inner js-file-line">
1153
</td>
1154
      </tr>
1155
      <tr>
1156
        <td id="L167" class="blob-num js-line-number" data-line-number="167"></td>
1157
        <td id="LC167" class="blob-code blob-code-inner js-file-line">  data <span class="pl-k">=</span> ident <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>.join(sblocks)</td>
1158
      </tr>
1159
      <tr>
1160
        <td id="L168" class="blob-num js-line-number" data-line-number="168"></td>
1161
        <td id="LC168" class="blob-code blob-code-inner js-file-line">
1162
</td>
1163
      </tr>
1164
      <tr>
1165
        <td id="L169" class="blob-num js-line-number" data-line-number="169"></td>
1166
        <td id="LC169" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">if</span> args.dump :</td>
1167
      </tr>
1168
      <tr>
1169
        <td id="L170" class="blob-num js-line-number" data-line-number="170"></td>
1170
        <td id="LC170" class="blob-code blob-code-inner js-file-line">    <span class="pl-c1">print</span> <span class="pl-s"><span class="pl-pds">&quot;</span><span class="pl-c1">%s</span><span class="pl-cce">\n</span><span class="pl-pds">&quot;</span></span> <span class="pl-k">%</span> hexprint(data)</td>
1171
      </tr>
1172
      <tr>
1173
        <td id="L171" class="blob-num js-line-number" data-line-number="171"></td>
1174
        <td id="LC171" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">if</span> args.outfile :</td>
1175
      </tr>
1176
      <tr>
1177
        <td id="L172" class="blob-num js-line-number" data-line-number="172"></td>
1178
        <td id="LC172" class="blob-code blob-code-inner js-file-line">    args.outfile.write(data)</td>
1179
      </tr>
1180
      <tr>
1181
        <td id="L173" class="blob-num js-line-number" data-line-number="173"></td>
1182
        <td id="LC173" class="blob-code blob-code-inner js-file-line">    args.outfile.close()</td>
1183
      </tr>
1184
      <tr>
1185
        <td id="L174" class="blob-num js-line-number" data-line-number="174"></td>
1186
        <td id="LC174" class="blob-code blob-code-inner js-file-line">
1187
</td>
1188
      </tr>
1189
      <tr>
1190
        <td id="L175" class="blob-num js-line-number" data-line-number="175"></td>
1191
        <td id="LC175" class="blob-code blob-code-inner js-file-line"><span class="pl-k">if</span> args.infile <span class="pl-k">is</span> <span class="pl-k">not</span> <span class="pl-c1">None</span> :</td>
1192
      </tr>
1193
      <tr>
1194
        <td id="L176" class="blob-num js-line-number" data-line-number="176"></td>
1195
        <td id="LC176" class="blob-code blob-code-inner js-file-line">
1196
</td>
1197
      </tr>
1198
      <tr>
1199
        <td id="L177" class="blob-num js-line-number" data-line-number="177"></td>
1200
        <td id="LC177" class="blob-code blob-code-inner js-file-line">  expected_ident <span class="pl-k">=</span> args.infile.read(<span class="pl-c1">8</span>)</td>
1201
      </tr>
1202
      <tr>
1203
        <td id="L178" class="blob-num js-line-number" data-line-number="178"></td>
1204
        <td id="LC178" class="blob-code blob-code-inner js-file-line">  blocks <span class="pl-k">=</span> {}</td>
1205
      </tr>
1206
      <tr>
1207
        <td id="L179" class="blob-num js-line-number" data-line-number="179"></td>
1208
        <td id="LC179" class="blob-code blob-code-inner js-file-line">
1209
</td>
1210
      </tr>
1211
      <tr>
1212
        <td id="L180" class="blob-num js-line-number" data-line-number="180"></td>
1213
        <td id="LC180" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1">0</span>, <span class="pl-c1"><span class="pl-k">0x</span>1800</span>, <span class="pl-c1"><span class="pl-k">0x</span>10</span>):</td>
1214
      </tr>
1215
      <tr>
1216
        <td id="L181" class="blob-num js-line-number" data-line-number="181"></td>
1217
        <td id="LC181" class="blob-code blob-code-inner js-file-line">    blocks[i] <span class="pl-k">=</span> args.infile.read(<span class="pl-c1"><span class="pl-k">0x</span>10</span>)</td>
1218
      </tr>
1219
      <tr>
1220
        <td id="L182" class="blob-num js-line-number" data-line-number="182"></td>
1221
        <td id="LC182" class="blob-code blob-code-inner js-file-line">
1222
</td>
1223
      </tr>
1224
      <tr>
1225
        <td id="L183" class="blob-num js-line-number" data-line-number="183"></td>
1226
        <td id="LC183" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">range</span>(<span class="pl-c1"><span class="pl-k">0x</span>1EC0</span>, <span class="pl-c1"><span class="pl-k">0x</span>2000</span>, <span class="pl-c1"><span class="pl-k">0x</span>10</span>):</td>
1227
      </tr>
1228
      <tr>
1229
        <td id="L184" class="blob-num js-line-number" data-line-number="184"></td>
1230
        <td id="LC184" class="blob-code blob-code-inner js-file-line">    blocks[i] <span class="pl-k">=</span> args.infile.read(<span class="pl-c1"><span class="pl-k">0x</span>10</span>)</td>
1231
      </tr>
1232
      <tr>
1233
        <td id="L185" class="blob-num js-line-number" data-line-number="185"></td>
1234
        <td id="LC185" class="blob-code blob-code-inner js-file-line">
1235
</td>
1236
      </tr>
1237
      <tr>
1238
        <td id="L186" class="blob-num js-line-number" data-line-number="186"></td>
1239
        <td id="LC186" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">assert</span>(args.infile.read(<span class="pl-c1">1</span>) <span class="pl-k">==</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>)</td>
1240
      </tr>
1241
      <tr>
1242
        <td id="L187" class="blob-num js-line-number" data-line-number="187"></td>
1243
        <td id="LC187" class="blob-code blob-code-inner js-file-line">  args.infile.close()</td>
1244
      </tr>
1245
      <tr>
1246
        <td id="L188" class="blob-num js-line-number" data-line-number="188"></td>
1247
        <td id="LC188" class="blob-code blob-code-inner js-file-line">
1248
</td>
1249
      </tr>
1250
      <tr>
1251
        <td id="L189" class="blob-num js-line-number" data-line-number="189"></td>
1252
        <td id="LC189" class="blob-code blob-code-inner js-file-line">  actual_ident <span class="pl-k">=</span> magic(ser)</td>
1253
      </tr>
1254
      <tr>
1255
        <td id="L190" class="blob-num js-line-number" data-line-number="190"></td>
1256
        <td id="LC190" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">assert</span>(expected_ident <span class="pl-k">==</span> actual_ident)</td>
1257
      </tr>
1258
      <tr>
1259
        <td id="L191" class="blob-num js-line-number" data-line-number="191"></td>
1260
        <td id="LC191" class="blob-code blob-code-inner js-file-line">
1261
</td>
1262
      </tr>
1263
      <tr>
1264
        <td id="L192" class="blob-num js-line-number" data-line-number="192"></td>
1265
        <td id="LC192" class="blob-code blob-code-inner js-file-line">  sblocks <span class="pl-k">=</span> blocks.items()</td>
1266
      </tr>
1267
      <tr>
1268
        <td id="L193" class="blob-num js-line-number" data-line-number="193"></td>
1269
        <td id="LC193" class="blob-code blob-code-inner js-file-line">  sblocks.sort()</td>
1270
      </tr>
1271
      <tr>
1272
        <td id="L194" class="blob-num js-line-number" data-line-number="194"></td>
1273
        <td id="LC194" class="blob-code blob-code-inner js-file-line">
1274
</td>
1275
      </tr>
1276
      <tr>
1277
        <td id="L195" class="blob-num js-line-number" data-line-number="195"></td>
1278
        <td id="LC195" class="blob-code blob-code-inner js-file-line">  <span class="pl-k">for</span> (k,v) <span class="pl-k">in</span> sblocks :</td>
1279
      </tr>
1280
      <tr>
1281
        <td id="L196" class="blob-num js-line-number" data-line-number="196"></td>
1282
        <td id="LC196" class="blob-code blob-code-inner js-file-line">    writeblk(ser, k, v)</td>
1283
      </tr>
1284
</table>
1285

    
1286
  <div class="BlobToolbar position-absolute js-file-line-actions dropdown js-menu-container js-select-menu d-none" aria-hidden="true">
1287
    <button class="btn-octicon ml-0 px-2 p-0 bg-white border border-gray-dark rounded-1 dropdown-toggle js-menu-target" id="js-file-line-action-button" type="button" aria-expanded="false" aria-haspopup="true" aria-label="Inline file action toolbar" aria-controls="inline-file-actions">
1288
      <svg aria-hidden="true" class="octicon" height="16" version="1.1" viewBox="0 0 13 4" width="14">
1289
        <g stroke="none" stroke-width="1" fill-rule="evenodd">
1290
            <g transform="translate(-1.000000, -6.000000)">
1291
                <path d="M2.5,9.5 C1.67157288,9.5 1,8.82842712 1,8 C1,7.17157288 1.67157288,6.5 2.5,6.5 C3.32842712,6.5 4,7.17157288 4,8 C4,8.82842712 3.32842712,9.5 2.5,9.5 Z M7.5,9.5 C6.67157288,9.5 6,8.82842712 6,8 C6,7.17157288 6.67157288,6.5 7.5,6.5 C8.32842712,6.5 9,7.17157288 9,8 C9,8.82842712 8.32842712,9.5 7.5,9.5 Z M12.5,9.5 C11.6715729,9.5 11,8.82842712 11,8 C11,7.17157288 11.6715729,6.5 12.5,6.5 C13.3284271,6.5 14,7.17157288 14,8 C14,8.82842712 13.3284271,9.5 12.5,9.5 Z"></path>
1292
            </g>
1293
        </g>
1294
      </svg>
1295
    </button>
1296
    <div class="dropdown-menu-content js-menu-content" id="inline-file-actions">
1297
      <ul class="BlobToolbar-dropdown dropdown-menu dropdown-menu-se mt-2">
1298
        <li><a class="js-zeroclipboard dropdown-item" style="cursor:pointer;" id="js-copy-lines" data-original-text="Copy lines">Copy lines</a></li>
1299
        <li><a class="js-zeroclipboard dropdown-item" id= "js-copy-permalink" style="cursor:pointer;" data-original-text="Copy permalink">Copy permalink</a></li>
1300
        <li><a href="/nwf/nwfsmallutils/blame/a430e7eba0b83b422de12fe02b832028374a725a/ham/uv5r.py" class="dropdown-item js-update-url-with-hash" id="js-view-git-blame">View git blame</a></li>
1301
          <li><a href="/nwf/nwfsmallutils/issues/new" class="dropdown-item" id="js-new-issue">Open new issue</a></li>
1302
      </ul>
1303
    </div>
1304
  </div>
1305

    
1306
  </div>
1307

    
1308
  </div>
1309

    
1310
  <button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button>
1311
  <div id="jump-to-line" style="display:none">
1312
    <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
1313
      <input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" aria-label="Jump to line" autofocus>
1314
      <button type="submit" class="btn">Go</button>
1315
</form>  </div>
1316

    
1317
  </div>
1318
  <div class="modal-backdrop js-touch-events"></div>
1319
</div>
1320

    
1321
    </div>
1322
  </div>
1323

    
1324
  </div>
1325

    
1326
      
1327
<div class="footer container-lg px-3" role="contentinfo">
1328
  <div class="position-relative d-flex flex-justify-between py-6 mt-6 f6 text-gray border-top border-gray-light ">
1329
    <ul class="list-style-none d-flex flex-wrap ">
1330
      <li class="mr-3">&copy; 2017 <span title="0.16537s from unicorn-332038186-w6td1">GitHub</span>, Inc.</li>
1331
        <li class="mr-3"><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
1332
        <li class="mr-3"><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
1333
        <li class="mr-3"><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
1334
        <li class="mr-3"><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
1335
        <li><a href="https://help.github.com" data-ga-click="Footer, go to help, text:help">Help</a></li>
1336
    </ul>
1337

    
1338
    <a href="https://github.com" aria-label="Homepage" class="footer-octicon" title="GitHub">
1339
      <svg aria-hidden="true" class="octicon octicon-mark-github" height="24" version="1.1" viewBox="0 0 16 16" width="24"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
1340
</a>
1341
    <ul class="list-style-none d-flex flex-wrap ">
1342
        <li class="mr-3"><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact GitHub</a></li>
1343
      <li class="mr-3"><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
1344
      <li class="mr-3"><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
1345
      <li class="mr-3"><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
1346
        <li class="mr-3"><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
1347
        <li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
1348

    
1349
    </ul>
1350
  </div>
1351
</div>
1352

    
1353

    
1354

    
1355
  <div id="ajax-error-message" class="ajax-error-message flash flash-error">
1356
    <svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
1357
    <button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
1358
      <svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
1359
    </button>
1360
    You can't perform that action at this time.
1361
  </div>
1362

    
1363

    
1364
    
1365
    <script crossorigin="anonymous" integrity="sha256-Sxs+Reu4luxVVaYLalcHLGmPG0uGt2qgtP4QZ/RAsfM=" src="https://assets-cdn.github.com/assets/frameworks-4b1b3e45ebb896ec5555a60b6a57072c698f1b4b86b76aa0b4fe1067f440b1f3.js"></script>
1366
    
1367
    <script async="async" crossorigin="anonymous" integrity="sha256-1vu8AFCLtWxDoi0N05Zd/fFWz7/pkimUlAVHu0cVuuI=" src="https://assets-cdn.github.com/assets/github-d6fbbc00508bb56c43a22d0dd3965dfdf156cfbfe9922994940547bb4715bae2.js"></script>
1368
    
1369
    
1370
    
1371
    
1372
  <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none">
1373
    <svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
1374
    <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
1375
    <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
1376
  </div>
1377
  <div class="facebox" id="facebox" style="display:none;">
1378
  <div class="facebox-popup">
1379
    <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
1380
    </div>
1381
    <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
1382
      <svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
1383
    </button>
1384
  </div>
1385
</div>
1386

    
1387

    
1388
  </body>
1389
</html>
1390